{"guid":"4a4f8363-865f-52b7-b236-3b9b73aa2ad7","title":"Debugging Microcontrollers","subtitle":null,"slug":"camp2023-57321-debugging_microcontrollers","link":"https://pretalx.c3voc.de/camp2023/talk/BQF8TR/","description":"Debugging and Profiling ARM Cortex-M microcontrollers with GDB and Python.\n\nThis talk gives you an overview of debugging ARM Cortex-M microcontrollers with a focus on the *practical* configuration and usage of the relevant tools.\nIn particular, I will present:\n\n- Debug interfaces ([SWD](https://developer.arm.com/documentation/ihi0031/a/The-Serial-Wire-Debug-Port--SW-DP-)) and the associated debug probes ([J-Link](https://www.segger.com/products/debug-probes/j-link/), [STLink](https://www.st.com/en/development-tools/stlink-v3minie.html)) and libraries ([JLinkGDBServer](https://wiki.segger.com/J-Link_GDB_Server), [OpenOCD](https://openocd.org)).\n- How to install and configure [arm-none-eabi-gdb(-py3)](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) for debugging your ELF.\n- Commonly used [GDB commands and scripts](https://sourceware.org/gdb/onlinedocs/gdb/index.html).\n- Advanced [GDB scripting via its Python API](https://sourceware.org/gdb/onlinedocs/gdb/Python.html).\n- Inspecting [peripheral state](https://github.com/pengi/arm_gdb) with [CMSIS-SVD files](https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html) and custom visualizations.\n- Dynamic call stack tracing and graphing.\n- Coredumping for post-mortem debugging via [CrashDebug](https://github.com/adamgreen/CrashDebug).\n- [Remote GDB scripting](https://github.com/cs01/pygdbmi) via the [Machine Interface](https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html).\n- [ITM profiling](https://developer.arm.com/documentation/ddi0403/d/Appendices/Debug-ITM-and-DWT-Packet-Protocol?lang=en) over SWO pin using [Orbuculum](https://orbcode.org/orbuculum/).\n- Thread/IRQ/Workqueue scheduling visualization and latency analysis using [perfetto](https://perfetto.dev).\n- High-bandwidth [ETM tracing](https://developer.arm.com/documentation/ihi0014/) over TRACE pins: [J-Trace](https://www.segger.com/products/debug-probes/j-trace/) and [ORBtrace mini](https://orbcode.org/orbtrace-mini/).\n- Interesting related projects and possible future work.\n\nThis talk is meant to introduce you to what is possible with embedded debug tools in practice, rather than to give you a comprehensive lecture.","original_language":"eng","persons":["Niklas Hauser"],"tags":["camp2023","57321","2023","Milliways",""],"view_count":831,"promoted":false,"date":"2023-08-18T21:00:00.000+02:00","release_date":"2023-08-19T00:00:00.000+02:00","updated_at":"2026-04-18T15:00:04.384+02:00","length":2345,"duration":2345,"thumb_url":"https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7.jpg","poster_url":"https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7_preview.jpg","timeline_url":"https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7.timeline.jpg","thumbnails_url":"https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7.thumbnails.vtt","frontend_link":"https://media.ccc.de/v/camp2023-57321-debugging_microcontrollers","url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_title":"Chaos Communication Camp 2023","conference_url":"https://api.media.ccc.de/public/conferences/camp2023","related":[],"recordings":[{"size":null,"length":null,"mime_type":"application/x-subrip","language":"eng","filename":"DRAFT_camp2023-57321-eng-Debugging_Microcontrollers.en_DRAFT.srt","state":"todo","folder":"","high_quality":true,"width":null,"height":null,"updated_at":"2024-02-10T22:45:37.969+01:00","recording_url":"https://cdn.media.ccc.de/events/camp2023/DRAFT_camp2023-57321-eng-Debugging_Microcontrollers.en_DRAFT.srt","url":"https://api.media.ccc.de/public/recordings/74714","event_url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_url":"https://api.media.ccc.de/public/conferences/camp2023"},{"size":413,"length":2345,"mime_type":"video/webm","language":"eng","filename":"camp2023-57321-eng-Debugging_Microcontrollers_webm-hd.webm","state":"new","folder":"webm-hd","high_quality":true,"width":1920,"height":1080,"updated_at":"2023-08-28T23:21:37.563+02:00","recording_url":"https://cdn.media.ccc.de/events/camp2023/webm-hd/camp2023-57321-eng-Debugging_Microcontrollers_webm-hd.webm","url":"https://api.media.ccc.de/public/recordings/69468","event_url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_url":"https://api.media.ccc.de/public/conferences/camp2023"},{"size":136,"length":2345,"mime_type":"video/webm","language":"eng","filename":"camp2023-57321-eng-Debugging_Microcontrollers_webm-sd.webm","state":"new","folder":"webm-sd","high_quality":false,"width":720,"height":576,"updated_at":"2023-08-28T14:35:24.008+02:00","recording_url":"https://cdn.media.ccc.de/events/camp2023/webm-sd/camp2023-57321-eng-Debugging_Microcontrollers_webm-sd.webm","url":"https://api.media.ccc.de/public/recordings/69432","event_url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_url":"https://api.media.ccc.de/public/conferences/camp2023"},{"size":100,"length":2345,"mime_type":"video/mp4","language":"eng","filename":"camp2023-57321-eng-Debugging_Microcontrollers_sd.mp4","state":"new","folder":"h264-sd","high_quality":false,"width":720,"height":576,"updated_at":"2023-08-19T23:08:20.833+02:00","recording_url":"https://cdn.media.ccc.de/events/camp2023/h264-sd/camp2023-57321-eng-Debugging_Microcontrollers_sd.mp4","url":"https://api.media.ccc.de/public/recordings/69416","event_url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_url":"https://api.media.ccc.de/public/conferences/camp2023"},{"size":35,"length":2345,"mime_type":"audio/mpeg","language":"eng","filename":"camp2023-57321-eng-Debugging_Microcontrollers_mp3.mp3","state":"new","folder":"mp3","high_quality":false,"width":0,"height":0,"updated_at":"2023-08-19T23:07:02.975+02:00","recording_url":"https://cdn.media.ccc.de/events/camp2023/mp3/camp2023-57321-eng-Debugging_Microcontrollers_mp3.mp3","url":"https://api.media.ccc.de/public/recordings/69412","event_url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_url":"https://api.media.ccc.de/public/conferences/camp2023"},{"size":21,"length":2345,"mime_type":"audio/opus","language":"eng","filename":"camp2023-57321-eng-Debugging_Microcontrollers_opus.opus","state":"new","folder":"opus","high_quality":false,"width":0,"height":0,"updated_at":"2023-08-19T23:06:42.312+02:00","recording_url":"https://cdn.media.ccc.de/events/camp2023/opus/camp2023-57321-eng-Debugging_Microcontrollers_opus.opus","url":"https://api.media.ccc.de/public/recordings/69411","event_url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_url":"https://api.media.ccc.de/public/conferences/camp2023"},{"size":381,"length":2345,"mime_type":"video/mp4","language":"eng","filename":"camp2023-57321-eng-Debugging_Microcontrollers_hd.mp4","state":"new","folder":"h264-hd","high_quality":true,"width":1920,"height":1080,"updated_at":"2023-08-19T22:59:51.294+02:00","recording_url":"https://cdn.media.ccc.de/events/camp2023/h264-hd/camp2023-57321-eng-Debugging_Microcontrollers_hd.mp4","url":"https://api.media.ccc.de/public/recordings/69404","event_url":"https://api.media.ccc.de/public/events/4a4f8363-865f-52b7-b236-3b9b73aa2ad7","conference_url":"https://api.media.ccc.de/public/conferences/camp2023"}]}