$ show Schildkroet/GRBL-Advanced
GRBL-Advanced is a real-time CNC motion control firmware for STM32F4xx microcontrollers, forked from Grbl v1.1. It interprets G-code (RS274/NGC) and executes coordinated multi-axis stepper motor movements with acceleration planning, backlash compensation, and look-ahead buffer management. The system supports advanced features such as lathe mode, laser mode, probing, homing cycles, tool change with tool length offset, canned drilling cycles, and Ethernet connectivity via WIZnet chips. The architecture is modular: a hardware abstraction layer (HAL) abstracts GPIO, USART, SPI, I2C, timers, and flash memory; a set of libraries provide CRC, PID control, a custom GrIP communication protocol, and buffered serial I/O; and the core Grbl modules handle G-code parsing, motion planning, stepper driving, spindle/coolant control, and system settings with EEPROM persistence. The firmware runs on Nucleo boards (STM32F411RE or STM32F446RE) with a 1ms SysTick interrupt for real-time command processing and a dedicated timer ISR for stepper pulse generation. External dependencies include the STM32 Standard Peripheral Library (SPL) for low-level MCU peripheral access, CMSIS Cortex-M4 headers, and WIZnet ioLibrary for Ethernet. The build system uses GCC ARM embedded toolchain and supports both Makefile and EmBitz IDE.
The LLM identified 4 files worth highlighting for reuse:
Configurable CRC calculation library supporting 8/16/32-bit widths with runtime or table-based modes. Standalone implementation with no hardware dependencies, easily portable to any embedded project requiring data integrity verification.
Lightweight packet-based communication protocol with versioning, CRC integrity, and message type dispatch. Designed for reliable command/response over serial or TCP links. Reusable as a generic embedded protocol layer.
Generic PID controller implementation with anti-windup, direction control, and configurable sample time. No hardware dependencies, making it suitable for any control system requiring proportional-integral-derivative feedback.
Circular buffer implementation for buffered serial I/O, used by the Printf library and communication layers. Provides a clean, reusable pattern for decoupling interrupt-driven serial reception from application-level processing.