Debugging Overview

Basic Options

  • printf() style debugging on the NSH commandline.
  • JTAG/SWD based debugging with GDB or graphically with Eclipse / GDB
  • Controller / estimator debugging with sending realtime graphing data

printf() Debugging

Some IMPORTANT notes:

  1. A printf() can delay or alter the program flow
  2. Do NOT use printf() in anything that could be called by an interrupt service routine (most of the driver layers). In the case of PX4IO, use the isr_debug() function.


In general use isr_debug() as most of the code on IO runs on the interrupt service code. This function buffers the string and empties the buffer in the non-ISR mainloop function. This also means that the program flow is not altered at the location the printing statement is inserted.


This line prints two numbers into the buffer, which is emptied in the main loop. Linefeed (\n) is already automatically appended.

isr_debug(0, "tick debug=%u status=0x%x", (unsigned)debug_level, (unsigned)r_status_flags);
Translations of this page:

Quick Links

QR Code: URL of current page