This page lists some useful NuttX console commands. You can access the console through QGroundControl or using a USB-TTL-3V3 cable and debugger adapter board.
PX4 Dev Guide commands reference
The PX4 Dev Guide provides an auto-generated overview of (almost) all available commands. See the following page in the Dev Guide:
This page should provide an overview of some important and useful commands that people participating in the HoverGames might find useful.
This page will be updated when we come accross more useful commands. suggested improvements are welcome via email at HoverGames@nxp.com or
Test SDcard operation
You can perform a test of how well the currently inserted SD card is performing using the sd_bench command.
Test flash memory operation and erase flash memory
You can perform a read/write test of the flash memory using the mtd rwtest command.
The part of the flash memory which holds all PX4 parameters can be erased using the mtd erase command.
mtd_erase may be useful when you have flashed new firmware and find the need to do a full reset of the PX4 settings and parameters.
Start drivers for the available sensors on RDDRONE-FMUK66
All sensor drivers should be started on startup, but if this does not work or when you are debugging and need to restart a driver, you can use the following commands
The file that starts the sensors on power up and specifies which bus it is connected to, is located atROMFS/px4fmu_common/init.d/rc.sensors
Sensor commands
Each sensor has a set of commands, which are usually presented when you enter the name of the sensor without a specific command. For example, fxos8701cq supports the following commands:
Set and view parameter settings from command line
Parameters can be set from the command line, using param set PARAM VALUE, where PARAM is the name of the parameter and VALUE is the value to which it should be set.
For example, the airframe parameters can be set usingparam set SYS_AUTOSTART 4014, which sets the airframe to S500. After a reboot, the SYS_AUTOSTART parameter will then also change other parameters to the values that are set within the S500 airframe definition.
You can also easily read the current value a parameter is set to withparam show PARAM. This also allows for wildcard characters. For example, if you want to show the values of all parameters that start with SYS, you can use param show SYS*.
MAVLink instances
You can see the current active MAVLink instances using mavlink status
Listening to uORB messages
PX4 uses uORB for its internal communication between modules. It is possible to listen to uORB topics, which can be very useful for debugging or when developing new functions. See the following page for more information and commands:
if ver hwcmp NXPHLITE_V3
then
# Internal I2C (baro)
mpl3115a2 -I start
# Internal SPI (accel + mag)
fxos8701cq start -a 8 -R 0
# Internal SPI (gyro)
fxas21002c start -R 0
fi
fxos8701cq start
fxos8701cq stop
fxos8701cq test
fxos8701cq reset
fxos8701cq info
fxos8701cq testerror
fxos8701cq regdump
PX4 system console
Accessing and using the PX4 system console.
There are different options to connect to the serial console of the FMU. The most direct one is the connection with the DCD-LZ debug breakout board and FTDI cable. This is known as the root console and is initialized and starts emitting data immediately on power up or after reset. This can help specifically with lower level debugging. Any of the typical serial connection programs can be used. On Linux systems Minicom is widely used, on Windows TeraTerm or Putty can be used. Main detail to be careful of is to ensure the baudrate is set correctly. While many systems use 115200 baud as the default, the RDDRONE-FMUK66 uses 57600 baud. 8 Bit, no parity, is generally used.
Typically it is convenient to use the system console can also be accessed from QGroundControl. This assumes the system has successfully completed boot up and a connection between the FMU and QGroundControl can be established. It is called MAVLink Console, and it is available in the same menu as the log downloads. The MAVLink Console is available over both a hardwired USB cable connection and wirelessly over a telemetry connection.
More information about the system console is available on the PX4 Developer Guide:
The MAVLink Console can be found in the same menu as the Log Download feature.