cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U073 - Can you bootload a factory-new device?

dmarks-ls
Associate III

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.

12 REPLIES 12

I'm still waiting an answer.

I will let you know as soon as I have any feedback.

Thank you for your patience.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
mƎALLEm
ST Employee

Hello,

This is an answer from our expert:

STM32U0 remains using pattern 11 but:

BOOT_LOCK(bit) = 0, nBoot1(bit) = 1, Boot0(pin) = 1 and nBOOT0_SEL(bit) = 1
must be changed to
BOOT_LOCK(bit) = 0, nBoot1(bit) = 1, Boot0(pin) = 1 and nBOOT0_SEL(bit) = 0

AN2606 will be updated accordingly.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@mƎALLEm wrote:

Hello,

This is an answer from our expert:

STM32U0 remains using pattern 11 but:

BOOT_LOCK(bit) = 0, nBoot1(bit) = 1, Boot0(pin) = 1 and nBOOT0_SEL(bit) = 1
must be changed to
BOOT_LOCK(bit) = 0, nBoot1(bit) = 1, Boot0(pin) = 1 and nBOOT0_SEL(bit) = 0

AN2606 will be updated accordingly.


The correction makes sense.  However, I still dispute that the U0 is pattern 11.  @TDK pointed out the definition of Pattern 11 earlier in the thread:

Existing definition of Pattern 11Existing definition of Pattern 11

According to this chart, if the device is not locked, and neither the nBOOT0_SEL nor nBoot0 bits have been programmed (i.e. they are each set to 1 from the factory), then if the main flash is empty, the bootloader should start automatically.  Based on my previous testing, I did not find this to be the case.

Has your expert confirmed that a factory-new U083 or U073, when powered up, automatically enters the bootloader?

Dana M.