cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U073 - Can you bootload a factory-new device?

dmarks-ls
Associate

I have on my desk an STM32F407 Discovery board and an STM32U083 Nucleo board.  My intent is to write software for the F407 to bootload the U083 via I2C.  As far as I can tell, these are the general steps:

  1. Drive BOOT0 high and pulse the NRST pin on the U083 to enter the bootloader.
  2. Send appropriate erase/write/read commands to reprogram flash.
  3. Drive BOOT0 low and pulse the NRST pin to have the U083 boot from flash.

Problem is, I can't even seem to do step 1.  I have a logic analyzer verifying NRST and BOOT0 at the U083 chip, but regardless of the state of BOOT0, if I reset the U083, it boots from flash (i.e. I see my debug output on the UART).

Looking at RM0503, section 2.5 Boot configuration, Table 6 Boot modes, there are two ways to boot into system memory.  Summarizing the table's logic conditions:

  1. BOOT_LOCK bit must be 0.
  2. nBOOT1 bit must be 1.
  3. If nBOOT_SEL bit is 0, BOOT0 pin must be 1.
  4. If nBOOT_SEL bit is 1, nBOOT0 bit must be 0.

Here are the option bytes and their factory default values:

option_bytes_1.pngoption_bytes_2.png

BOOT_LOCK, naturally, defaults to 0, so that's fine.  But all of the other bits default to 1, including nBOOT_SEL, which needs to be 0 to allow BOOT0 to do, well, anything.

Am I correct in that it's not possible to bootload a U083 device via I2C unless you've touched it at least once with a programmer and cleared the nBOOT_SEL bit?  (If so, that's extremely annoying for our rev. A prototype.)

Dana M.

2 REPLIES 2
Pavel A.
Evangelist III

Some STM32 models have special device to allow first time programming by the built-in bootloader: if the user flash is "empty" (few first bytes are 0xFF) the MCU starts the built-in bootloader no matter what is state of BOOT0. Test whether your U0's behave this way. 

 

TDK
Guru

As @Pavel A. suggests, the chip will boot into the bootloader if flash is erased. Per AN2606, relevant table entry for STM32U071 is Pattern 11. Third match is what happens on a fresh chip.

TDK_0-1740441313656.png

 

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