Hello,
I'm using an RT1176 controller with a custom bootloader. My application code is configured to boot from the memory address 0x30025000. Occasionally, after calling NVIC_SystemReset() for a software reset, the application fails to jump correctly to the application start address (0x30025000). This sinerio ocuurs once in 10 times.
In my bootloader code, I'm performing the following steps to jump to the application:
// Disable both D and I caches, Application will enable them back.
SCB_DisableDCache();
SCB_DisableICache();
__DMB();
DisableGlobalIRQ();
// Relocate vector table to application base address.
SCB->VTOR = (__IOM uint32_t)APP1_BASE_ADDRESS;
// Define Application function.
uint32_t jumpAddress = *(uint32_t*)(APP1_BASE_ADDRESS + 4U );
F_Bootloader_Jump_t jump = (F_Bootloader_Jump_t)jumpAddress;
// Set stack pointers to the Application stack pointer. __set_MSP((uint32_t*)APP1_BASE_ADDRESS);
__set_PSP(*(uint32_t*)APP1_BASE_ADDRESS);
// Jump to Application.
jump();
Where APP1_BASE_ADDRESS is defined as (0x30000000 + (0x1000 * 37)).
Could you please advise if there's any mistake in my jump sequence that could cause this intermittent issue? What steps can I take to ensure reliable application booting after a software reset?
Thank you.