cancel
Showing results for 
Search instead for 
Did you mean: 

How to write custom "ID" to flash (by programmer, not by MCU firmware) ?

I have about 40 devices with identical hardware (STM32G071K). All devices will have the same firmware, but i need to distinguish them by custom unique "ID" (numbers from 1 to 40) - which will serve as address at RS485 network. How to do that ?

On STM32F0 it can be done using "user bytes" in option bytes by CubeProgrammer. But STM32G0 have not this feature. How to simply write number somewhere into flash ?

3 REPLIES 3


_legacyfs_online_stmicro_images_0693W00000bjIajQAE.png?

JW

Thanks. I finaly changed linker script and reserved last flash sector. Then using STM32_Programmer_CLI.exe i can write 32bit value to selected fixed address.

Harvey White
Senior III

Note that each processor has a unique serial number which may be accessed. You could also access that. If you need a correspondence, then that might be a lookup table. You do not program, nor need to program, that serial number.