IAP issue with single bank flash
Hello experts,
I am using stm32f779I - EVAL evaluation kit, am trying to implement LWIP IAP on this board for that I have used example code from the repository C:\Users\Aravind\STM32Cube\Repository\STM32Cube_FW_F7_V1.17.0\Projects\STM32F769I_EVAL\Applications\LwIP\LwIP_IAP and binary file of application availabe in same repository, it is working fine as the binary file says four LEDS toggles, it is toggling.
I have written my own application with flash base address 0x08020000 and vector offset = 0x20000 and loaded the binary file and tried to run it is getting into not valid stack address (LED 3 is getting on ). I have attached the IAP code below which is working fine with binary file from repository but same IAP is getting into not valid stack address with my binary file.
if (((*(__IO uint32_t*)USER_FLASH_FIRST_PAGE_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
{
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (USER_FLASH_FIRST_PAGE_ADDRESS + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) USER_FLASH_FIRST_PAGE_ADDRESS);
Jump_To_Application();
/* do nothing */
while(1);
}
else
{/* Otherwise, do nothing */
/* LED3 (RED) ON to indicate bad software (when not valid stack address) */
BSP_LED_Init(LED3);
BSP_LED_On(LED3);
/* do nothing */
while(1);
}
Please let me know what am I missing.
Thanks & Regards
Srikanth R.
