This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unable to read from SP register error when debugging from entry point

Hi,

I am encountering the following error when i establish a hardware connection to my target i.e LPC1519. It starts off with the Reset Handler properly,debugs the SySInit functions but when it reaches the Chip_SYSCTL_PowerDown function,it gets stuck on a particular instruction(LPC_SYSCTL->PDRUNCFG = (pdrun | PDRUNCFGUSEMASK);) and throws the following error.When i try to step the instruction the error repeats: 

Execution stopped in Privileged Thread mode at 0x00000332
0x00000332 109,2 LPC_SYSCTL->PDRUNCFG = (pdrun | PDRUNCFGUSEMASK);
wait
step
ERROR(CMD440-TAD13-NAL22):
! Stepping failed
! Unable to delete breakpoint: Breakpoint [instructionSet=T32, hardwareExecutionAddress=0x00000336, execContext=[ExecutionContext[Cortex-M3_1]]]
! General error on memory or register access.
Target Message: Could not determine target state
wait
ERROR(TAD1-NAL52):
! Unable to read from register SP
! Cannot attain state requested.
wait
ERROR(TAD1-NAL52):
! Unable to read from register SP
! Cannot attain state requested.

However when i go to register view the SP and SP_MAIN have specific values, because of this i am not able to debug my main function at all.

*SideNote: When I disconnect and try reconnecting to my target after the error has occurred,debug connection to target fails and the following error is thrown:

Debug Sequence failed 

Failed to read DP

Failed to read register 8,320 ARMCS-DP_DSQ

General error on memory or register access.

I have to power down and  power up my device to bypass this error,happens whenever the above SP error occurs.

Thank you.

Parents
  • Hi Ronan,

    Thank you for your your prompt reply.This is a project imported from keil, and on keil this was working properly.It's a test project i.e to  a blink a LED and it ran with no errors.The above command is part of the startupfiles of LPC1519.This seems to be problem in how ARM DS(2018 silver edition)  is configured,since  the problem is not  occurring on keil.Ive followed the steps mentioned in the debugger manual but however i'm running into this problem.Same thing is happening with the imported keil examples available with the downloaded packs.

    Hope you can help me out.

    Thank you

Reply
  • Hi Ronan,

    Thank you for your your prompt reply.This is a project imported from keil, and on keil this was working properly.It's a test project i.e to  a blink a LED and it ran with no errors.The above command is part of the startupfiles of LPC1519.This seems to be problem in how ARM DS(2018 silver edition)  is configured,since  the problem is not  occurring on keil.Ive followed the steps mentioned in the debugger manual but however i'm running into this problem.Same thing is happening with the imported keil examples available with the downloaded packs.

    Hope you can help me out.

    Thank you

Children