Skip to content
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

Does the base address of the 1st DM have to be at the bottom address space (0x000000)? #1093

Closed
zhangdujiao opened this issue Dec 10, 2024 · 2 comments

Comments

@zhangdujiao
Copy link

From debug spec 3.1 "The bottom of the address space is used for the first (and usually only) DM"
We notice that OpenOCD can configure the DM address to be accessed via the -dbgbase command with any address in the cfg file, so it seems that there is no need to be at the very bottom of the address space. Is that ture?

@en-sc
Copy link
Contributor

en-sc commented Dec 10, 2024

-dbgbase is used as a quick-and-dirty solution.
The user does not need to know the exact address of the DM, the spec allows to discover this (based on the fact that the first DM is at the bottom and the address of the next one is in the nextdm register).

For additional info on OpenOCD's side of things see:
riscv-collab/riscv-openocd#1147
riscv-collab/riscv-openocd#278

@pdonahue-ventana
Copy link
Collaborator

The answer to the question in the title is yes for the reason that you already quoted from the spec. OpenOCD isn't the only debugger.

Even if you only want to use OpenOCD, you can only use -dbgbase if you already know something about what you're debugging. One goal of a standardized debug architecture is that you can just connect a debugger to a chip and the debugger will be able to figure out the configuration without any hand-holding from the (possibly inexperienced) user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants