Hi,Sir&Miss,
Good day.
LPC1125's embed flash bas been programmed with all zeros during production accidently.
Then I find the flash loader can not call the IAP commands again through the SWD interface.(flash loader is not from NXP,which is developmented by user-self refer to the ARM SWD debug protocol).
So I do another test to debug the LPC1125 to find the root cause by running some simple code.
First,I load the below Test1 code into LPC1125' embed ram,then I run the LPC1125 core by ARM debug port(SWD).The run entry address is the location of __asm("MOV R0,#0xAA"),and the bit0 should be 1.
I find that the LPC1125 core generates an exception when it executes the code __asm("MOV R0,#0xAA").So the code __asm("bkpt") can not be executed ok and the core can not be halted again.
/*Test1 code start*/
__asm("MOV R0,#0xAA");
__asm("bkpt");
/*Test1 code end*/
Second,I load the below Test2 code into LPC1125' embed ram,then I run the LPC1125 core by ARM debug port(SWD).The run entry address is the location of __asm("bkpt"),and the bit0 should be 1.
I find that the LPC1125 core can execute __asm("bkpt") ok and the core can be halted again.
/*Test2 code start*/
__asm("bkpt");
/*Test2code end*/
It looks that LPC1125 can not run the code __asm("MOV R0,#0xAA") ok since it will trigger an exception.
What should I do to recover the health(normal) running environment to execute the code __asm("MOV R0,#0xAA") ok?
Is there any way to write some registers to recover the device through SWD interface?
Show the detail command sequence on SWD interface will be best.
Thanks.