2023-04-25 03:34 AM - edited 2023-11-20 07:12 AM
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
Why is the firmware upgrade not working?
2023-05-03 02:53 AM
LoL :). A little bit of history. I started with a mechanism to make the firmware flash with a help of a push button. By pressing it jumps to the start of the system memory and executes. But that did not work for me.
Then to make it simple tried flashing the firmware by configuring Option Bytes and BOOT0 pin. It did work for me for few times but not working now.
So here I am.
2023-05-03 05:13 AM
Can we achieve the same using Open Bootloader?
2023-05-03 07:25 AM
I don't know. I didn't use open bootloader. Could you show me your bootloader code now?
2023-05-03 09:37 PM
Hi @Kamil Duljas, Open Bootloader is an open project by ST and it can be found in the STM32CubeIDE > Target Selection >> Example Project >> OpenBootloader for NUCLEO-G491RE.
I am using it with no modification.