cancel
Showing results for 
Search instead for 
Did you mean: 

Storing per-device info on STM32H563 for shared firmware

JuiHung
Visitor

Hi,


I’m developing an application on multiple STM32H563 units on the same board. Although all units use the same firmware, the logic depends on each unit’s position, so I need a way to identify which unit it is.

Currently, I program the full flash memory (.bin/.elf) with STM32CubeIDE or STM32CubeProgrammer. Is there a standard or recommended way on STM32H563 to store small per-device information (like unit ID or role) separately from the main application flash, so the firmware can read it at startup?

 

Thanks for any guidance!

3 REPLIES 3
mfgkw
Senior II

Hi,

you have the choice...

There is a 96 bit unique id.

Or you can write something to 2kB one time programmable (OTP) memory.

JuiHung
Visitor

Hi,

 

Thanks for your reply. We’d prefer not to use OTP for now, as we’re still in development. For the 96-bit unique ID, is there any official documentation or recommended method to read or write it on STM32H563?

Also, is this ID read-only? If so, would it be unsuitable for our needs, since we want to store user-defined, writable information per device?

 

Thanks!

The Id is only readable (via register or HAL functions). See https://community.st.com/t5/stm32-mcus/how-to-obtain-and-use-the-stm32-96-bit-uid/ta-p/621443

You can not modify it, but you can write your code to behave differently depending on known ids.

 

For writing user defined values you can use OTP or flash. Using flash usually wastes much space for a small amount of data.

 

Or attach external EEPROM like 24(LC)... with I2C or 25(LC)... with SPI.