Skip to main content
Graduate
February 26, 2024
Question

Not possible to read the Unique device ID registers (96 bits) on STM32L051 through the bootloader?

  • February 26, 2024
  • 3 replies
  • 2553 views

Is it not possible to read the Unique device ID registers (96 bits) on STM32L051 through the bootloader? I get a NACK on that address.

MSipo_1-1708983528733.png

 

    This topic has been closed for replies.

    3 replies

    Graduate II
    February 26, 2024

    Might not surprise me. How badly do you want to read it?

    Could probably push some code into RAM, and run that to recover

     

    MSipoAuthor
    Graduate
    February 26, 2024

    Is there an address limit where the bootloader can read from?

    Graduate II
    February 26, 2024

    Some of the other bootloaders check for RAM / FLASH address ranges.

    This one could be disassembled and inspected.

    Technical Moderator
    February 27, 2024

    Dear @MSipo ,

    looking at our AN2606 , that address memory is not readable by the embedded bootloader on top of the main Flash/Data user area :

    https://www.st.com/resource/en/application_note/an2606-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf#page407

    IMG_6568.jpeg

    1FF8xxxx where are the Unique ID is not inside .

    Cheers,

    STOne-32

    Visitor II
    February 27, 2024

    I am a bit confused: why are you asking if "bootloader can read the Unique Device ID"?

    Isn't the bootloader hard-coded in MUC? Or do you want to implement your own bootloader?

    As I understand from the reference manual: the Unique ID registers, at address 0x1FF80050, should be possible to read by any FW code. If the bootloader (fixed programmed in MCU) does not do? Maybe it is not used/not needed. How could you "tell the bootloader to read these registers? for you?"

    But your user FW should be able to read this Unique ID (or read it via an external ST-LINK debugger connected).

    How is this Unique ID register related to a bootloader code?

    You should be able to read this Unique ID register any time in your own code.

    Technical Moderator
    February 27, 2024

    Dear @tjaekel ,

    Embedded bootloader is programmed only by ST and done at Factory, it is not a user code that can changed or modified. It has specifications as mentioned in AN2606 such as using RS232 commands and Allowed addresses inside are bounded depending on devices . 

    Of course if using a user code or SWD any address is accessible if not Protected .

    Hope it helps you .

    STOne-32

    MSipoAuthor
    Graduate
    February 27, 2024

    Update:

    I have tested some more here. These are the results:

    These reads work:

    • Read 128 byte starting from 0x1FF8 0000
    • Read 97 byte starting from 0x1FF8 001F
    • Read any individual byte between 0x1FF8 0000 to 0x1FF8 001F

    Does not work:

    • Read 96 byte starting from 0x1FF8 0020. Or read anything starting from 0x1FF8 0020
    • Read any individual byte between 0x1FF8 0020 to 0x1FF8 007F

    MSipo_0-1709025170519.png

     

    Looks like a bug in the bootloader. It will only accept the read if the first address is between 0x1FF8 0000 to 0x1FF8 001F.

    Any thought about that?