Solved
Stm32F437 custom bootloader
Hi everybody
I'm developing a simple bootloader which run an application loaded in flash memory at the address 0x80200000.
The application alone works correctly but when I use the boot the app doesn't run.
This is the code of my boootloader
#define ACTIVE_FW_BASE_ADDRESS 0x08020000
static void SBL_BootFW()
{
void (*app_reset_handler)(void); //Function pointer to hold the address of the reset handler of the Firmware
uint32_t msp_value = *(volatile uint32_t *)ACTIVE_FW_BASE_ADDRESS; //Firmware starting address
/* STEP 1: Update Interrupt Vector Table */
SCB->VTOR = (ACTIVE_FW_BASE_ADDRESS);
/* STEP 2: Configure the MSP by reading the value from the base address of the sector 2 */
__set_MSP(msp_value);
/* STEP 3: Fetch the reset handler address of the Firmware from its starting address + 4 */
uint32_t resethandler_address = *(volatile uint32_t *)(ACTIVE_FW_BASE_ADDRESS + 4);
app_reset_handler = (void*)resethandler_address;
/* STEP 4: Jump to the reset handler of the Firmware */
app_reset_handler();
}
And the FALSH:ld of the application:
/* Memories definition */
MEMORY
{
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K
FLASH (rx) : ORIGIN = 0x8020000, LENGTH = 2048K - 128k
}Someone have some suggestions?
Thanks in advance
