How unlir/xdrive works
Project type and purpose
• This is an embedded real-time firmware project for a stepper-motor controller (XDrive) with closed-loop control and multifunction interfaces.
• It consists of two firmware images: a USB bootloader (Firmware_BL) and the main application firmware (Firmware_APP), plus electrical schematics, mechanical CAD, photos, and specifications.
File structure
• Top level:
• Firmware_APP – main application, built in Keil MDK-ARM (UVProjx).
• Firmware_BL – bootloader image used for in-field USB updates.
• Hardware – PCB schematics and BOM.
• Machinery – enclosure CAD and STL.
• Picture, Specification – documentation.
• Inside Firmware_APP:
• Drivers/CMSIS & STM32F1xx_HAL_Driver – vendor HAL and CMSIS core.
• Core (Inc/Src) – HAL glue, system startup, ISRs.
• Kernel – simple scheduler loop.
• Base_Drivers – board-specific I/O wrappers (GPIO, UART, signal port, encoder, motor driver).
• Base_Math – low-level math utilities (trigonometry, rein_math).
• Control – closed‐loop algorithms: Current_Tracker, Speed_Tracker, Location_Tracker/Interp, Move_Reconstruct, motor_control.
• Debug – UI layer: button, OLED SSD1306, pictures.
• Config – board and linker scripts.
• MDK-ARM – IDE project, linker files, .bin/.hex output.
Extract Architectural Insights from the README
• The README confirms two-image structure (bootloader and main), lists update history, and maps directories to functionality.
• It emphasizes stepper motor closed-loop control and multi-function interfaces (USB, buttons, display).