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

Enable access memory via a examined target before examed all smp targets #1211

Closed
lz-bro opened this issue Jan 23, 2025 · 4 comments
Closed

Comments

@lz-bro
Copy link
Contributor

lz-bro commented Jan 23, 2025

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME -coreid 0 -rtos hwthread
target create $_TARGETNAME.1 riscv -chain-position $_TARGETNAME -coreid 1
target smp $_TARGETNAME.0 $_TARGETNAME.1

$_TARGETNAME.0 configure -event examine-end {
    halt
    // access memory
}

I would like to make the following modifications to support,or better method?

--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -2534,8 +2534,21 @@ int riscv_halt(struct target *target)

        LOG_TARGET_DEBUG(target, "halting all harts");

-       int result = ERROR_OK;
+       bool smp_targets_examined = false;
        if (target->smp) {
+               smp_targets_examined = true;
+               struct target_list *tlist;
+               foreach_smp_target(tlist, target->smp_targets) {
+                       struct target *t = tlist->target;
+                       if (!target_was_examined(t)) {
+                               smp_targets_examined = false;
+                               break;
+                       }
+               }
+       }
+
+       int result = ERROR_OK;
+       if (smp_targets_examined) {
                struct target_list *tlist;
                foreach_smp_target(tlist, target->smp_targets) {
                        struct target *t = tlist->target;

@aap-sc
Copy link
Collaborator

aap-sc commented Jan 23, 2025

you can just temporary disable smp groups (you have this smp on/off command , or you could create an smp group later).

@lz-bro
Copy link
Contributor Author

lz-bro commented Feb 5, 2025

you can just temporary disable smp groups (you have this smp on/off command , or you could create an smp group later).

The smp command should be before init, and how could I create an smp group later.

@aap-sc
Copy link
Collaborator

aap-sc commented Feb 5, 2025

you can just temporary disable smp groups (you have this smp on/off command , or you could create an smp group later).

The smp command should be before init, and how could I create an smp group later.

that's not true.

See the documentation here:

Image

you can also take a look at discussion in this MR for additional information: #872

@lz-bro
Copy link
Contributor Author

lz-bro commented Feb 5, 2025

you can just temporary disable smp groups (you have this smp on/off command , or you could create an smp group later).

The smp command should be before init, and how could I create an smp group later.

that's not true.

See the documentation here:

Image

you can also take a look at discussion in this MR for additional information: #872

Thanks, it's helpful.

@lz-bro lz-bro closed this as completed Feb 5, 2025
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

2 participants