cancel
Showing results for 
Search instead for 
Did you mean: 

Flashing firmware using System Bootloader and STM32CubeProgrammer on Nucleo-G491RE

newbie_stm32
Associate III

Hi, I am working on making firmware write work using System Bootloader and USART1 interface on NUCLEO-G491RE. I have a code snippet taken from the internet which jumps to the System Bootloader section of the code once the User Button is pressed. I have interfaced a USB to UART converter at PA9, PA10, and GND as suggested in the AN2606.

void BootloaderInit() {
	void (*SysMemBootJump)(void);
 
	volatile uint32_t addr = 0x1FFF0000;
	HAL_RCC_DeInit();
 
	SysTick->CTRL = 0;
	SysTick->LOAD = 0;
	SysTick->VAL = 0;
 
	__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
	__disable_irq();
	SysMemBootJump = (void (*)(void)) (*((uint32_t*) (addr + 4)));
	__set_MSP(*(uint32_t*) addr);
	SysMemBootJump();
}

But once the User Button is pressed and tried to connect to the UART interface using STM32CubeProgrammer it shows


_legacyfs_online_stmicro_images_0693W00000bimIOQAY.pngWhy is the firmware upgrade not working?

23 REPLIES 23

Will try this out

Kamil Duljas
Senior III
  1. Additional tip: Add HAL_DeInit(); after HAL_RCC_DeInit();

Dudo
image don’t show BOOT_LOCK and with this setup you always boot to system bootrom...
Kamil Duljas
Senior III

@newbie_stm32​  Some success?

Look at my settings:


_legacyfs_online_stmicro_images_0693W00000biwJvQAI.pngYou have simmilar board. try use jumper to connect. My result:


_legacyfs_online_stmicro_images_0693W00000biwKAQAY.png

Dudo
newbie_stm32
Associate III

Hi @Kamil Duljas​, it did work for me. But when I tried it one more time, I got the same error message as shown before. I can assure you that connecting the BOOT0 pin to 3V3 and pressing RESET is keeping the MCU in the boot from system memory as there is blink code flashed to MCU with which after pressing RESET is not executing.

PS: I flashed using the system bootloader and immediately after that without disconnecting BOOT0 pressed RESET. After which I am not able to flash again using the system bootloader.

Show me your connections

Dudo

Here it is
_legacyfs_online_stmicro_images_0693W00000bjHZ6QAM.png

Try use only 4 cables. Tx Rx gnd vdd from green pcb​

Dudo

It's 4 only rather than connecting it to VDD (orange cable), I connected it to 5V at jumper.

Ok so now, what's the problem? I'm lost :D

Dudo