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
Some IMPORTANT notes:
- A printf() can delay or alter the program flow
- 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
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);