LuxLibre

LuxLibre › Firmware › Ports

Ports

A port implements the hardware abstraction layer (../hal/lx_hal.h) for one MCU family. How to write one: docs/firmware/porting.md.

Port Status Flash / RAM used Build Flash with
host simulator and tests, used by CI on every change PC make test, make sim  
attiny1616 builds and links; not yet tested on hardware 11.4 KB of 16 KB / 0.2 KB of 2 KB make tiny1616 BOARD=<board> UPDI (pymcuprog)
ch32v003 builds and links; not yet tested on hardware 11.8 KB of 15.75 KB / 0.5 KB of 2 KB make ch32v003 BOARD=<board> WCH-LinkE (minichlink)
esp32c3 experimental; checked against the ESP-IDF API, CI build configured (allowed to fail until it has passed once); not yet compiled with ESP-IDF or tested on hardware   idf.py build USB

“Not yet tested on hardware” means exactly that: the code follows the datasheets and reference manuals and has been checked by building, by disassembly (vector tables, start-up) and by review, but nobody has run it on a board. The first board for each port goes through the bring-up in docs/testing.md before anything else.

host

ports/host/sim.cpp implements the HAL on top of a simulated flashlight (cell, LED and driver, two-node thermal model, sensor with lag and noise, USB charger, emulated EEPROM, console). Details: docs/firmware/simulator.md.

attiny1616

The MCU of many current enthusiast drivers (Microchip tinyAVR 1-series).

ch32v003

A 32-bit RISC-V MCU that costs about $0.13 in quantity and runs from 2.7 to 5.5 V.

esp32c3

The ESP32-C3 port runs the FlashKa keychain light under ESP-IDF 5.x: v0.5 with one button, and v0.6 with three buttons on a resistor ladder (one pin measures the ladder with the ADC, a second pin on the same net wakes the chip), of which LuxLibre uses the main button. How a board declares a ladder: docs/firmware/porting.md. See esp32c3/README.md for building and its limitations; the ladder path is untested on hardware.