I try to understand what's the function to be called from the 1st application in order to correctly start the 2nd application.
As I understand, in order to initialize interrupt vector, it is not main() that should be called, butResetISR() instead, because ResetISR() seems to be the function that allocates ISR and initialize it:
void ResetISR(void) {
// Disable interrupts
__asm volatile ("cpsid i");
#if defined (__USE_CMSIS)
SystemInit();
#else
....
#endif // (__USE_CMSIS)
// Call the Redlib library, which in turn calls main()
__main();
#else
main();
#endif
//
// main() shouldn't return, but if it does, we'll just enter an infinite loop
//
while (1) {
;
}
}
void SystemInit (void) {
...
#if defined(__MCUXPRESSO)
extern uint32_t g_pfnVectors[]; // Vector table defined in startup code
SCB->VTOR = (uint32_t)g_pfnVectors;
#endif
....
}
__attribute__ ((used, section(".isr_vector")))
void (* const g_pfnVectors[])(void) = {
&_vStackTop, // The initial stack pointer
ResetISR, // The reset handler
NMI_Handler, // The NMI handler
HardFault_Handler, // The hard fault handler
..
}