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

Single-core running “target_run_algorithm” in SMP architecture forcibly interrupted by ”riscv_openocd_poll“ #1191

Open
Alan-19950616 opened this issue Dec 25, 2024 · 12 comments

Comments

@Alan-19950616
Copy link

The run algorithm code segment.
https://github.com/riscv-collab/riscv-openocd/blob/riscv/src/target/riscv/riscv.c#L3482-L3521

The problematic code segment.
https://github.com/riscv-collab/riscv-openocd/blob/riscv/src/target/riscv/riscv.c#L3926-L3929

@Alan-19950616
Copy link
Author

This PR brought in
#767

@aap-sc
Copy link
Collaborator

aap-sc commented Dec 25, 2024

@Alan-19950616 do you have a test to illustrate the issue?

@Alan-19950616
Copy link
Author

Of course, I can provide you with the logs.
openocd.log

@aap-sc
Copy link
Collaborator

aap-sc commented Dec 25, 2024

@Alan-19950616 logs of OpenOCD are not exactly the reproduction. Could you please provide the full reproduction? Configuration files used, commands passed to gdb, etc.

@Alan-19950616
Copy link
Author

Here is the configuration file, GDB only uses the load command.
openocd_ns_cluster0_core0.cfg.txt

@TommyMurphyTM1234
Copy link
Collaborator

Here is the configuration file, GDB only uses the load command

It can't be the only GDB command used as it surely has to at least use some commands to connect to the target in the first place? I think what @aap-sc is asking for is complete instructions and artifacts required for a reproducible test case. E.g.

  • OpenOCD script (provided above)
  • the command line used to run OpenOCD
  • the command line used to run GDB
  • the set of commands fed to GDB
  • the verbose openocd -d3 log for the test case (provided above?)
  • maybe details of your target RISC-V implementation?

@en-sc
Copy link
Collaborator

en-sc commented Dec 25, 2024

@Alan-19950616, AFAIK this should fix the issue you are having:
tom-van/openocd-rp2350-riscv@87bf74e

Please, try it out.

@tom-van, @Wren6991, please consider creating a PR to https://github.com/riscv-collab/riscv-openocd.

Alternatively, I can cherry-pick your commit and create a PR myself but it doesn't feel right :)

@tom-van
Copy link
Contributor

tom-van commented Dec 25, 2024

@en-sc thanks for interconnecting the topic!

@tom-van, @Wren6991, please consider creating a PR

I'm not the author.
@Wren6991 promised to do so some time ago ;-)

@Alan-19950616
Copy link
Author

@en-sc Thanks, it does solve my problem. but verify failed.

Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'gdb port', not 'gdb_port'
warning: multi-threaded target stopped without sending a thread-id, using first non-exited thread
__amp_wait () at ../../../SoC/ns_cluster0_core0/Common/Source/GCC/startup_ns_cluster0_core0.S:335
335         j 1b
(gdb) monitor flash write_image erase unlock D:\\openocd_test\\flash.bin 0x20000000 bin
auto erase enabled
auto unlock enabled
wrote 7077888 bytes from file D:\openocd_test\flash.bin in 160.736511s (43.002 KiB/s)
(gdb) monitor flash verify_image D:\\openocd_test\\flash.bin 0x20000000 bin
verify failed in bank at 0x20000000 starting at 0x00000000
Protocol error with Rcmd
(gdb)

I read the flash to a file via the “flash read_bank” command and then compared it to the original data passed.

@en-sc
Copy link
Collaborator

en-sc commented Dec 26, 2024

@Alan-19950616,

  1. Please, provide more information about your scenario (flash driver you are using, etc.).
  2. Let's track this in a separate issue.

@Alan-19950616
Copy link
Author

Ok, I'll close the current issues and create another issue to upload the information.

@en-sc
Copy link
Collaborator

en-sc commented Dec 27, 2024

I'd like to leave this issue open until the fix is merged.

@en-sc en-sc reopened this Dec 27, 2024
@en-sc en-sc assigned en-sc and unassigned en-sc Dec 27, 2024
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

5 participants