Hi All,
My goal is build a bootloader in order to launch and if needed upgrade, my application.
I'm working witu MCUxpresso and LPC54102 microcontroller.
I have already build the bootloader project named SBL.c, thi code is a single core code mapped in the first sector of the LPC Flash memory (Location 0x0, size 0x8000).
I have build also a simple application that toggle a led by one of the GPIO port just to debug the bootloader. This second application is mapped on the second sector of LPC Flash memory (Location 0x8000, size 0x8000).
When I launch the SBL.c by debugger the it goes on a fault condition when it is calling the second application .... Attached a part of SBL.c and a Debugger error.
I have also tryed to leave the SBL.c running without the debugger but it seems not working.
//SBL.c
//Define my Application Address
#define APPLICATION_ADDRESS 0x00008020
typedef void(*pFunction)(void);
pFunction appEntry;
uint32_t appStack;
//Disabling interrupts, before changing interrupt vectors
__disable_irq();
//Get the application stack pointer
appStack=(uint32_t)*((__IO uint32_t*)APPLICATION_ADDRESS);
//Get the application entry point
appEntry=(pFunction)(__IO uint32_t*)(APPLICATION_ADDRESS+4);
// Set vector table offset
SCB->VTOR = APPLICATION_ADDRESS;
//Enable interrupts before jumping to application
__enable_irq();
//Set application stack pointer
__set_MSP(appStack);
appEntry(); //Errors appear when call this function

Thanks in advance.