Live data from Hacker News

Debugging bare-metal STM32 from the seventh level of hell

jpieper.com

11–20 of 70 posts

Re: Debugging bare-metal STM32 from the seventh level of hell

#11

Earlier quoted context omitted.

If you can use Cortex-M0+ (so not likely for this project, BLDC where you want floating point), maybe think about RP2040 (Raspberry Pi Pico chip)? More than 100K of them in stock at Digikey, only $1 each... But they come in only one package type, and use external flash (an advantage, IMHO). I've recently started looking at them. The SDK is nice except that they chose to use CMake. I designed it out: https://github.co…

> an advantage, IMHO it isn't An extra chip means higher cost to produce & assemble board, larger board size, more pins wasted on this nonsense, most fast-edge signals to route, more passives, extra risk to handle for one extra chip being out of stock, and it is much easier to extract firmware than even from a "protected" stm32 Also wasting RAM (and power for it) on code, or random (between high and very high) latenc…

But balanced against basically unlimited flash size. Many of my projects end up having an external SPI-flash for one reason or another anyway.

Another similar chip is the i.MX rt1020 from NXP (except Cortex-M7 and way more expensive). The one gotcha was that there was only one QSPI-flash controller even though there were two ports. It meant that the extra port (which we assumed would be available during architecture) was not fully usable without interfering with the firmware.

Re: Debugging bare-metal STM32 from the seventh level of hell

#13

Earlier quoted context omitted.

> an advantage, IMHO it isn't An extra chip means higher cost to produce & assemble board, larger board size, more pins wasted on this nonsense, most fast-edge signals to route, more passives, extra risk to handle for one extra chip being out of stock, and it is much easier to extract firmware than even from a "protected" stm32 Also wasting RAM (and power for it) on code, or random (between high and very high) latenc…

But balanced against basically unlimited flash size. Many of my projects end up having an external SPI-flash for one reason or another anyway. Another similar chip is the i.MX rt1020 from NXP (except Cortex-M7 and way more expensive). The one gotcha was that there was only one QSPI-flash controller even though there were two ports. It meant that the extra port (which we assumed would be available during architecture)…

> Many of my projects end up having an external SPI-flash for one reason or another anyway.

for what? What sort of possible thing would you need to do on a c-m0 that needs more than 128K of CODE!?

Re: Debugging bare-metal STM32 from the seventh level of hell

#14

Earlier quoted context omitted.

But balanced against basically unlimited flash size. Many of my projects end up having an external SPI-flash for one reason or another anyway. Another similar chip is the i.MX rt1020 from NXP (except Cortex-M7 and way more expensive). The one gotcha was that there was only one QSPI-flash controller even though there were two ports. It meant that the extra port (which we assumed would be available during architecture)…

> Many of my projects end up having an external SPI-flash for one reason or another anyway. for what? What sort of possible thing would you need to do on a c-m0 that needs more than 128K of CODE!?

Not so much for code, but lots of use for persistent data (logs, databases, etc.). Only a part of it would be used for XIP. Also with more flash space it's easy to have multiple banks for safe firmware update and the like.

Re: Debugging bare-metal STM32 from the seventh level of hell

#15

Earlier quoted context omitted.

But balanced against basically unlimited flash size. Many of my projects end up having an external SPI-flash for one reason or another anyway. Another similar chip is the i.MX rt1020 from NXP (except Cortex-M7 and way more expensive). The one gotcha was that there was only one QSPI-flash controller even though there were two ports. It meant that the extra port (which we assumed would be available during architecture)…

> Many of my projects end up having an external SPI-flash for one reason or another anyway. for what? What sort of possible thing would you need to do on a c-m0 that needs more than 128K of CODE!?

ADC calibration data. Plus some ID data. Plus log of very nasty events specific to my application. And there comes external SPI flash.

Re: Debugging bare-metal STM32 from the seventh level of hell

#16

Yikes! That sounds frustrating. As the article concluded with, the way forward appears at the end; ST adding an errata for this. The elephant in the room: How is the author getting STM32 G4s? I've been F5ing this every day with no luck for months: https://octopart.com/search?q=stm32g4+ceu&currency=USD&specs...

There's plenty of STM32 of any flavor in China. Alibaba is a good source. There may be fakes though, but reputable resellers (pay attention to reviews and tenure) normally sell genuine chips.

Are fakes of lesser quality? How do you tell fake from genuine?

Re: Debugging bare-metal STM32 from the seventh level of hell

#19

Earlier quoted context omitted.

> an advantage, IMHO it isn't An extra chip means higher cost to produce & assemble board, larger board size, more pins wasted on this nonsense, most fast-edge signals to route, more passives, extra risk to handle for one extra chip being out of stock, and it is much easier to extract firmware than even from a "protected" stm32 Also wasting RAM (and power for it) on code, or random (between high and very high) latenc…

But balanced against basically unlimited flash size. Many of my projects end up having an external SPI-flash for one reason or another anyway. Another similar chip is the i.MX rt1020 from NXP (except Cortex-M7 and way more expensive). The one gotcha was that there was only one QSPI-flash controller even though there were two ports. It meant that the extra port (which we assumed would be available during architecture)…

You can still get that with chips that have onboard flash, via QSPI or OctoSPI.

Re: Debugging bare-metal STM32 from the seventh level of hell

#20
How did they manage to get STM32s?

My friend's small business had to close, because key MCU is not available anywhere and Chinese sell it for the price of the end product. Makes business no longer viable. He spent over a month designing board for another MCU that was available at the time, but as soon as he was ready to produce more the alternative was gone too. It's like chasing own tail.

Big corporations can post huge back-orders, but small business can't tie up that kind of sums of money for unknown period of time. He placed orders for that MCU over a year ago and distributors still tell the production is delayed. Meanwhile Chinese don't seem to be short of supply and are milking the desperate market.

Seems like a state intervention would be welcome here.

Post reply on HN