Debugging Microcontrollers

Niklas Hauser

Playlists: 'camp2023' videos starting here / audio

Debugging and Profiling ARM Cortex-M microcontrollers with GDB and Python.

This talk gives you an overview of debugging ARM Cortex-M microcontrollers with a focus on the *practical* configuration and usage of the relevant tools.
In particular, I will present:

- Debug interfaces ([SWD]( and the associated debug probes ([J-Link](, [STLink]( and libraries ([JLinkGDBServer](, [OpenOCD](
- How to install and configure [arm-none-eabi-gdb(-py3)]( for debugging your ELF.
- Commonly used [GDB commands and scripts](
- Advanced [GDB scripting via its Python API](
- Inspecting [peripheral state]( with [CMSIS-SVD files]( and custom visualizations.
- Dynamic call stack tracing and graphing.
- Coredumping for post-mortem debugging via [CrashDebug](
- [Remote GDB scripting]( via the [Machine Interface](
- [ITM profiling]( over SWO pin using [Orbuculum](
- Thread/IRQ/Workqueue scheduling visualization and latency analysis using [perfetto](
- High-bandwidth [ETM tracing]( over TRACE pins: [J-Trace]( and [ORBtrace mini](
- Interesting related projects and possible future work.

This talk is meant to introduce you to what is possible with embedded debug tools in practice, rather than to give you a comprehensive lecture.