Skip to main content
Michal Dudka
Lead
May 3, 2023
Question

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

  • May 3, 2023
  • 2 replies
  • 11310 views

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 ?

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
May 3, 2023


_legacyfs_online_stmicro_images_0693W00000bjIajQAE.png?

JW

Michal Dudka
Lead
May 3, 2023

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
May 5, 2023

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.