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 (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vedderb/bldc/llms.txt
Use this file to discover all available pages before exploring further.
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 theUART_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 inappconf_default.h:
app_uartcomm_configure at runtime:
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:| Field | Size | Description |
|---|---|---|
| Start byte | 1–2 bytes | 0x02 for short packets (≤255 bytes), 0x03 for long. |
| Length | 1–2 bytes | Payload length. |
| Payload | N bytes | Command byte followed by command-specific data. |
| CRC16 | 2 bytes | CRC over the payload. |
| Stop byte | 1 byte | 0x03. |
packet module. The application thread calls commands_process_packet for each complete received packet.
Serial configuration
Fromapp_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.
Wiring
Connect your host controller to the COMM header:| COMM pin | Signal |
|---|---|
| TX | VESC transmit → host RX |
| RX | VESC receive ← host TX |
| GND | Common ground |
| 5V / 3.3V | Optional power supply |
