Skip to content

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

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

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

Conversation

@AILIFE-4798

Copy link
Copy Markdown

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

EFeru commented Feb 11, 2026

Copy link
Copy Markdown
Owner

@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
Copy Markdown
Author

fixed error

@AILIFE-4798

Copy link
Copy Markdown
Author

run build again

@Spangen

Spangen commented Jun 9, 2026

Copy link
Copy Markdown

It is imposibly hard to study the actual code changes in your merge request, as you have changed so much of the formating in the original code you forked that the compare comes up with 3,237 additions and 2,274 deletions.

That being said, I absolutely love the posibility to have that bus protocol implemented in this code. My advice is probably to revise your code with the formating of the original repo, so that the compare only shows your actual code, and not 2000+ false aditions/deletions because of format changes.

Another thing that would be great for the comunity is if you could add a simple arduino (esp32) sketch like the one for the regular serial control, but that uses this protocol.

BTW: i see the protocol implements the odometry posibility from RoboDurdens projects. Is this implemented and working in this commit? I was currently working on a commit to implement that part from hes code in this original repo recently, but has not had time to finish that yet.

Best wishes for this being merged, i totally look forward to it.

Robert

@EFeru

EFeru commented Jul 4, 2026

Copy link
Copy Markdown
Owner

@AILIFE-4798 I agreee with the last comment, is for you a big effort to revert the files and only include the actual lines of code that were changed/added?

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.

3 participants