2020-08-17 03:42 AM
I'm using STSPIN32F0A witch is based on STM32F031C6 MCU and in my case BOOT0 pin is always connected to the VDD to force the board to boot on system memory, and the idea is to jump from the bootloader to the application on the main flash using the bootloader GO command.
the problem is, when i run the GO command the sequence seems to be correct and I get the ACK as expected but the program does not jump to the application, but instead he goes back to bootloader again.
Here a screen shot of what happens from host side:
i start the communication with the bootloader with 0x7F and i get the ACK (0x79)
after that i sent the Go command (0x21 0xDE ) and i got the ACK (0x79) and then i send the address (0x08000000) with 0x08 as checksum and i got the ACK.
what i assume is that the program should jump to the memory address received in the Go command without reseting the board.
2020-08-17 05:10 AM
Your app would need to remap flash so the vector table works properly.
2020-08-17 09:40 AM
Hi @Community member , could you please explain to me why the app need to remap flash ? thanks
2020-08-17 10:19 AM
Because the ROM's vector table is in effect, and all the interrupts are going through it, and not your code.
You can't reprogram the VTOR register on the CM0, so whatever memory is mapped at zero (ROM, FLASH, RAM) is what is used.
The IWDG watchdog might also be running, if that is the case you'll need to keep kicking that.
I'm not actively using F0 parts.
/* Enable the SYSCFG peripheral clock*/
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* Remap FLASH at 0x00000000 */
__HAL_SYSCFG_REMAPMEMORY_FLASH();
2020-08-17 10:48 AM
Thank you @Community member it works fine now, I am able to jump to my application after remapping the flash even with BOOT0=1.