Skip to main content
The UART application enables an external microcontroller or computer to control and monitor the VESC over a serial UART connection using the VESC communication protocol. This is the default application (APP_UART) so the UART port remains available for firmware updates immediately after flashing.

Port assignments

The firmware supports up to three UART ports, selected by the UART_PORT enum:
UART_PORT_COMM_HEADER (index 0) is the standard external-access port and the one to use when connecting a Raspberry Pi, Arduino, or other host controller.

Baud rate

The default baud rate is 115200 bps, defined in appconf_default.h:
You can change this in VESC Tool under App Settings → UART or call app_uartcomm_configure at runtime:
Setting permanent_enabled to true keeps the UART port active even when another application is selected.
The APPCONF_PERMANENT_UART_ENABLED default is true, which means UART communication with VESC Tool remains available regardless of which application is active.

Communication protocol

The VESC UART protocol uses length-prefixed packets with a CRC16 checksum. Each packet has the structure: The packet framing is handled by the packet module. The application thread calls commands_process_packet for each complete received packet.

Serial configuration

From app_uartcomm.c, the UART is configured with standard 8N1 framing and LIN break detection:

Runtime API

Combining with other applications

If you need analog or PPM input and UART telemetry simultaneously, use the combined modes:
  • APP_PPM_UART — PPM input with UART active.
  • APP_ADC_UART — ADC input with UART active.
In these modes the UART port handles communication with VESC Tool while the physical input signal drives the motor.

Wiring

The VESC UART pins operate at 3.3 V logic. Do not connect a 5 V UART directly without a level shifter, as this will damage the hardware.
Connect your host controller to the COMM header: