cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo stm32g031k8:loading internal boot loader from system memory fails

smoha.2
Associate II

Hi 

I  tried to configure the boot mode of the stm32g031 evaluation board so that the bootloader can boot from System Memory. For this, I have connected the PA14-Boot0 pin to high

smoha2_0-1703169944822.png

smoha2_0-1703235996482.png

Also, the host unit is connected to the target MCU via i2c1(PB6, PB7). i2cdetect in the host unit fails to detect the target MCU i2c address. Also, rework is done on the target MCU where the SB6 is fitted(SB5 removed and soldered to SB6). I also tried connecting PB6(BOOT0) to high, but this didn't work. Could someone please tell me how to load the internal bootloader from system memory to flash the firmware from host unit to target MCU via stm32flash(i2c port)?

2 REPLIES 2
Peter BENSCH
ST Employee

In addition to the AN2606 for an overview of the respective boot sector, there is also the AN4221 for details on the I2C protocol of the boot loader, which I recommend looking through.

Otherwise, you have essentially created the right conditions:

  • PA14-Boot0 = 1 (SB6 would set BOOT0 = 0 and boot into the user flash)
  • I2C1 for the bootloader: PB6 (SCL), PB7 (SDA)

However, you must also have pull-ups of 1.8k on both SCL and SDA, as described by AN2606 in section 4.3.

You can also check whether the boot configuration bits are set correctly (RM0444, section 2.5):

  • BOOT_LOCK bit = 0
  • nBOOT1 bit = 1

Hope that helps?

Regards
/Peter

In order 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.

Notionally you'd want to remap the System ROM into the Zero Address Space (via SYSCFG perhaps)

Collecting SP / PC from the vector table of the ROM, and jumping in. Equivalent to a C function pointer control transfer. Simpler to do cleanly in assembler, but ...

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