Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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:

  1. Go to the "Configuration" tab
  2. Select "Hardware" from the menu on the left
  3. 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)

Image Modified

Tip
titleWindows CDC/Virtual COM Port Driver

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 (flight\Project\WindowsUSB\OpenPilot-CDC.inf). To install it, right-click the .inf file and click "Install".

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:

...