NVIC_SystemReset() is not working with MiMxRT1020

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NVIC_SystemReset() is not working with MiMxRT1020

2,558 Views
meeras
Contributor I

I am using MiMxRT1020 development kit.. I want to update firmware via TCP with bootloader. As soon as I receive my new firmware I want to reset application and I want to jump to the bootloader mode. But NVIC_SystemReset() is not working. So I can not update my firmware. Here is sample of my code.

if(ack_offset == 0xffff) {

/* received complete firmware */

osDelay(2000);

__disable_irq();

/* reset application */
NVIC_SystemReset();

}

0 Kudos
Reply
2 Replies

204 Views
davenadler
Senior Contributor II

@Sabina_Bruce that is not a proper test!
If you look at the NVIC_Reset inline function, you will see that the attempt at reset is followed by an infinite loop: 

for(;;) {}

So you have not proved the reset works. You need to test an application that has actual reset capability and without debug pod attached.

@meeras - Have you resolved this issue?
I'm also seeing an apparent reset failure on RT1024.
Also FYI see this similar issue and patch for M55 etc. ARM cores:
https://github.com/ARM-software/CMSIS_6/issues/195 

I'm going to try applying ARM's CMSIS patch.
Interested to hear what you've found!
Thanks,
Best Regards, Dave

 

0 Kudos
Reply

2,478 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello ,

Hope you are doing well.

I have tested this one my end without any issue. 

I used the simple hello world example. Placed the NVIC_SystemReset after it prints hello world. 

pastedImage_1.png

It will not reach the next printf as it resets the application.

I am using the latest IDE and SDK version.

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1045961%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENVIC_SystemReset()%20is%20not%20working%20with%20MiMxRT1020%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1045961%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20MiMxRT1020%20development%20kit..%20I%20want%20to%20update%20firmware%20via%20TCP%20with%20bootloader.%20As%20soon%20as%20I%20receive%20my%20new%20firmware%20I%20want%20to%20reset%20application%20and%20I%20want%20to%20jump%20to%20the%20bootloader%20mode.%20But%20NVIC_SystemReset()%20is%20not%20working.%20So%20I%20can%20not%20update%20my%20firmware.%20Here%20is%20sample%20of%20my%20code.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Eif(ack_offset%20%3D%3D%200xffff)%20%7B%3C%2FP%3E%3CP%3E%2F*%20received%20complete%20firmware%20*%2F%3C%2FP%3E%3CP%3EosDelay(2000)%3B%3C%2FP%3E%3CP%3E__disable_irq()%3B%3C%2FP%3E%3CP%3E%2F*%20reset%20application%20*%2F%3CBR%20%2F%3ENVIC_SystemReset()%3B%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2353394%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20NVIC_SystemReset()%20is%20not%20working%20with%20MiMxRT1020%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2353394%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F117617%22%20target%3D%22_blank%22%3E%40Sabina_Bruce%3C%2FA%3E%26nbsp%3Bthat%20is%20not%20a%20proper%20test!%3CBR%20%2F%3EIf%20you%20look%20at%20the%20NVIC_Reset%20inline%20function%2C%20you%20will%20see%20that%20the%20attempt%20at%20reset%20is%20followed%20by%20an%20infinite%20loop%3A%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Efor(%3B%3B)%20%7B%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3ESo%20you%20have%20not%20proved%20the%20reset%20works.%20You%20need%20to%20test%20an%20application%20that%20has%20actual%20reset%20capability%20and%20without%20debug%20pod%20attached.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F97308%22%20target%3D%22_blank%22%3E%40meeras%3C%2FA%3E%26nbsp%3B-%20Have%20you%20resolved%20this%20issue%3F%3CBR%20%2F%3EI'm%20also%20seeing%20an%20apparent%20reset%20failure%20on%20RT1024.%3CBR%20%2F%3EAlso%20FYI%20see%20this%20similar%20issue%20and%20patch%20for%20M55%20etc.%20ARM%20cores%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FARM-software%2FCMSIS_6%2Fissues%2F195%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FARM-software%2FCMSIS_6%2Fissues%2F195%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20going%20to%20try%20applying%20ARM's%20CMSIS%20patch.%3CBR%20%2F%3EInterested%20to%20hear%20what%20you've%20found!%3CBR%20%2F%3EThanks%2C%3CBR%20%2F%3EBest%20Regards%2C%20Dave%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1045962%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20NVIC_SystemReset()%20is%20not%20working%20with%20MiMxRT1020%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1045962%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20%2C%3C%2FP%3E%3CP%3EHope%20you%20are%20doing%20well.%3C%2FP%3E%3CP%3EI%20have%20tested%20this%20one%20my%20end%20without%20any%20issue.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20used%20the%20simple%20hello%20world%20example.%20Placed%20the%20NVIC_SystemReset%20after%20it%20prints%20hello%20world.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_1.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_1.png%22%20style%3D%22width%3A%20418px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F3120i1BEDA127A721A13D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_1.png%22%20alt%3D%22pastedImage_1.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIt%20will%20not%20reach%20the%20next%20printf%20as%20it%20resets%20the%20application.%3C%2FP%3E%3CP%3EI%20am%20using%20the%20latest%20IDE%20and%20SDK%20version.%3C%2FP%3E%3CP%3EBest%20Regards%2C%3C%2FP%3E%3CP%3ESabina%3C%2FP%3E%3CP%3E-----------------------------------------------------------------------------------------------------------------------%3C%2FP%3E%3CP%3ENote%3A%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20Correct%20Answer%20button.%20Thank%20you!%3C%2FP%3E%3CP%3E-----------------------------------------------------------------------------------------------------------------------%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E