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.
Hello @Pavankumar1,
Sorry for taking a while to get back to you. In order to support you better, can you provide me more information about your application?
-Are you running in XIP mode?
-can you provide more context about your application and in which cases uses NVIC_SystemReset()?
-what is the memory that is used in your application?
Also, I understand that you are currently using a secondary bootloader, if this is the case the SDK (version 2.16) provides an example of this called "mcuboot_opensource". I highly recommend look into in this example in order to know how it works.
BR
Habib.
Hello again @Pavankumar1,
When performing a software reset, the FLASH must also be reset, this is because when the primary bootloader runs it will initialize the communication in single line 1-1-1 mode to get the FCB (FlexSPI Configuration Block) first. However, the flash was previously initialized and is not communicating over single line and is throwing an error. in order to try and pinpoint if that is the problem, can you reset the FLASH before a NVIC_SystemReset()?
Also, in this app note shows how "Implement Second Bootloader on i.MX RT10xx Series", although this app note uses RT10xx series, is the same concept for the RT1176
BR
Habib