Add Niklas Debugging Video to GDB and hard fault sections (#24845)

This commit is contained in:
Hamish Willee
2025-05-14 17:52:59 +10:00
committed by GitHub
parent 79660d0a39
commit 3af9a3f76e
2 changed files with 32 additions and 1 deletions
+24
View File
@@ -54,6 +54,30 @@ The following topics explain how to start on-target debugging:
- [MCU Eclipse/J-Link Debugging for PX4](eclipse_jlink.md).
- [Visual Studio Code IDE (VSCode)](../dev_setup/vscode.md).
## Video
The following video provides an overview of the tooling available for advanced debugging of PX4 via GDB.
It was presented at the PX4 Developer Conference 2023.
<lite-youtube videoid="1c4TqEn3MZ0" title="Debugging PX4 - Niklas Hauser, Auterion AG"/>
**Overview:** The inspection tools built into PX4 via Mavlink Shell (NSH) as well as interpretation of the PX4 uLog after a flight require PX4 to still be functioning. However, the most problematic bugs often manifest themselves in a (partially) hanging or crashed system. Therefore, we present the open-source Embedded Debug Tools project, which manages and configures probe, debugging and analysis tools for PX4 and NuttX:
- 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.
- Inspection of NuttX RTOS component internals: tasks, semaphores, scheduler.
- Inspecting peripheral state with CMSIS-SVD files and custom visualizations.
- Coredumping for post-mortem debugging via CrashDebug.
- Hardfault analysis in a live system and via the hardfault log.
- Remote GDB scripting via the Machine Interface.
- Automated HiL testing of PX4 via combined GDB and NSH scripting.
- ITM profiling over SWO pin using Orbuculum.
- Thread/IRQ/Workqueue/Heap visualization and latency analysis using perfetto.
- High-bandwidth ETM tracing over TRACE pins: J-Trace and ORBtrace mini.
- We conclude with an overview of interesting related project and an outlook on the future of PX4 debugging.
## Embedded Debug Tools
The [Embedded Debug Tools](https://pypi.org/project/emdbg/) connect several software and hardware debugging tools together in a user friendly Python package to more easily enable advanced use cases for ARM Cortex-M microcontrollers and related devices.
+8 -1
View File
@@ -3,13 +3,20 @@
A hard fault is a state when a CPU executes an invalid instruction or accesses an invalid memory address.
This might occur when key areas in RAM have been corrupted.
## Video
## Videos
The following video demonstrates hardfault debugging on PX4 using Eclipse and a JTAG debugger.
It was presented at the PX4 Developer Conference 2019.
<lite-youtube videoid="KZkAM_PVOi0" title="Hardfault debugging on PX4"/>
---
The following video provides an overview of the tooling available for advanced debugging of PX4 via GDB (including hard fault debugging).
It was presented at the PX4 Developer Conference 2023.
<lite-youtube videoid="1c4TqEn3MZ0" title="Debugging PX4 - Niklas Hauser, Auterion AG"/>
## Debugging Hard Faults in NuttX
A typical scenario that can cause a hard fault is when the processor overwrites the stack and then the processor returns to an invalid address from the stack.