cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to use code built for 32K STM32F051part in same 64K part?

DKlem.3
Associate

Hello,

I have a working system using an STM32F051K6U6, and the code fits in the first 20K or so. Because of the ongoing shortage of specific parts, we would like to include the '051K6U7, '051K8U6 and '051K8U7 as equivalent parts, since temperature range is not an issue, and the K8's should have more memory than needed. My question is, is it safe to assume that the same binary will work for all four of these parts, assuming it was built for the '051K6U6? For manufacturing reasons, it would be impractical, or at least very undesirable, to have to maintain multiple binaries and program each board according to its specific micro.

Unfortunately I don't have sufficient time (or the micros) to be able to test this out, so any advice would be appreciated.

2 REPLIES 2

Check if they use a common die (DEV_ID / DBGMCU), if different likely have different FLASH sectors/size or vector table, if the same the die has more memory than you're using, and you can inspect usability at 0x08008000 in debugger, and write/erase testing.

Uses a single file

STM32Cube_FW_L0_V1.11.0\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\arm\startup_stm32l051xx.s

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Paul1
Lead

Word I received from ST support was:

If same series and only using features that exist in IC then is binary compatible.

i.e. Compile for STM32L476 runs ok on STM32L4x6 (L476/L486/L496/L4A6), but binary for STM32L496 won't run on STM32L476 as the L496 has features not existing in the L476 (CLK, Boot0).

So:

1) It should work without code change if you build for the minimal functionality CPU and put on fancier in same series STM32F0x1, i.e. build with the linker file for the small memory and the extra memory will simply be ignored

2) Careful if using bootloading or SelfFLASh of settings, and Pages/Blocks/Erases can vary with memory changes

3) Test it - manually rework a board with alternate MCU (if footprint reasonable)

4) Order a small build and try it.

5) Buy enough ICs for this build they are gone and you have to purchase from scalpers (yup, there are ST scalpers out there).

*) Many of us are in the same Covid Global Supply boat, I've spent the last 2 weeks chasing IC stock across the planet.

Paul