How lora-net/loramac-node works
Project type and purpose
• This is a firmware stack for LoRaWAN end-devices (“LoRaMac-Node”), providing Class A/B/C support, radio drivers (SX1272/76, SX1261/2, LR1110), secure-element abstractions, board support packages, and example applications (fuota-test-01, periodic-uplink-lpp, ping-pong, rx-sensi, tx-cw).
• It’s a layered embedded system, built with CMake, targeting ARM-Cortex MCUs (SAMR34, STM32L0/L1/L4, SAML21, etc.).
File structure
• Top-level: cmake/ (build scripts), src/apps/ (projects), src/boards/ (board support packages with CMSIS + HAL + BSP), src/mac/ (LoRaWAN MAC layer), src/radio/ (transceiver drivers), src/peripherals/ (sensors & secure-element abstractions), src/system/ (hardware abstraction: SPI, I²C, UART, timers, delays, NVM).
• Patterns: clear separation of concerns—application layer, protocol stack (MAC), hardware abstraction, board-specific code, and vendor CMSIS + HAL.
• README covers architecture (Class A/B/C, radio, secure-elements), build process, platforms, subsystems.
Detailed capture of essential elements
• Do not just show “Application → Hardware”; break out the LoRaWAN stack into Handler, MAC, Region modules, Crypto, Serializer.
• SPI/GPIO/I²C interactions in the hardware path.
• NVM Manager (src/system/nvmm.c) for persistent LoRaWAN frame counters, keys.
• External RF link between “RF Front-End” and “LoRaWAN Network Server”.