Close

Firmware architecture (WIP)

A project log for LoRaTube

A compact and rugged LoRa repeater designed for long-range communication and 5+ years of off-grid operation using only alkaline batteries.

bertrand-selvaBertrand Selva 01/10/2026 at 15:120 Comments

Hackaday log – Firmware architecture (Work in progress)

I am currently writing the firmware.
Time is limited at the moment and I am quite busy, so progress is steady but deliberately slow.

I am aligning the codebase with a new firmware “skeleton” I am developing:
https://github.com/Bertrand-selvasystems/firmware_skeleton_espidf

Architecture rules

Drivers (module_*.c) are self-contained

Tasks (task_*.c) orchestrate hardware access through drivers
Tasks are the only place where the system:

APIs (API_*.c) talk to tasks, not to hardware

Configuration is split into two layers

Layers and dependencies

app_main / initialization
API_* (facade, intent-level calls)
task_* (FreeRTOS actors, ownership and logic)
module_* (drivers, hardware access only)

Allowed dependencies

Design rationale

The goal is clean, stable firmware, especially by enforcing one service per critical hardware block.
This guarantees zero concurrent access to the same peripheral, even in unexpected edge cases, which is a major stability gain.

This point is absolutely central for a system designed to run unattended for five years, or close to it, such as a remote LoRa repeater deployed in the field.

At this stage, I have implemented:

The current work-in-progress code is available here:
https://github.com/Bertrand-selvasystems/loratube_firmware

There is still a lot to do, but the foundation is now in place. 

The LEDs are blinking, which is usually a good sign.

Discussions