How wirepas/wm-sdk works
Project type and purpose
• It is an embedded Single-MCU SDK for Wirepas wireless mesh applications.
• Purpose: provide HAL, board support, libraries, APIs, bootloader, build scripts, and examples to compile a complete firmware image (.hex/.a) that runs on various MCUs (nRF, EFR32, etc.) with the Wirepas binary stack.
Main components
1. Host environment
– GCC Arm toolchain
– Python 3.x + pycryptodome
– Make, Doxygen, Docker (for docs)
– Python helper scripts under tools/
2. Build system
– Top-level Makefile + makefile_common.mk
– Sub-makefiles: makefile_app.mk, makefile_stack.mk, makefile_bootloader.mk, etc.
– Invokes compilation and linking of each layer
3. Wirepas binaries (proprietary)
– .a, .hex, .conf files placed in image/
– Linked into final firmware images
4. Core SDK layers (source/)
a. API layer (api/*.h) – public C interfaces exposed to application
b. HAL & MCU drivers (mcu/, board/) – board support packages, peripheral drivers, CMSIS, linker scripts, INI files
c. Libraries (libraries/) – positioning, provisioning, scheduler, dual-MCU, shared_xxx modules
d. Utility code (util/) – CRC, AES, CBOR, debug, pack, ring buffers, etc.
5. Bootloader (bootloader/)
– early_init, external_flash, hardware interface
– buildable as standalone image or integrated
6. Example & reference applications (source/example_*/, source/reference_*/, source/unitary_*/)
– Demonstrate usage of API and libraries
7. Documentation (projects/doxygen/)
– Doxygen templates, CSS, scripts
– Generates HTML hosted at wirepas.github.io/wm-sdk
Relationships & data flow
– Toolchain, Python & scripts, Makefiles, Doxygen.
• Build System orchestrates:
– Compile HAL & board support → produce object files
– Compile util & libraries → static libs (.a)
– Compile application source → object files
– Link application + libraries + API + Wirepas binaries → final firmware (.hex)
– Build bootloader similarly
• That Wirepas binaries in image/ are injected at link time.
• Output: firmware images per board/app under build/<board>/<app>/
Architectural patterns & principles
– Layered architecture: Hardware Abstraction → Core Libraries → API → Application
– Board-abstraction via board/ + mcu/
– Plug-in examples: easy to swap apps without touching SDK internals
– Modular libraries: single responsibility (e.g., provisioning, positioning)
– Build-system driven by make macros for maximum portability
Putting it all together
– In the middle, stack the layered SDK components from bottom (HAL) up to top (Application).
– Optionally, include a separate “Documentation Generator” flow from source code → Doxygen → HTML.