Kbox-UniStack Docs
STM32 (HAL)

STM32 (HAL) Platform

The STM32F103xB HAL platform of kbox-stack — Hal drivers, NCN5130/Elmos transceivers, an arm-none-eabi build, and OpenOCD flashing.

What this platform provides

kbox-stack is a portable KNX stack: its core is MCU-agnostic and talks to hardware only through dependency-injected I<X> peripheral interfaces. STM32 (HAL) is one platform — today's — that implements those interfaces on top of the ST HAL for the STM32F103xB family.

This platform gives you everything needed to run a certified-grade KNX device on real hardware:

  • Hal* peripheral driversHalKnxBusDriver, HalFlash, HalLed, HalIWDGWatchDog — plus portable helpers (BaseClock, BaseButton) that implement the core interfaces.
  • KNX line transceiversNcn5130 and ElmosE98123 drivers for the analog front-end that couples the MCU UART to the TP1 bus.
  • A prebuilt static librarylibkbox-stack---cortexm3---STM32F103xB.a, compiled for Cortex-M3 / STM32F103xB.
  • An arm-none-eabi CMake build that links that .a and produces .elf / .hex / .bin.
  • OpenOCD flashing over ST-Link / SWD.

Target hardware

ItemValue
MCUSTM32F103TBUx (Cortex-M3, 128 KB flash, 20 KB RAM)
KNX transceiverNCN5130 (default) or Elmos E981.03
KNX bus UARTUSART2, 19200 baud, 9 data bits, even parity, 1 stop (9E1)
Debug / flash probeST-Link (SWD)
Toolchainarm-none-eabi-gcc, CMake 3.22+

The reference application for this whole section is the led-indicator example that ships inside the stack distribution (examples/STM32F103-HAL/led-indicator/). Every page below reads from it.

What's included

Portable core, this platform

The core stack is MCU-agnostic. It depends only on the I<X> peripheral interfaces described in the core docs — never on STM32, the ST HAL, or any board. The pages in this section are the STM32 (HAL) implementation of those interfaces. A future platform (for example ESP32 or Zephyr) would be a sibling section with its own drivers and its own rebuilt .a, while the application code and stack API stay the same.

See the portable core: the peripheral contracts in Peripheral Interfaces, how the stack is assembled in Constructing the Stack, and how to bring up a new platform in Porting.