CPU Reset during a Debug session

Hi All,

I am trying to reset the CPU in the middle of a debugging session. I am using Application Interrupt and Reset control register by setting the SysResetReq bit in the SCB block. (this preserves the current debugging session also).

However, as I am using ASM its a bit cumbersome.  This is the code snippet I am trying to use..

AIRCR   EQU 0xE000ED0C.

.

ldrr10, =0x05FA0000
LDRR8, =AIRCR ;
STRR8, [R10];

Any feedback/input help will always be appreciated.

Thanks!!

BR,

\ksnf3000

Parents Reply
  • jblack  @Ali:  I have found something interesting. I think the value 0x05FA0004 or 0x05FA0001 which we are trying to write is not written in 1 cycle but multiple cycles. So probably that's the reason the code goes back in a loop and starts again and does not reset everything to zero. So, to confirm this I added DSB 

    loop   ldr .....

    B loop

    On applying a break point at B loop I see that all registers have been reset to 0 and the debugger now points to the Start in the startup code effectively resetting the CPU. I think the DSB instruction makes sure that this writing fully takes place and then only is the CPU completely reset.

    Please correct my understanding if I am wrong here.

    BR,

    \Kashif

Children
More questions in this forum