How ryzee119/hawk works
Project type and purpose
• Hawk is an open-source hardware/firmware replacement of the Xbox Live Communicator.
• It comprises a custom PCB (KiCad files under hardware/), a BOM/gerbers (kitspace/), and embedded firmware (src/).
File structure
• hardware/… — KiCad schematic and PCB layout, part libraries, footprints.
• kitspace/… — Gerber outputs and BOM for manufacturing.
• src/… — Firmware source, broken into:
– HAL and system startup (stm32g4xx/)
– USB device stack (usbd/)
– I²S audio codec driver (max9860/)
– EEPROM emulation (eeprom_emulation/)
– FIFO buffer (fifo.c/h)
– Application entrypoint (main.c)
– Syscalls, memory (syscalls.c, sysmem.c)
• platformio.ini — Build configuration.
Pull insights from the README
• Main MCU: STM32G431 series
• Audio codec: MAX9860
• Physical I/O: push-button, LED, 3.5 mm TRRS jack
• Interfaces: Xbox controller port (USB 1.1), DFU via USB, ST-Link header
Main components
A. Hardware Blocks
1. STM32G431 MCU
2. MAX9860 audio codec
3. TRRS headset jack
4. Volume/mode button
5. Status LED
6. USB D+ / D– lines
7. ST-Link 5-pin header
B. Firmware Layers
1. STM32 HAL + startup code (stm32g4xx_*.c)
2. USB device stack (usbd_conf, xblc)
3. Audio codec driver (max9860.c/h)
4. FIFO buffering (fifo.c/h)
5. EEPROM emulation (ee.c/h)
6. Application logic (main.c/h)
7. System calls / memory (syscalls.c, sysmem.c)
Relationships and data flows
• USB↔STM32 USB‐Device Stack ↔ Application Logic
• Application Logic ↔ EEPROM Emulation (persistent volume & gain)
• Application Logic ↔ FIFO ↔ MAX9860 Codec ↔ TRRS Jack
• Application Logic ↔ LED PWM (volume indication)
• Button GPIO → Application Logic (interrupts or polling)
• DFU Mode: USB DFU Bootloader (via USB lines)
• ST-Link: programming/debug directly into STM32
Architectural patterns
• Layered embedded design
– Hardware Abstraction Layer (stm32g4xx_hal_*)
– Middleware (USB stack)
– Device drivers (max9860, fifo)
– Application layer (main.c)
• Separation of concerns: I/O drivers vs. business logic vs. persistence
• Non-volatile emulation: eeprom_emulation stores settings in flash
Essential elements
• Blocks: MCU, codec, button, LED, jack, USB host, ST-Link
• Firmware layers and key modules (HAL, USB, max9860 driver, eeprom_emulation, app)
– USB host→MCU USB stack→app
– app→codec driver→codec↔TRRS
– button→app; app→LED
– app↔eeprom_emulation
• Annotations: mention PlatformIO (platformio.ini) and KiCad files as build inputs