How lora-net/usp_zephyr works
USP for Zephyr adapts Semtech’s LoRa software platform to Zephyr radios. The main runtime path is the USP thread: it initializes the modem HAL, signals readiness, then repeatedly runs the modem and RAC engines (and optionally FLRP) before sleeping. Radio-family board, HAL, and calibration/BSP implementations provide the hardware-facing layer; modem helpers, platform utilities, logging, LEDs, tracing, and storage support the integration. README capabilities include advanced multi-protocol support and FLRP. Several subsystem links are documented capabilities rather than verified calls in the excerpts, so they are omitted or marked unverified.
Main entry points: zephyr_usp_thread.c USP main thread · smtc_modem_hal.c Modem HAL · lr11xx_board.c LR11xx board · lr20xx_board.c LR20xx board
Components 23
USP runtime
- USP main thread
subsys/usp/zephyr_usp_thread.c - Initialization sync
subsys/usp/zephyr_usp_initialization.c
Modem services
- Modem engine
- RAC engine
- FLRP engine
- Modem callbacks
subsys/usp/smtc_modem_helper.c - Modem HAL
modules/smtc_modem_hal/smtc_modem_hal.c - Modem storage
modules/smtc_modem_hal/smtc_modem_hal_storage.c - Debug tracing
modules/smtc_modem_hal/smtc_modem_hal_dbg_trace.c
Radio hardware
- LR11xx board
drivers/usp/lr11xx/lr11xx_board.c - LR11xx HAL
drivers/usp/lr11xx/lr11xx_hal.c - LR11xx calibration
drivers/usp/lr11xx/lr11xx_ral_bsp_calibration.c - LR20xx board
drivers/usp/lr20xx/lr20xx_board.c - LR20xx HAL
drivers/usp/lr20xx/lr20xx_hal.c - LR20xx calibration
drivers/usp/lr20xx/lr20xx_ral_bsp_calibration.c - SX126x board
drivers/usp/sx126x/sx126x_board.c - SX126x HAL
drivers/usp/sx126x/sx126x_hal.c - SX126x BSP
drivers/usp/sx126x/sx126x_ral_bsp.c
Zephyr platform
- Platform helpers
subsys/usp/smtc_sw_platform_helper.c - LED service
subsys/usp/smtc_hal_led.c - Custom logging
subsys/usp/smtc_zephyr_log_custom.c
Other components
- Zephyr application
- Zephyr RTOS
Connections 19
- Zephyr application → USP main thread: starts runtime
README.md - USP main thread → Modem HAL: initializes HAL
subsys/usp/zephyr_usp_thread.c - USP main thread → Initialization sync: signals ready
subsys/usp/zephyr_usp_thread.c - USP main thread → Modem engine: runs engine
subsys/usp/zephyr_usp_thread.c - USP main thread → RAC engine: runs engine
subsys/usp/zephyr_usp_thread.c - USP main thread → FLRP engine: runs engine
subsys/usp/zephyr_usp_thread.c - USP main thread → Zephyr RTOS: sleeps via
subsys/usp/zephyr_usp_thread.c - Modem HAL → LR11xx board: radio integration
- Modem HAL → LR20xx board: radio integration
- Modem HAL → SX126x board: radio integration
- LR11xx board → LR11xx HAL: uses HAL
- LR11xx board → LR11xx calibration: uses BSP
- LR20xx board → LR20xx HAL: uses HAL
- LR20xx board → LR20xx calibration: uses calibration
- SX126x board → SX126x HAL: uses HAL
- SX126x board → SX126x BSP: uses BSP
- Platform helpers → Zephyr RTOS: uses services
- LED service → Zephyr RTOS: drives GPIO
- Custom logging → Zephyr RTOS: uses logging