Generate a hex CAN frame for this firmware and see an annotated breakdown.
Notes
Extended ID Format: (CAN_PACKET_ID << 8) | ControllerID
Data encoding: Follows firmware buffer scales (see comm_can.c)
RX Buffer Multi-frame: FILL_RX_BUFFER commands split large payloads across multiple frames. Use PROCESS_RX_BUFFER to execute the assembled command with CRC validation.
UART Command Builder
The new UART Command Builder allows you to send any COMM_PACKET_ID command over CAN using the RX buffer protocol. This enables complex operations like configuration changes, motor detection, and terminal commands.
How it works:
- Select a UART command (e.g., COMM_GET_VALUES, COMM_SET_DUTY)
- Fill in the command-specific parameters (automatically generated UI)
- The tool builds a complete UART packet with proper payload encoding and CRC16
- Generates the CAN frame sequence to send it via RX buffer
Automatic Buffer Optimization:
- PROCESS_SHORT_BUFFER: Single CAN frame for commands ≤6 bytes (auto-selected)
- FILL_RX_BUFFER + PROCESS_RX_BUFFER: Multi-frame sequence for larger commands
- Smart Selection: Tool automatically chooses the most efficient transmission method
Example Usage:
- Get Values: Select COMM_GET_VALUES (no parameters needed) → Request motor data
- Set Current: Select COMM_SET_CURRENT, enter "10.0" in Current field → Set 10A current
- Terminal Command: Select COMM_TERMINAL_CMD, enter "help" → Send terminal command
- Motor Detection: Select COMM_DETECT_MOTOR_PARAM, set max power loss → Start detection
Response Modes (commands_send parameter):
- Mode 0: Packet goes to commands_process_packet of receiver (normal processing + response)
- Mode 1: Packet goes to commands_send_packet of receiver (direct send without processing)
- Mode 2: Packet goes to commands_process and send function is set to null so that no reply is sent back
- Mode 3: Same as 0, but the reply is processed locally and not sent out on the last interface
Smart Parameter Generation:
- Automatically creates appropriate input fields for each command
- Handles proper data scaling (duty×1e5, current×1e3, position×1e6, etc.)
- Provides helpful descriptions and valid ranges for each parameter
- Supports floats, integers, strings, and binary data as needed
Traditional RX Buffer sequence:
- FILL_RX_BUFFER (offset=0, data=first chunk)
- FILL_RX_BUFFER (offset=7, data=second chunk)
- PROCESS_RX_BUFFER (lastID, cmdSend, totalLen, CRC16)