Creating Z-Wave + BLE SMP Solution#
This guide explains how to build a switched multiprotocol (SMP) firmware for an EFR32ZG28 device which combines a Z-Wave Switch On/Off application and a Bluetooth OTA DFU application that can upgrade the Z-Wave app. It combines:
App 1 (Z-Wave): Switch On/Off application
App 2 (Bluetooth LE): OTA DFU application used to deliver updates for the Z-Wave app
A bootloader that supports switching between the two apps and provides an OTA storage slot
This workflow uses the SLC command line interface to generate a single workspace containing both applications.
Glossary#
Projects
Z-Wave app project:
zwave_soc_switch_on_offBootloader project:
bootloader-storage-internal-single-zwave-otaBLE app project:
bt_soc_app_ota_dfu
Prerequisites#
Install required components via Simplicity Studio Package Manager#
In Simplicity Studio, open Package Manager and install the components required for:
Simplicity SDK 2026.6.x containing Z-Wave and Bluetooth examples
SLC CLI (Simplicity Studio command-line project generator)
Simplicity Commander (device erase/flash and token provisioning)
LLVM toolchain
Workspace/path guidance (Windows)#
Keep project paths short to avoid Windows path-length issues during generation/build.
Flash Layout#
Start Address | Region | Size |
|---|---|---|
| Bootloader | 24 KiB |
| App 1 – Z-Wave | 248 KiB |
| OTA Slot 0 | 240 KiB |
| App 2 – BLE | 256 KiB |
| SMP Page 1 | 8 KiB |
| SMP Page 2 | 8 KiB |
| Uncommitted | ~240 KiB (on 1 MiB ZG28) |
| End of Flash | — |
Instructions#
Execute the following instructions on the command-line with SLC:
Set up the Workspace and Project#
Step 1: Set up the SLC#
Set up SLC. For instructions, see SLC.
Step 2: Set up the the workspace#
Create a folder for the SLC solution.
Open the folder in your preferred editor.
Copy the .slcw of the Switch On/Off application from
<SiSDK_path>\zwave-sample-app\workspaces\zwave_soc_switch_on_off_ota.slcw(henceforth referred to as smp.slcw)Place the file into your working directory.
Step 3: Edit the project file#
In the
smp.slcwfile, replace all SDK paths to use/instead of\.Add the
bt_soc_app_ota_dfuproject's path as a new entry. For example:- path: <SiSDK_path>/bluetooth_le_app/example/bt_soc_app_ota_dfu/bt_soc_app_ota_dfu.slcp id: ble_app output: ble_app
Step 4: Generate the project#
Run the following command:
slc-cli.exe generate --new-project --workspace=smp.slcw --with=brd4401c --sdk-package-path=<SiSDK_path> --destination=.\sln --output-type=cmake --toolchain=llvmIf you encounter errors such as:
Problems generating template files from component: %extension-silabs.simplicity_sdk%agents_md - Potential jar issue: python script did not properly register a template generatorreinstall python:
i. `slt uninstall --force python` ii. `slt install python`.
Ensure the
--new projectflag is used to copy .slcp files to the solution correctly.
Configure the Applications#
Step 1: Update the BLE application#
Open the BLE project's .slcp file.
Add the following template_contribution to place it at the correct flash address:
template_contribution: - name: memory_flash_start value: 0x08080000 - name: memory_flash_size value: 0x40000Add the following to app.c:
The necessary includes:
#include "btl_smp_switch_flash_api.h" #include "btl_smp_switch_record.h" #include "em_device.h"
Update the OTA event handler:
In the event handler function 'app_ota_dfu_on_status_change', extend the
SL_BT_APP_OTA_DFU_WAIT_FOR_REBOOTcase with a request reboot to Z-Wave app on successful OTA:case SL_BT_APP_OTA_DFU_WAIT_FOR_REBOOT: if (btl_smp_switch_request_next_boot_app((uint8_t)BTL_SMP_APP_ID_1)) { sl_bt_app_ota_dfu_reboot(); } // <Existing code> break;Optionally, you can extend the button handlers with similar functionality.
For that, add the following code at the end of the handler of BTN0 events in
sl_on_button_changeas follows:if (app_ota_dfu_status == SL_BT_APP_OTA_DFU_ERROR) // <Existing code> } else if (app_ota_dfu_status == SL_BT_APP_OTA_DFU_WAIT_FOR_REBOOT) { if (btl_smp_switch_request_next_boot_app((uint8_t)BTL_SMP_APP_ID_1)) { app_log_info("SMP: next boot Z-Wave; rebooting." APP_LOG_NL); sl_bt_app_ota_dfu_reboot(); } }
Regenerate the project:
slc generate -p "c:\w\b\smp\sln\ble_app\bt_soc_app_ota_dfu.slcp" -d "c:\w\b\smp\sln\ble_app" -s <SiSDK_path> -o cmake -tlcn llvm
Step 2: Update the Z-Wave app#
Add a mechanism to switch to the BLE application. This can be implemented in several ways, such as a CLI command or a button handler.
To implement switching apps via medium press of BTN0, extend app_btn_hander.c:
i. Add the necessary includes:
#include "btl_smp_switch_flash_api.h" #include "btl_smp_switch_record.h" #include "em_device.h"ii. Handle medium length press for BTN0 – in app_button_press_btn_0_handler, add:
case APP_BUTTON_PRESS_DURATION_MEDIUM: if (btl_smp_switch_request_next_boot_app((uint8_t)BTL_SMP_APP_ID_2)) { NVIC_SystemReset(); } break;Optionally, add this code to the ApplicationTask function in app.c to see at a glance the software version for testing the OTA upgrade:
#include "zw_version_config.h" ... ZPAL_LOG_INFO( ZPAL_LOG_APP, "Z-Wave application image version: %u.%u.%u\n", (unsigned)APP_VERSION, (unsigned)APP_REVISION, (unsigned)APP_PATCH);Change the size of the OTA image's slot by editing config/sl_storage_config.h:
#define ZW_BTL_STORAGE_SIZE_RELEASE 0x3C000
Configure the Bootloader#
Add the bootloader_smp_switch component to the bootloader's .slcp:
slc modify project -p .\sln\bootloader\bootloader-storage-internal-single-zwave-ota.slcp --with=bootloader_smp_switch --sdk-package-path=<SiSDK_path>Regenerate the project
slc generate -p "C:\w\b\smp\sln\bootloader\bootloader-storage-internal-single-zwave-ota.slcp" -d "C:\w\b\smp\sln\bootloader" -s <SiSDK_path> -o cmake -tlcn llvmEdit config/btl_smp_cfg.h to declare where the SMP switch component's non-volatile memory is placed:
#define BTL_SMP_PAGE_1_BASE 0x080C0000 #define BTL_SMP_PAGE_2_BASE 0x080C2000 #define BTL_SMP_APP_2_BASE 0x08080000Change the address & size of the OTA image's slot by editing config/btl_storage_slot_cfg.h:
#define SLOT0_START 0x8044000 #define SLOT0_SIZE 0x3C000
Build the Complete Solution#
Step 1: Update the solution file#
Open the top-level file
.slpbfile in the generated solution.Locate the 'steps' key and replace it with the following:
steps: - task: "convert" output: "artifacts/smp.s37" input: - "{{bootloader_binary_s37}}" - "{{application_binary_s37}}" # Z-Wave app - "{{application_binary}}" # BLE app - task: "copy" # For OTA update output: "artifacts/smp-zwave.gbl" input: "{{application_binary_gbl}}"
Step 2: Build the workspace#
Go to the
cmake_llvmdirectory.Run the following command:
cmake --workflow --preset project
Program and Test the Device#
Step 1: Flash the device#
Erase the device, then write the keys and the firmware.
WARNING: Be sure to use the same keys that were used to create the
.gblfile. By default, these are the ones included in the SDK at:<SiSDK_path>\zwave_sample_app\sample-keys.The sample keys should not be used in production!
commander device masserase -s <serial_number> commander flash -s <serial_number> --tokengroup znet --tokenfile <SiSDK_path>\zwave_sample_app\sample-keys\sample_encrypt.key --tokenfile <SiSDK_path>zwave_sample_app\sample-keys\sample_sign.key-tokens.txt commander flash -s <serial_number> .\sln\artifacts\smp.s37
Step 2: Create a .gbl file to test OTA DFU functionality#
Modify the application version of the Z-Wave app. Open the
config/zw_version_config.hfile and change the values to:#define USE_USER_APP_VERSION 1 #define USER_APP_VERSION 255Run the workspace build command again.
cmake --workflow --preset project
Step 3: Test the software#
Optionally, include the device in a Z-Wave network.
It's recommended to connect to the serial output of the app to see system messages and upgrade progress.
Switch to the BLE application (for example, by using a medium press of BTN0). For more information, see Step 7.
Perform the OTA upgrade over BLE – push the
.gblfile to the device and wait for it to install the upgrade.Using the Simplicity Connect app – refer to this guide
Using the Bluetooth - Host OTA DFU application with a second device running the Bluetooth NCP app – refer to the host app project's README
If the upgrade succeeds, the device should reboot to the Z-Wave application.
At this point, you can verify the Z-Wave application version reported by the device.