Showing results for 
Search instead for 
Did you mean: 

Is there somewhere to write custom data that isn't overwritten by the bootloader?

Associate III

I want to be able to program a STM32H7 device with something like a device ID, for example, this device is #10, and that devices is #55. This would affect the behavior of the device, so it must be possible to read that number through the firmware, so that the device is aware of which number it is.

I also want to be able to update the firmware on all devices through the built-in UART bootloader, but I don't want this to wipe the device ID. Is it possible to do something like this without adding an external FLASH?


Isn't there some OTP memory?

Read Unique ID?

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

..and if battery Vbat there, the backup sram .

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Evangelist III

As @tesla suggested, STM32 has built-in unique ID, 96 bits (3*32). Can you use it? 

I think OTP will work. Unique ID won't work because it needs to be a specifically programmed number that changes a delay in communication.

Can OTP be rewritten during development or is it truly a one-time thing?

Pavel A.
Evangelist III

OTP is truly one-time. If this weren't bad enough, STM32H7 does not have OTP at all.


Based how H7 but maybe this helps STM32H7-Memory-Flash (FLASH) have options area 2k

Or if you have spare sectors can use EEPROM emulation ...

And bootloader overwrites only by commands, not all space.


Despite the marketing materials, there is no nonvolatile memory store on the STM32H7 apart from the normal FLASH. The "2KB flash of user option bytes for user configuration" mentioned in the datasheet is presumably a disconnect between what is technically on the chip and what is available to the user and it should be embarrassing to ST that it has not yet been corrected.

Would love to be proven wrong here, btw, but all evidence points to the contrary.

Also see (for the L5):


If you feel a post has answered your question, please click "Accept as Solution".