cancel
Showing results for 
Search instead for 
Did you mean: 

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

MSipo
Senior II

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

 

8 REPLIES 8

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

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

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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

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

This one could be disassembled and inspected.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
STOne-32
ST Employee

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

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.

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

But does that table really state that? Doesn't it only state what memory regions the bootloader use?

MSipo
Senior II

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?