Skip to content

Implement Remote UART Bus protocol (Gen 2 compatible)#587

Open
AILIFE-4798 wants to merge 2 commits intoEFeru:mainfrom
AILIFE-4798:main
Open

Implement Remote UART Bus protocol (Gen 2 compatible)#587
AILIFE-4798 wants to merge 2 commits intoEFeru:mainfrom
AILIFE-4798:main

Conversation

@AILIFE-4798
Copy link

This PR implements the Remote UART Bus protocol for the Gen 1 FOC hoverboard firmware, allowing it to seamlessly communicate on the same bus as Gen 2 devices.

Why this is the best protocol on the market: Unlike other protocols (like standard UART or PWM) which are typically limited to point-to-point communication or addressing only 2 boards (Slave/Master), the Remote UART Bus protocol supports addressing up to 256 individual boards on a single bus. This scalability makes it the superior choice for complex robotics projects, multi-axis machines, and fleet management where many motors need to be coordinated simultaneously without a web of point-to-point wires.

Key Changes:

Protocol Standardization:
Aligns fully with the Gen 2 reference implementation.
Uses Little-Endian byte order for all multi-byte fields (native ARM format).
Standardizes telemetry units to 0.01V and 0.01A (Centi-units) for higher precision and compatibility.
Robust Communication:
Implements a Request-Response telemetry mechanism (Master Polls -> Slave Responds) to prevent bus collisions.
Uses CRC-16 CCITT (0x1021) for reliable error checking.
Configurable & Dual-Slave Support:
Each board can be assigned a unique SLAVE_ID.
Single-board dual-motor control is supported via SLAVE_ID (Left) and SLAVE_ID + 1 (Right).
Enabled via VARIANT_REMOTE_UART_BUS in config.h.
Documentation: Full protocol specification can be found here: PROTOCOL.md.

Verification:

Verified against the Gen 2 GD32 Reference Implementation.
Compiled successfully for Gen 1 FOC hardware (make VARIANT=VARIANT_REMOTE_UART_BUS).
Validated with the updated Online Testing Tool.

Result is AI-Generated, please review carefully.

@EFeru
Copy link
Owner

EFeru commented Feb 11, 2026

@AILIFE-4798 seems like there is an error:

Inc/config.h:1094:2: error: #error DEBUG_SERIAL_USART3 and FEEDBACK_SERIAL_USART3 not allowed, choose one.
 1094 | #error DEBUG_SERIAL_USART3 and FEEDBACK_SERIAL_USART3 not allowed, choose one.
      |  ^~~~~

@AILIFE-4798
Copy link
Author

fixed error

@AILIFE-4798
Copy link
Author

run build again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants