All pages
Powered by GitBook
2 of 2

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.

The MAVLink Console can be found in the same menu as the Log Download feature.

More information about the system console is available on the PX4 Developer Guide:

https://dev.px4.io/en/debug/system_console.htmldev.px4.io

Useful console commands

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:

https://dev.px4.io/en/middleware/modules_main.htmldev.px4.io

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

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

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

ROMFS/px4fmu_common/init.d/rc.sensors
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

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:

fxos8701cq start
fxos8701cq stop
fxos8701cq test
fxos8701cq reset
fxos8701cq info
fxos8701cq testerror
fxos8701cq regdump

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:

https://dev.px4.io/en/middleware/uorb.html#listing-topics-and-listening-indev.px4.io