Skip to main content
Graduate
October 26, 2025
Question

How to set the Device Number/Serial Number on stm32

  • October 26, 2025
  • 1 reply
  • 165 views

Hello, everyone.

So, I want to assign a serial number/device number to all my devices, and each device has a different serial number/device number. My question is, how can I change the serial number/device number with the same firmware without having to change the string in the source code as the serial number/device number and rebuild it?

Is that possible to do in STM32?

Thank you:).

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    October 26, 2025

    Dear @No_Name ,

    STM32 MCUs come with a factory-programmed unique device ID (UID) stored in a dedicated memory area. This UID is read-only, cannot be altered by the end application , and is ideally suited for use as a serial number in your application (e.g., for USB device descriptors or product tracking).

     

    For STM32F1 look at this st.com/resource/en/reference_manual/rm0008-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf  Page 1077

    STOne32_0-1761448113556.png

     

    Hope it helps you.

    STOne-32.