$ show armel/uv-k1-k5v3-firmware-custom
This repository contains custom open-source firmware for Quansheng UV-K1/K5 V3 handheld ham radios, built around the PY32F071 MCU. It is a fork in the lineage DualTachyon → Egzumer → F4HWN → this project, adding features gated by compile-time flags (ENABLE_FEAT_F4HWN_*, ENABLE_NOAA, ENABLE_DTMF_CALLING, etc.). The firmware is bare-metal C (no RTOS in the application code despite CMSIS-RTOS2 RTX5 being vendored), with a main-loop architecture and an overlay app system using an app_api_t struct of function pointers. The build system uses CMake presets, per-app build.sh scripts, and a Docker wrapper (compile-firmware.sh) producing .elf/.bin/.hex artifacts. A pack_app.py script packs raw binaries into .app blobs. The repository vendors a large CMSIS_5 tree (~20k+ files), most of which is unused DSP/RTOS/validation code, bloating the repo. The README explicitly warns that flashing can brick radios, and overlay apps run with full privileges (no MPU). Notable engineering patterns include the overlay app API (function-pointer-based, placed in .text.entry section), an LL I2C driver mirroring STM32 LL conventions, and extensive conditional compilation. However, the codebase shows drift: deprecated compile-with-docker.sh retained as a forwarding shim, repetitive per-app build scripts, vendored CMSIS that may be outdated, and a license placeholder in the CMSIS bundle. Maintenance is active with recent commits, but the fork lineage and vendored dependencies create ongoing merge/upstream complexity. This is purely an embedded application repository - no datasets, ML models, or research artifacts are present.
The LLM identified 4 files worth highlighting for reuse:
Overlay app pattern using an app_api_t struct of function pointers (backlight_on, get_key, blit_full, status_line, fb) with app_main placed in the .text.entry section. This is a clean plugin-style architecture for runtime-loadable app modules on the radio, and the pattern could be extracted for any embedded system needing modular application loading.
Packs raw compiled binaries into .app blob format, reading header constants from C headers. A self-contained build/packaging utility adaptable to other firmware projects needing a custom binary container format with header metadata.
Docker-based firmware compilation wrapper producing .elf/.bin/.hex artifacts via CMake presets. Encapsulates the toolchain for reproducible builds across environments; the containerized embedded toolchain pattern is broadly reusable.
LL I2C driver mirroring STMicroelectronics LL API conventions, suggesting drop-in STM32 compatibility. The driver is isolated and could be reused in other STM32-compatible projects needing a lightweight hardware abstraction layer, though it lives inside a large vendored CMSIS tree.