LibXR Only
Use the LibXR core API, peripheral drivers and middleware in an existing project.
LibXR is a cross-platform C++ compatibility layer with peripheral drivers, data structures, communication middleware, OS abstractions and math utilities, plus the USB protocol stack XRUSB.
The CodeGenerator and XRobot are two command-line tools used with LibXR: the CodeGenerator generates the peripheral objects and the entry function app_main from an STM32CubeMX project, and XRobot fetches Modules, locks each one to a commit, and generates the main function XRobotMain from a configuration.
The terminal here is LibXR compiled to WebAssembly and running in the browser. Terminal provides line editing, history and path completion, and runs the commands stored in RamFS by path.
On a microcontroller, the same Terminal provides a command line over a UART or a USB virtual serial port.
On microcontrollers the UART driver keeps the receive DMA running. The interrupt works out the new bytes from the DMA write pointer, writes them with PushBatch into SPSCQueue, the ring queue of the ReadPort, and calls Publish() to complete pending reads.
The receive path has no step that stops and restarts the DMA; software only catches up with the hardware write pointer.
Topic is an in-process publish/subscribe channel with an exact payload type. A publish is delivered synchronously to the registered subscribers, each of which receives it in one of four ways: synchronous, asynchronous, queued or callback.
On Linux, LinuxSharedTopic keeps the data in shared-memory slots and subscribers read the same memory through descriptors, so no data is copied between processes.
A BSP lists the Modules it needs in Modules/modules.yaml. xrobot setup fetches them and locks each one to a commit in xrobot.lock, and xrobot gen generates the main function XRobotMain from a configuration under User/.
The CI of an STM32 BSP calls a shared workflow: it checks that the generated files match the commit, builds every configuration, and uploads the firmware on a push to master, a v* tag or a published release.
XRUSB is the USB device stack in LibXR. It provides device classes such as CDC, HID, UAC, GSUSB, CMSIS-DAP v1/v2 and DFU, and one device can contain several device classes at once.
The debug interfaces implement SWD and JTAG with GPIO timing; the DAPLink device classes use them to access a target chip, for example to read the DP IDCODE.
The official Source includes Modules for IMUs, magnetometers, barometers, optical flow, laser ranging, grey-scale line following, RC receivers, displays and attitude estimation.
A configuration selects Modules and fills in their parameters, and xrobot gen generates the main function of one robot from it; different configurations make up the firmware of different robots.
The four entries match four kinds of projects; the scenario list gives starting points for common tasks.
Use the LibXR core API, peripheral drivers and middleware in an existing project.
Generate the peripheral objects and the entry function app_main from an STM32CubeMX project and add LibXR to its CMake build.
Fetching and locking Modules, configurations and main function generation.
The system layer and peripheral drivers a new operating system or chip implements.
XR_REGISTER, and xrobot gen generates an XRobotMain that constructs the instances in configuration order.driver in LibXR.Starting paths by platform that introduce the design ideas and the basic usage of XRobot and LibXR step by step.
A one-page start-up context: the coding agent first decides whether the repository is an XRobot BSP, a platform project or a driver project, then opens the matching docs and code.
The official Source lists the Modules that a BSP can add; xrobot source searches and shows its entries.
Repository and branch conventions, coding and documentation style, testing rules, and how to submit changes.
XRobot is all you need