09_hw_debug_JTAG: Why do we need the X1_JTAG_boot binary? #82
-
I'm not sure why do we need to have that special binary loaded on the Pi before we can start debugging it with JTAG? What I have noticed is that as long as we have the bootloader on the SD card, and the UART USB connected, the Pi will boot and the loader will be waiting for minipush to connect. NOTE: I use different adapters then you so I use my own OpenOCD config files, but I think it should not matter. If it does, I can share my files with you.
Once gdb is started:
The same method also works with gdb-remote launch configuration in vscode. We just skip the {
"name": "Debug JTAG",
"type": "gdb",
"request": "attach",
"cwd": "${workspaceFolder}",
"executable": "${workspaceRoot}/target/aarch64-unknown-none-softfloat/debug/kernel",
"target": ":3333",
"remote": true,
"valuesFormatting": "parseText",
"gdbpath": "gdb-multiarch",
"autorun": [
"source -v debug.gdb",
],
} You can disconnect and restart from vscode any time you want. You can set breakpoints etc... Maybe I'm missing something @andre-richter and as usual would appreciate your enlightening feedback. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
There is a bit of history and organic growth behind the current situation. Back when the tutorials were for RPi3 only, the X1 helper binary, in its GPIO driver, configured the JTAG pins. This was when I decided to introduce But you are right, the UART chainloader in waiting state is just good enough. |
Beta Was this translation helpful? Give feedback.
-
Cool. Makes it super clear. And now we have it documented 😁. Let me know if opening issues for such topics is the right channel to engage or if I should use a different method. |
Beta Was this translation helpful? Give feedback.
-
Fine for me! Setting up something separately just takes time for maintenance that I don't have 😅 I'll start labeling questions from now on, this makes them more discoverable. |
Beta Was this translation helpful? Give feedback.
There is a bit of history and organic growth behind the current situation.
Back when the tutorials were for RPi3 only, the X1 helper binary, in its GPIO driver, configured the JTAG pins.
Then the RPi4 came out, with basically no documentation at the time, and the GPIO JTAG setup code that was used for the Pi3 didn't work out of the box. I had an email exchange with somebody working on it as well, and he found out that you additionally need to write to some undocumented memory location to make it work on the Pi4. I haven't checked since if the official documentation has to say something about this now.
This was when I decided to introduce
enable_jtag_gpio=1
into theconfig.txt
, so the X1 b…