After jumping to application address from bootloader successfully, application gets stuck somewhere
I am working on STM32F412CGU.
I have an application which runs correctly from 0x08000000. (consists MPU, freeRTOS etc)
But need to verify that image so designed a bootloader that can jump to main application at 0x08008000 address.
Now the problem is after jumping to main application address, main application gets stuck.
I am not able to identify whats wrong. Am i missing something which need to be taken care of in order to run my application smoothly ?
Here is modified part of linker script of application:
/* Specify the memory areas */
MEMORY
{
FLASH_priv (rx) : ORIGIN = 0x08008000, LENGTH = 16K
FLASH (rx) : ORIGIN = 0x0800C000, LENGTH = 976K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
}
-------------------------------------------------
Here is the bootloader main part:
------------------------------------------------
#define APPLICATION_START_ADDRESS 0x08008000U
typedef void (*pFunction)(void);
static void vNavigateToApp(void)
{
if (((*(uint32_t*)APPLICATION_START_ADDRESS) & 0x2FFE0000U ) == 0x20000000U)
{
/* First, disable all IRQs */
__disable_irq();
/* Get the main application start address */
uint32_t u32AppStartAddr = *(uint32_t *)(APPLICATION_START_ADDRESS + 4U);
pFunction pfNavigate = (pFunction)u32AppStartAddr;
/* Set the main stack pointer to to the application start address */
__set_MSP((uint32_t) *((__IO uint32_t*)APPLICATION_START_ADDRESS));
HAL_DeInit();
// Now jump to the main application
pfNavigate();
}
}
int main()
{
HAL_Init();
SystemClock_Config();
vNavigateToApp();
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
}
