Jumping to IAP code issue
Hi,
I am facing some issues while jumping from main application to the last locations(0x0801C000) of the flash memory, where IAP application (customized) is located.
The controller used is STM32F072.(128kb flash,Cortex-M0).
The main application code placed at 0x08000000.
I am using the GPRS modem to receive a new bin file from FTP (through main application) and am successful in placing the received bin starting from flash location 0x0800d800.
Issue: I am getting hard-fault error while jumping from main application to IAP locations. Especially when I set main stack pointer to 0x801c000 (__set_MSP(0x801c000))
JumpAddress = *(__IO uint32_t*) (0x0801C004);
Jump_To_Application = (pFunction) (JumpAddress);
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) 0x0801C000);
Jump_To_Application();Can someone please help. I am not getting what is going wrong.