Skip to content

target/riscv: active dm before get nextdm #1252

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

Open
wants to merge 2 commits into
base: riscv
Choose a base branch
from

Conversation

lz-bro
Copy link
Contributor

@lz-bro lz-bro commented May 6, 2025

when Debug Module is inactive, accesses to the nextdm may fail. Specifically, nextdm might not return correct data.

When I want to debug a target form a specific DM, the config is as flows:

set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x10000E21

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME -dbgbase 0x400

openocd can not get correct nextdm Due to DM with DMI base address = 0x0 is inactive.

@lz-bro lz-bro force-pushed the active-dm-before-get-nextdm branch from 959583d to 8391810 Compare May 6, 2025 06:31
@en-sc
Copy link
Collaborator

en-sc commented May 6, 2025

@lz-bro, please cherry-pick the commit from #1248 to fix the CI.

Ubuntu 20.04 is no longer available.
See actions/runner-images#11101

Checkpatch-ignore: BAD_SIGN_OFF
Change-Id: I0ec3e3342f9212a2a79d8dca6274e7db62ecedab
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
@lz-bro lz-bro force-pushed the active-dm-before-get-nextdm branch from 8391810 to 508ac6f Compare May 7, 2025 01:38
@lz-bro
Copy link
Contributor Author

lz-bro commented May 7, 2025

@lz-bro, please cherry-pick the commit from #1248 to fix the CI.

I have cherry-pick the commit to fix the CI, and could you please take a look?

en-sc
en-sc previously approved these changes May 7, 2025
Copy link
Collaborator

@en-sc en-sc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only minor suggestions

@lz-bro lz-bro force-pushed the active-dm-before-get-nextdm branch from 508ac6f to 3f14acc Compare May 7, 2025 11:14
en-sc
en-sc previously approved these changes May 12, 2025
@lz-bro lz-bro force-pushed the active-dm-before-get-nextdm branch from 3f14acc to 579c41b Compare May 16, 2025 08:18
@lz-bro
Copy link
Contributor Author

lz-bro commented May 16, 2025

@en-sc The return value of the check_dbgbase_exists function is bool type. If returning ERROR_TIMEOUT_REACHED is equivalent to returning true, this is incorrect, I have fixed it.

@lz-bro lz-bro requested a review from en-sc May 16, 2025 11:07
Copy link
Collaborator

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution. Overall it looks all right. I have some smaller comments.

@lz-bro lz-bro force-pushed the active-dm-before-get-nextdm branch 3 times, most recently from a18fb6b to be7cef1 Compare May 26, 2025 03:00
Copy link
Collaborator

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few last comments, otherwise it looks fine.

@lz-bro lz-bro force-pushed the active-dm-before-get-nextdm branch from be7cef1 to 9736c96 Compare May 28, 2025 01:44
JanMatCodasip
JanMatCodasip previously approved these changes Jun 6, 2025
Copy link
Collaborator

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

Copy link
Collaborator

@MarekVCodasip MarekVCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one request, please, take a look.

when Debug Module is inactive, accesses to the nextdm may fail.
Specifically, nextdm might not return correct data.
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

Successfully merging this pull request may close these issues.

4 participants