-
Notifications
You must be signed in to change notification settings - Fork 19
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
OpenOCD "load_image" also sets the chip running? #373
Comments
Thanks for sharing this. Halting and exiting is not supported in the current debug setup on Sonata. It is essentially a fancy way of writing to the bus. The way that we "halt" the core is by resetting it any time the debug module writes to the bus. The main reason we designed it this way is that we didn't have a CHERIoT-enabled debug ROM available when we were doing bring-up. |
Just for reference to anyone else stumbling on this issue, the openOCD flow on Sonata is very much an advanced feature and not the main way we designed Sonata to be used. Most people should just use the UF2 method to load new programs on the board. As far as I understand nwf is wanting to use openOCD to avoid writing too many times to flash. |
AFAICT this is due to sonata-system/rtl/system/sonata_system.sv Lines 264 to 277 in e7088a6
|
Yes, exactly. The core is held in reset for a while after the debugger has written to the bus. The only way openOCD and/or the debug module can keep the core in reset is by keep on writing stuff to the bus. This allows you to do a load_image and after that whole image is written to SRAM, the core comes out of reset and executes the thing you've just written. This is a developer feature for advanced users only. |
Not really understanding what's going on here, but... the most visible problem is that
util/mem_helper.sh
often fails the verification it tries to do and the chip is clearly running while that's happening. I'm a little surprised not to see areset run
command being given to OpenOCD.Trying to minimize things a bit, I've observed the following:
exit
does not implyreset run
.load_image
does implyreset run
, though I don't think it's supposed to.load_image
. Perhaps some part of the system believes it to be already halted and so does nothing, or perhaps the target is claiming to be halted when it is not.The upshot of this is that if I remove the
verify_image
commands fromutil/mem_helper.sh
, I get much better success rate loading in programs, but this is... disconcerting. Please advise and please let me know what more I can do or test to be useful.The text was updated successfully, but these errors were encountered: