...
- a virtual COM port via USB
- a serial (UART) interface (Main Port/Flexi Port)
Enabling an Interface
Before writing to the virtual COM port or a UART interface using the debug console, the port has to be assigned to that function in GCS:
- Go to the "Configuration" tab
- Select "Hardware" from the menu on the left
- Choose "DebugConsole" for the port you would like to use (USB is the easiest so set up, Main- or Flexi Port need a USB to serial converter)
Tip | ||
---|---|---|
| ||
On Windows, a driver is needed in order to use the USB virtual COM port. If you have installed GCS using a setup file and checked the option "Install CDC Driver", the driver was installed already. Otherwise, the driver can be found inside the LibrePilot repository ( |
Enabling the Debug Console
To enable the debug console, uncomment the following two lines in flight/targets/<board name>/firmware/inc/pios_config.h
:
...
You should also set DEBUG_LEVEL
to an appropriate value. This constant controls the verbosity of the debug output, you'll see what that means below.
Using the Debug Console
Now that everything is configured, the debug console can be written to using the DEBUG_PRINTF
macro:
...