I want to reset target in order to debug from main(). The following GDB command sequence works for me :
monitor reset run_and_halt
monitor soft_reset_halt
b main
c
Since it works, I am basically happy, but I would like to understand exactly what the two first commands (“reset run_and_halt” + “soft_reset_halt”) do. What is the difference between them, do I need both of them, and why ?
I am sure this must be documented somewhere, I just don’t know where.
Thank you very much, but I have a couple of follow up questions.
Are you saying that “run_and_halt” will halt the CPU after some specified amount of time/cycles ? If so, how do I set the “run_and_halt_time”, and could I set it to 0 ?
In a config file, I see something like :
target arm7tdmi little run_and_halt 0 armtdmi-s_r4
What does “run_and_halt 0” mean here ? Also, what does armtdmi-s_r4 do ?
Is there anywhere I could find important details like this without having to bother you guys with my questions ?
Are you saying that “run_and_halt” will halt the CPU after some specified amount of time/cycles? If so, how do I set the “run_and_halt_time”, and could I set it to 0 ?
Yes. The target is halted after the time specified by "run_and_halt_time ". In theory you could set that time to 0, but that value is just a minimum. The actual time that elapses between releasing the reset and programming the debug request is always going to be greater than this. Even if the JTAG operations to assert the debug request would start immediately after reset went high, there'd be a delay of >50 TCK cycles.
target arm7tdmi little run_and_halt 0 armtdmi-s_r4
This defines a target of type "arm7tdmi" that is little-endian, specifies the reset policy "run_and_halt", tells the OpenOCD that this target is the first device (0) in the JTAG scan chain, and that the arm7tdmi variant is "arm7tdmi-s_r4". The variant has currently no effect, but is there for future use.
Is there anywhere I could find important details like this without having to bother you guys with my questions?
Most configuration commands are documented in the OpenOCD Wiki: [http://openfacts.berlios.de/index-en.ph ... p_Debugger](http://openfacts.berlios.de/index-en.phtml?title=Open_On-Chip_Debugger)
If there’s something missing feel free to ask. It would be great if you could fill in missing parts after you’ve receieved an answer here.