cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575/585, how to enter ROM bootloader to flash SW at very first time.

JR.3
Associate II

First I was reading:

Reference manual

STM32U575/585 Arm®-based 32-bit MCUs

4 Boot modes

ST programmed

default value

NSBOOTADD0[24:0]

Flash: 0x0800 0000

NSBOOTADD1[24:0]

Bootloader:

0x0BF9 0000

Then:

AN2606

Application note

STM32 microcontroller system memory boot mode

The STM32U575xx/85xx bootloader is activated by applying pattern12

TZen = 0, Boot0(pin) = 0, nSWBoot0(bit) = 1 and NSBOOTADD0 [24:0] = 0x017F200

TZen = 0, Boot0(pin) = 1, nSWBoot0(bit) = 1 and NSBOOTADD1 [24:0] = 0x017F200

TZen = 0, nBoot0(bit) = 0, nSWBoot0(bit) = 0 and NSBOOTADD1 [24:0] = 0x017F200

TZen = 0, nBoot0(bit) = 1, nSWBoot0(bit) = 0 and NSBOOTADD0 [24:0] = 0x017F200

But what are default values for nBoot0 and nSWBoot0 ?

I'am trying to understand how to enter ROM bootloader at very first boot.

11 REPLIES 11
MM..1
Chief II

Patterns is for next boots and options mangle, im not expert for U5 , but seems is configured to start system loader if empty on 0x08...

You can connect one supported interface from AN2606 and try use it.

TDK
Guru

Other families have the default bytes listed in the reference manual, but it seems the STM32U5 does not. Definitely a deficiency in the documentation unless I'm missing it. You could use STM32CubeProgrammer to read the values from a fresh chip to obtain that info.

To me, it doesn't look like the chip will launch the bootloader if flash is empty. Where are you finding that @MM..1​ ?

Getting into the bootloader for the very first time is probably going to require some hardware connection. SWD programming mode will work just fine, but if you want to program over a bootloader interface, probably will need to pull BOOT0 high. You could even fabricate the chip with it held high and modify option bytes during programming to ignore that bit. Other families are configured such that BOOT0 pin is active as a default, I would expect the STM32U5 is the same but can't confirm.

If you feel a post has answered your question, please click "Accept as Solution".

ST programmed

default value

NSBOOTADD0[24:0]

Flash: 0x0800 0000

NSBOOTADD1[24:0]

Bootloader:

0x0BF9 0000

Yes, but that says nothing about whether or not a factory fresh chip will enter the bootloader.

nSWBoot0/nBoot0 are the relevant bits here, plus the address.

If you feel a post has answered your question, please click "Accept as Solution".

> To me, it doesn't look like the chip will launch the bootloader if flash is empty. Where are you finding that

AN2606 "Table 2. Bootloader activation patterns" contains phrases like "and both banks do not contain valid code" and "and main Flash memory empty". I can confirm that L43x (pattern 6) definitely does it, but it seems that U5 (pattern 12) doesn't.

This is only my tip

I dont study for what is NSBOOTADD0 - 1 , but my tip is based on Boot0 bits , then for start bootloader you onlt need set BOOT0 pin high on reset.

Maybe i miss

CMYL
ST Employee

>> Other families have the default bytes listed in the reference manual, but it seems the STM32U5 does >> not. Definitely a deficiency in the documentation unless I'm missing it.

Default bytes are the values of fab. Once FLASH_OPTR is programmed, default values are lost and changed with ones programmed by user.

After boot we will read the new values loaded from flash memory at OBL. Based on this description new values are unknown/changeable during the device life cycle. That's why in the U5 reference manual there is 0xxxx_xxxxx as reset value for the FLASH_OPTR and for some other register of the FlashIF.

The situation is the same for other families also, but in RM we find just production default values that will be changed with user ones (unknown values: 0xxxx_xxxx).

The problem is that the default value is not listed anywhere. It is well understood that the values can be changed by the user, but the user should know what values are programmed at the factory. That information is missing.
If you feel a post has answered your question, please click "Accept as Solution".
CMYL
ST Employee

I confirm this information is missing. I think it was intentionally kept missing. I let you know if I know the reason.

As described above, values from a fresh chip can be read using STM32CubeProgrammer.