How to debug a tock application over JTAG? #3371
-
I am a newcomer to Tock and would like to know if there is documentation on how to debug apps. I saw this about debugging but is this only to debug the kernel? I have worked with dynamic loaders for ARM MCUs and from what I understand is that you need the DWARF debug section from the ELF file of the "app". My solution to debug Position independent code has been to use a custom python gdb script that gets metadata from the kernel and then checks if any app is related to the Elf file with debug symbols I want to load (automatically via python gdb). Afterwards I get the memory in Flash/RAM where my app is installed and use Im curious to know if this process similar for Tock and if there is any documentation on how to debug apps (with a debugger) ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
There are instructions in the board-specific README's for several boards some of which is pretty generally applicable: https://github.com/tock/tock/tree/master/boards/imix#debugging https://github.com/tock/tock/tree/master/boards/nordic/nrf52dk#debugging https://github.com/tock/tock/tree/master/boards/opentitan#qemu-gdb-debugging-earlgrey-cw310 None of those talk much about debugging apps specifically though, they all focus on kernel debugging. My experience has been that using add-symbol-file to add debug info has been sufficient for RISC-V apps, since they are fixed-position by default. The PIC approach you describe sounds like it should generally work fine for ARM apps |
Beta Was this translation helpful? Give feedback.
There are instructions in the board-specific README's for several boards some of which is pretty generally applicable:
https://github.com/tock/tock/tree/master/boards/imix#debugging
https://github.com/tock/tock/tree/master/boards/nordic/nrf52dk#debugging
https://github.com/tock/tock/tree/master/boards/opentitan#qemu-gdb-debugging-earlgrey-cw310
None of those talk much about debugging apps specifically though, they all focus on kernel debugging. My experience has been that using add-symbol-file to add debug info has been sufficient for RISC-V apps, since they are fixed-position by default. The PIC approach you describe sounds like it should generally work fine for ARM apps