How to Enter secondary bootloader from Application in RT1024_EVK

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Enter secondary bootloader from Application in RT1024_EVK

Jump to solution
487 Views
ping1
Contributor IV

Hello, All

I am developing secondary bootloader, it uses flash address starts at 0x60000000, and size is 0x40000. Application starts at 0x60040000, size is 0x3C0000. I programmed both secondary bootloader and application into the flash regions as above.

After power up, it runs into secondary bootloader first and then Jump to application successfully, but it doesn't enter bootloader from application by soft reset - SRC_DoSoftwareResetARMCore0(SRC), where I intend to upgrade my application.  The function seems working when I test it with single program - it does back to the beginning of code, but it hangs somewhere when I try to call this from application. The onboard POR button can enter bootloader, and also the Debugger Reset enter bootloader. I wonder what I do wrong, what is the correct way to enter bootloader from application?

Urgent help is needed, tried to read a few posts, haven't found information about this.

BTW,  the secondary bootloader is compiled with image header - IVT, but my application doesn't include that, I use auto generated link scripts for both - only modified memory. I don't understand why the application doesn't include IVT, it is not needed anyway.

Ping

 

Labels (1)
0 Kudos
1 Solution
444 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ping1,

  That's very good to hear you already make it works.

  NVIC_SystemReset is the system reset, please check the detail API code:

__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
{
__DSB(); /* Ensure all outstanding memory accesses included
buffered write are completed before reset */
SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
(SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */
__DSB(); /* Ensure completion of memory access */

for(;;) /* wait until reset */
{
__NOP();
}
}

You can find, it will control the ARM CORE Application Interrupt and Reset Control Register 

image.png

NVIC_SystemReset will reset the system.

About your used reset, you also can check the detail API code, which detail code it is controlling.

Best Regards,

kerry

View solution in original post

3 Replies
476 Views
ping1
Contributor IV

Thanks, Kerry, 

This works! Not sure the difference between these two Resets. What is the difference between them?

I also did it by jump to secondary bootloader start address - which is fixed at 0x60002000, as it has IVT. Not sure this is proper way.

Regards!

Ping

0 Kudos
445 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ping1,

  That's very good to hear you already make it works.

  NVIC_SystemReset is the system reset, please check the detail API code:

__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
{
__DSB(); /* Ensure all outstanding memory accesses included
buffered write are completed before reset */
SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
(SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */
__DSB(); /* Ensure completion of memory access */

for(;;) /* wait until reset */
{
__NOP();
}
}

You can find, it will control the ARM CORE Application Interrupt and Reset Control Register 

image.png

NVIC_SystemReset will reset the system.

About your used reset, you also can check the detail API code, which detail code it is controlling.

Best Regards,

kerry

480 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ping1,

    Please try the system reset:

NVIC_SystemReset();

  Whether that can jump back to your bootloader or not?

  Any updated information, please kindly let me know.

Best Regards,

Kerry

 

0 Kudos