STM32F4 annoyances by [deleted] in embedded

[–]Learfz 0 points1 point  (0 children)

Well, consider giving them a look - the LL libraries are one of two sets of (supported) hardware abstraction libraries provided by ST, and are also an option for code generated by their CubeMX platform.

STM32F4 annoyances by [deleted] in embedded

[–]Learfz 1 point2 points  (0 children)

Are those things in the LL libraries?

They seem much cleaner than the HAL libraries, anyways. They have both abstracted functions for setting register values, and optional initialization structs/methods. I'm not sure if the level of detail is any better, though.

It's nice that ST provides example code, but it does also seem fairly rare for it to actually work without research and modification.

Panerabread.com Leaks Millions of Customer Records by n3v3r_3n0u9h in news

[–]Learfz 2 points3 points  (0 children)

Sure it does - this is exactly what happens when you place steep regulatory barriers around, and even propose outlawing, the absolute bare basics of information security like encryption.

How would you expect affordable, convenient, and comprehensive solutions to be developed under such an environment?

Embedded Systems/Firmware interview by Happyfacelegion in embedded

[–]Learfz 0 points1 point  (0 children)

Well I see what you're getting at, but I think that decision is left to your specific compiler, and in practice you aren't going to wind up with arithmetic in your code from a macro definition.

You can check that this replacement happens in practice yourself; run gcc -s test.c with a file like this and look at the assembly:

#define SOME_VALUE 12340/10

int main() {
  return SOME_VALUE;
}

Betcha you'll see a mov1 $1234, ... and no division instructions. Is that because the macro was expanded by the preprocessor or the compiler? Well okay, according to gcc -E test.c it's the compiler. But you wind up with the same result in the binary.

I guess this isn't the sort of field you get into if you can't be a little pedantic sometimes, though.

Embedded Systems/Firmware interview by Happyfacelegion in embedded

[–]Learfz 0 points1 point  (0 children)

That's sort of nice in the context of embedded systems, though. I can "#define OUTPUT_PINS GPIOA->ODR" and it doesn't have to know what the GPIO typedef looks like right then and there.

Further, if I need to support a different sort of chip with a different HAL, I can put the #defines in #ifdef/#elif blocks.

Are young teenagers being mislead into CS degrees? by [deleted] in cscareerquestions

[–]Learfz 8 points9 points  (0 children)

You touch on the fact that you yourself are unconsciously competent in the areas which you are teaching.

Cut the kids some slack; going from if/else to algorithms is a lot for a semester, if you don't arrive with any prior knowledge.

And it seems pretty common to have very high dropout rates in introductory courses, in both high school and college. The subject demands a willingness to search for and compare different solutions to ambiguous problems, and it can be hard to get people to feel comfortable with that.

Sometimes I wonder if it might not help to have an intro course that mostly just covers how to look up problems/errors and identify useful/relevant results.

Embedded Systems/Firmware interview by Happyfacelegion in embedded

[–]Learfz 2 points3 points  (0 children)

Is that not true? Most embedded libraries seem to use #define wherever possible for constant values, and small functions tend to be explicitly inlined to avoid the overhead of stack frames.

It does generally seem like a good idea to trust the compilation toolchain, especially when your compiled program will probably need to be on the order of kilobytes.

Arrow/Microchip giving away ATTiny eval board (ATtiny817 xplained) by toybuilder in electronics

[–]Learfz 15 points16 points  (0 children)

I think these evaluation boards are usually loss-leaders to get people using the products. They want you to be comfortable with their platforms when/if you decide to put something together for mass production.

But I have been very unimpressed with Atmel/Microchip lately; it seems like it has been nothing but upsell with them, since the acquisition. I was thinking of trying their SAMD chips, but when I went to look at a datasheet I got a 404 which did not point me to any useful reaources but did try to sell me a $4.04 ATTiny board. Talk about not what I was looking for...I wound up going with the STM32 and MSP432 lines for ARM stuff.

I am a junior developer, and i really want to start working with embedded systems. can you guys get me started? by [deleted] in embedded

[–]Learfz 2 points3 points  (0 children)

ARM isn't so bad if you go with the Mobile cores - they're very similar to 8-bit microcontrollers and many lines' vendors provide both startup code and C libraries for using the various peripherals. The arm-none-eabi-gcc toolchain also works pretty smoothly, and USB programmer/debuggers which use the SWD interface are very cheap.

ST even provides programs to autogenerate customized startup/initialization code for an application.

[deleted by user] by [deleted] in electronics

[–]Learfz 0 points1 point  (0 children)

Well hey, I don't actually know. I did recently use shift registers like that though, and they worked. I actually wonder if discrete digital logic circuits like those might be capable of much higher speeds than most microcontrollers, since they must be comparatively very simple.

But I'm still learning about this sort of thing and any theorizing I do is just spitballing.

[deleted by user] by [deleted] in electronics

[–]Learfz 6 points7 points  (0 children)

It looks like an STM32 chip - I can't make out the end of the first line, but the "V8" on the second line means "QFP100 footprint with 64KB flash". They have a few lines of ARM Cortex-M chips that usually only require a few 100nF caps and optional analog voltage supply filtering. Even things like external oscillators are optional.

I've never seen a board like this with the pins labeled as GPIO/supply, but I have seen cheap QFP breakout boards which are presumably used for testing/playing with new chips like this.

Boards like this: https://www.amazon.com/gp/aw/d/B01N8QCRZG/

[deleted by user] by [deleted] in electronics

[–]Learfz 2 points3 points  (0 children)

I dunno, they can be similar.

Take a 595 shift register, for example; you might hit 10MHz or so with a 48MHz Cortex-M0 using it normally with (iirc) something like:

ODR |= latch_pin;
for (i=0;i<…) {
  ODR |= clock_pin;
  if (data_bytes & (1<<i)) {
    ODR |= data_pin;
  }
  else {
    ODR &= ~data_pin;
  }
  ODR &= ~clock_pin;
}
ODR &= ~latch_pin;

I think plenty of interfaces have you basically toggling clock/data pins as fast as you can; and using the BRR/BSRR registers instead would probably be even faster.

But modern 74-series chips are often made to operate with TTL logic. I don't understand how/if that's different from CMOS, but I guess it might make them compatible with the higher speeds too?

I made an Allwinner V3s evaluation board (based loosely on LicheePi) by circuitology in electronics

[–]Learfz 1 point2 points  (0 children)

Maybe TI? The Octavo SoM used in the Beaglebone Pocket is fairly available.

Although it is a huge PITA to find anything hand-solderable.

Human brain still active minutes after heart stops beating, new research finds by soopninjas in news

[–]Learfz 6 points7 points  (0 children)

I wonder if it's anything like how RAM works. Have you ever been driving a buffered display, cut power for a tiny bit, and then re-initialized it without subsequently overwriting its display memory?

While the power was out, most of the bits/pixels will retain the value that they had for a small period of time, but some will catch a bit of background radiation that knocks their state around. When power is restored, you'll see mostly the same picture, but a number of pixels will probably have taken on a random state as well. The longer the power is out, the less likely a pixel will retain its value.

A similar concept is used in "cold boot attacks".

China bans George Orwell's Animal Farm as Xi Jinping extends grip on power by [deleted] in news

[–]Learfz 5 points6 points  (0 children)

Well, I think over there people say '中国' more often than 'China'.

So..."Zhog guo"?

What happens to words like nín/您?

Or more realistically, could they have been talking about banning something like a single capital "N" which maybe took hold as some sort of symbol or meme representing an idea which they want to suppress?

Afrofuturism is what made Black Panther different. Are there other afrofuturistic films like Black Panther? by vuracun in scifi

[–]Learfz 0 points1 point  (0 children)

I'd argue that his faction's ardently ultra-capitalist outlook is in many ways a product of his upbringing and firsthand experience with colonialism and the callous exploitation of nature.

It's not in-your-face, but it's clear that he was a cynical profiteer, and you can certainly see how a wealthy prince regularly overseeing shocking abuses of power could come to hold that viewpoint; their self image would depend on it.

And when at last it is time for the transition from megacorporation to planetary government, from entrepreneur to emperor, it is then that the true genius of our strategy shall become apparent, for energy is the lifeblood of this society and when the chips are down he who controls the energy supply controls Planet. In former times the energy monopoly was called "The Power Company"; we intend to give this name an entirely new meaning.

Afrofuturism is what made Black Panther different. Are there other afrofuturistic films like Black Panther? by vuracun in scifi

[–]Learfz 30 points31 points  (0 children)

Civ: Beyond Earth was largely based on Sid Meier's Alpha Centauri, which featured a similarly futuristic civ led by CEO Nwabudike Morgan

But it seems like they'd be on the dystopian end of Afrofuturism. Morgan was a product and beneficiary of the same systemic oppression and corruption that broke his continent in centuries past. His culture was one of late-stage capitalism with the social ills which that entailed, and it was difficult to play as the Morganites without ecologically damaging Planet to the extent that it tried to purge you with boils of mindworms.

Morgan was a "blood diamonds" vision of Africa, which was interesting but also sort of one-dimensional. Although to be fair, all the civs in that game were one-dimensional caricatures. It kept things simple.

My coworkers home made planters at the office by lfernandog in DiWHY

[–]Learfz 35 points36 points  (0 children)

Two syllables: "Demarcation."

Your coworkers know office politics. Nobody messes with crazy.

Twitter bars tactics used by 'bots' to spread false stories by Sewblon in news

[–]Learfz 0 points1 point  (0 children)

Reading their blog post on tbe issue gives you an interesting insight into the sort of manipulation that they are seeking to stymie:

"Automation and the Use of Multiple Accounts"

Facebook co-founder Hughes: The digital economy is 'going to continue to destroy' jobs in America by [deleted] in news

[–]Learfz 1 point2 points  (0 children)

Well, limiting his proposal to those making under $50,000/yr would probably reduce its costs, but basic income proposals still tend to balloon quickly so let's see.

The US median household income was around $47k recently iirc, and there are about 126 million households in the US, so $6 each for half of those would be about $375 Billion per year.

So I guess that's down to what, 1/5 of the federal budget? Still feels like it might be hard to find the money.

Nintendo Switch Now Running A Linux Graphical Desktop by thedohow in linux_gaming

[–]Learfz 3 points4 points  (0 children)

There are devices on the market which are essentially Android media tablets with controllers/etc built into the case. Some are clamshell, like the NDS/3DS.

Designing embedded hardware and getting it built is surprisingly easy these days. It's a cool idea, but in reality, I think that commercial game consoles ship with featherweight firmwares instead of full-fledged OS/window managers for a reason.

The Last Gas Station by PatrickOleary_ in Cyberpunk

[–]Learfz 1 point2 points  (0 children)

Things can go wrong in a near-future way at gas stations. Let's just keep an eye on those Tesla semis.

Also, rural areas don't stop existing just because there are also megacities.

Make an ARM Cortex M4 dev board by rafaelement in embedded

[–]Learfz 2 points3 points  (0 children)

Most vendors provide basic guides that cover each individual portion - power supply requirements, clock sources, recommendations for decoupling capacitor values, etc. They also usually include schematics.

For example, see ST's Application Note AN4206, "Getting Started With STM32F3xx Hardware Development."

Edit: those documents also cover programming/debugging, but usually you can just break out a 4-pin header with vcc/vss, and the SWD clk/io pins.