sorry for response after a long time,
as per above steps you mentioned
Yes, when you do single step, you should write DHSCR = 0xA05F0001UL | 0x4 ; // C_STEP Then wait until S_RETIRE_ST is 1. And then set DHSCR = 0xA05F0001UL; // unhalt Hope this helps. Joseph
Yes, when you do single step, you should write
DHSCR = 0xA05F0001UL | 0x4 ; // C_STEP
Then wait until S_RETIRE_ST is 1.
And then set
DHSCR = 0xA05F0001UL; // unhalt
Hope this helps.
Joseph
i performed
when core halt after break point hit
i tried single step the target as below
Target_write(DHCSR, 0xA05F0101);
while(!(target_read(DHCSR) & S_RETIRE_ST));
but the target is always present inside while loop!!!
i tested the above logic before i put the break point and i successfully executed the Single Step
but after breakpoint hitting if i trying to step, it will not come out from while loop.
Should i have to perform any thing before i single step??? i.e., Should i have to wrtie any thing in DFSR????
Thanks and Regards,
Harshan
Hi Harshan,
The size of instruction is not always 4. So setting breakpoint to PC+4 doesn’t always work.
And if the instruction you want to step is a branch, then it won’t go to PC +2 or PC +4 anyway.
Regards,
thanks for reply,
you are exactly correct it wont responding except %4 == 0,
you mean this will avoided by single step the processor???
Harshan.
I've been following your progress closely with great interest.
Though I can not tell you how to make it work, one thing I can do is to confirm that the best thing you can do, is to make the processor handle the single stepping.
The CPU's hardware should be able to do this for you.
I know that OpenOCD supports single-stepping, since I've used it many times, so you might benefit from finding single-stepping in OpenOCD's source code.
I'm quite sure you're very close to the correct solution; this looks like it's the last thing blocking you from having it working.