2023-12-22 01:14 AM - last edited on 2023-12-25 07:27 AM by SofLit
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
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)?
2023-12-22 04:15 AM - edited 2023-12-22 04:16 AM
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:
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):
Hope that helps?
Regards
/Peter
2023-12-22 08:34 AM
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 ...