LPC1125 run code exception

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

LPC1125 run code exception

374 Views
Guo2024
Contributor I

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.
      

0 Kudos
Reply
3 Replies

315 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Guo2024 

I recommend you low PIO0_1 pin when reset the chip. Then it run into ISP mode. Erase all flash, it can recovered to normal.

 

BR

Alice

0 Kudos
Reply

310 Views
Guo2024
Contributor I

Hi,Alice,

    Thanks for your response.

    Also I know what you said.

    But it is not easy to do it since the device has been mounted on the PCB and there is no test point for  PIO0_1 pin.

    Would you help me find the solution only using the SWD interface?

   Thanks.

 

  

0 Kudos
Reply

235 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Guo2024 

Do you mean the chip can't be connect with SWD now? Do you have j-link debugger? Or LPC-link with J-LINK probe. If yes, try to use J-link commander to connect.

 

BR

Alice

0 Kudos
Reply