-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to modify code in debug mode in riscv #960
Comments
The way to resume from debug mode is to use the resumereq mechanism in dmcontrol in the DM. Depending on whether the implementation has a memory-mapped DTM that allows firmware to access DM registers, this might or might not be possible. Debug mode is the mode you enter when you hand control to the external debugger. The external debugger can be something on the other side of some JTAG pins or it could theoretically be firmware running on a different CPU but that decision is implementation-specific. |
Just want to add that if you don't have an external debugger attached, it is not possible to enter the halted state. Without an external debugger, all you can do is have ebreak take a trap. Then your semihosting code would execute in the trap handler, and execution resumes simply be returning from that trap handler. |
yes using ebreak we can enter the debug mode but how to come out from debug Mode. |
The ways to enter debug mode are:
They all require an external debugger which is what @rtwfroody was talking about. (The double trap extension will add another way to enter debug mode but, like items 1 and 4, it will first require an external debugger to write a bit in dcsr.) |
I am looking for any documentation which can help in modifying debug mode behavior.
As a part of experiment I am trying to put hart in halted state by executing ebreak instruction. as I am trying to implement semihosting without using external debugger.
but I am not able to understand how can i resume the hart again using firmware only.
The text was updated successfully, but these errors were encountered: