I would also like to see an answer to this question.
It’s been almost 2 years since I’ve had my hands on PX4 and back then I used a similar workflow as what you are describing: FTDI cable into Pixhawk 1. When I wanted a printf() statement to make it to the nuttx shell, I remember stopping and starting an app. For example, if I wanted to debug something I was changing in mavlink_receiver.cpp, I would do the following:
nsh> mavlink stop-all
nsh> mavlink start
and then I would start to see my debug printf() statements
I’ve now moved to the Intel RTF and, as far as I can tell, the only way I can interface with the NuttX Shell is via the mavlink shell:
Firmware/Tools/mavlink_shell.py. My old workflow of stopping and starting still works for most apps (e.g.
mc_pos_control) but not if I am debugging mavlink itself. The problem here is that I cannot stop and start mavlink anymore because stopping it cuts off my session with the flight controller.
Therefore I want my PX4_INFO() and PX4_WARN() statements to automatically print to mavlink shell from startup without me having to do my clunky stop-start workflow.