2025-02-24 03:01 PM
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:
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:
Here are the option bytes and their factory default values:
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.
2025-02-24 03:23 PM
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.
2025-02-24 03:55 PM
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.