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:
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.
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 https://community.nxp.com/community/mobilerobotics
You can perform a test of how well the currently inserted SD card is performing using the sd_bench
command.
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.
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
NXP MPL3115A2 pressure sensor (I2C): mpl3115a2 -I start
NXP FXOS8701CQ accelerometer/magetometer (SPI): fxos8701cq start -a 8 -R 0
NXP FXAS21002C gyroscope (SPI): fxas21002c start -R 0
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
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:
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*
.
You can see the current active MAVLink instances using mavlink status
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: