Files
motor_params/AD_Keil_Project/AD_docs/BINARY_TRANSPORT.md

1.4 KiB

Binary Telemetry Transport

The firmware initializes two physical transports for the existing binary telemetry packet:

  • USB FS CDC ACM on PA11/PA12, clocked from HSI48.
  • FDCAN1 classic CAN on PB8/PB9, default 500 kbit/s with an external CAN transceiver.

Modbus RTU on USART2 remains active as the control channel. This is intentional: the host can always switch the telemetry mode back without reflashing.

Modbus Selection Registers

Modbus protocol/register-map version is 7.

Address hex / dec Field Access Purpose
0x001C / 28 H028_control_host_protocol R/W 0=Modbus control only, 1=binary telemetry output enabled
0x001D / 29 H029_control_binary_transport R/W 0=USB CDC, 1=CAN/FDCAN1, 2=USB CDC and CAN

USB CDC

USB is exposed as a CDC ACM serial stream. The stream does not guarantee message boundaries, so the PC side should parse by the telemetry header:

  • magic
  • payload_size
  • sequence
  • crc16

CAN/FDCAN

CAN carries the same binary packet split into classic 8-byte frames:

Standard ID Payload
0x5A0 packet bytes 0..7
0x5A1 packet bytes 8..15
0x5A2 packet bytes 16..23

The base standard ID is controlled by AD_CAN_TELEMETRY_STD_ID_BASE, default 0x5A0. The receiver reconstructs the packet from sequential frame IDs and uses the normal binary telemetry header to determine the full packet length.