Skip to content

Commit

Permalink
Template projects (#82)
Browse files Browse the repository at this point in the history
* Remove `ncp-uart-hw`

* Create `skyconnect_zigbee_ncp`

* Create a `zigbee_ncp` project template

* Make project generation work

* Migrate bootloader next

* Migrate `ot-rcp` to `openthread_rcp`

* Drop multi-PAN

* Drop firmware eraser

* Fix existing manifests for Zigbee, Thread, and bootloader firmwares

* Drop Z-Wave

* Clean up Zigbee firmware config

* Clean up OpenThread configs as well

* Add the `rail_util_rssi` component

* Update the README

* Rename `ot-rcp` to `openthread_rcp`

* Rename `ncp-uart-hw` to `zigbee_ncp`

* Initial commit of zwave firmware

* Z-Wave tweaks

* Upgrade Z-Wave to Simplicity SDK

* Z-Wave tweaks

* Support Simplicity SDK as well

* Add Simplicity SDK to `Dockerfile`

* Adjust URL in Dockerfile

* Drop cproject normalization

* Make the GBL config clearer by specifying the dynamic version keys

* Implement support for the `fw_variant` key

* Bump metadata version
  • Loading branch information
puddly authored Oct 14, 2024
1 parent 170367e commit 55b8d76
Show file tree
Hide file tree
Showing 272 changed files with 2,186 additions and 35,295 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Install SDK extensions
run: |
# XXX: slc-cli does not actually work when the extensions aren't in the SDK!
for sdk in /gecko_sdk_*; do
for sdk in /*_sdk_*; do
slc signature trust --sdk "$sdk"
ln -s $PWD/gecko_sdk_extensions "$sdk"/extension
Expand All @@ -148,7 +148,7 @@ jobs:
# Pass all SDKs as consecutive `--sdk ...` arguments
sdk_args=""
for sdk_dir in /gecko_sdk*; do
for sdk_dir in /*_sdk*; do
sdk_args="$sdk_args --sdk $sdk_dir"
done
Expand Down
9 changes: 0 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
repos:
- repo: local
hooks:
- id: normalize-cproject
name: Normalize Eclipse .cproject files
entry: python tools/normalize_cproject.py
language: system
files: \.cproject$
pass_filenames: true

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
hooks:
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ RUN \
&& tar -C /opt -xf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz \
&& rm arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz

# Simplicity SDK 2024.6.2
RUN \
curl -o simplicity_sdk_2024.6.2.zip -L https://github.com/SiliconLabs/simplicity_sdk/releases/download/v2024.6.2/gecko-sdk.zip \
&& unzip -q -d simplicity_sdk_2024.6.2 simplicity_sdk_2024.6.2.zip \
&& rm simplicity_sdk_2024.6.2.zip

# Gecko SDK 4.4.4
RUN \
curl -o gecko_sdk_4.4.4.zip -L https://github.com/SiliconLabs/gecko_sdk/releases/download/v4.4.4/gecko-sdk.zip \
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ It uses the Silicon Labs Gecko SDK and proprietary Silicon Labs tools such as th
Silicon Labs Configurator (slc) and the Simplicity Commander standalone utility.

## Background
The projects contained within this repository are configured for the BRD4001A dev kit
with a BRD4179B (EFR32MG21) module. This allows base projects to be debugged using
the Simplicity Studio IDE. These base projects are then retargeted for other boards
using manifest files. For example, the [`skyconnect_ncp-uart-hw.yaml`](https://github.com/NabuCasa/silabs-firmware-builder/blob/main/manifests/skyconnect_ncp-uart-hw.yaml)
manifest file retargets the base firmware to the SkyConnect/Connect ZBT-1.
The project templates in this repository are configured and built for specific boards
using manifest files. For example, the [`skyconnect_zigbee_ncp.yaml`](https://github.com/NabuCasa/silabs-firmware-builder/blob/main/manifests/skyconnect_zigbee_ncp.yaml)
manifest file configures the Zigbee firmware for the SkyConnect/Connect ZBT-1.

## Setting up Simplicity Studio (for development)
If you are going to be developing using Simplicity Studio, note that each project can
Expand All @@ -35,11 +33,9 @@ Simplicity Studio SDK management workflow and manually manage SDKs:

Repeat this process for every necessary SDK version.

Base projects can now be built normally.

> [!TIP]
> If you have build issues after switching commits, make sure to delete any
> `gecko_sdk_*` folders from the Simplicity working tree.
> `gecko_sdk_*` and `template` folders from the Simplicity working tree.

## Building with a firmware manifest (for building device firmware)
Command line building requires:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: SkyConnect Bootloader
device: EFR32MG21A020F512IM32
base_project: src/bootloader-uart-xmodem
base_project: src/bootloader
filename: "{manifest_name}_{gecko_bootloader_version}"
sdk: "gecko_sdk:4.4.4"
toolchain: "12.2.1.20221205"

gbl:
fw_type: gecko-bootloader
dynamic: ["gecko_bootloader_version"]
gecko_bootloader_version: dynamic
baudrate: 115200

remove_components:
Expand Down
6 changes: 0 additions & 6 deletions manifests/nabucasa/skyconnect_firmware-eraser.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: SkyConnect OpenThread RCP
device: EFR32MG21A020F512IM32
base_project: src/ot-rcp
base_project: src/openthread_rcp
filename: "{manifest_name}_{ot_rcp_version.split('/')[-1]}_gsdk_{sdk_version}"
sdk: "gecko_sdk:4.4.4"
toolchain: "12.2.1.20221205"

gbl:
fw_type: ot-rcp
dynamic: ["ot_rcp_version"]
fw_type: openthread_rcp
ot_rcp_version: dynamic
baudrate: 460800

configuration:
SL_UARTDRV_USART_VCOM_BAUDRATE: 460800

c_defines:
SL_UARTDRV_USART_VCOM_PERIPHERAL: USART0
SL_UARTDRV_USART_VCOM_PERIPHERAL_NO: 0
SL_UARTDRV_USART_VCOM_BAUDRATE: 460800

SL_UARTDRV_USART_VCOM_TX_PORT: gpioPortA
SL_UARTDRV_USART_VCOM_TX_PIN: 6
Expand Down
32 changes: 0 additions & 32 deletions manifests/nabucasa/skyconnect_rcp-uart-802154.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
name: SkyConnect Zigbee
device: EFR32MG21A020F512IM32
base_project: src/ncp-uart-hw
base_project: src/zigbee_ncp
filename: "{manifest_name}_{ezsp_version}"
sdk: "gecko_sdk:4.4.4"
toolchain: "12.2.1.20221205"

gbl:
fw_type: ncp-uart-hw
dynamic: ["ezsp_version"]
fw_type: zigbee_ncp
ezsp_version: dynamic
baudrate: 115200

configuration:
EMBER_CHILD_TABLE_SIZE: 32

c_defines:
EMBER_APS_UNICAST_MESSAGE_COUNT: 32
EMBER_BINDING_TABLE_SIZE: 32
EMBER_BROADCAST_TABLE_SIZE: 64
EMBER_KEY_TABLE_SIZE: 12
EMBER_MAX_END_DEVICE_CHILDREN: 32
EMBER_PACKET_BUFFER_COUNT: 255
EMBER_SOURCE_ROUTE_TABLE_SIZE: 200

SL_IOSTREAM_USART_VCOM_BAUDRATE: 115200
SL_IOSTREAM_USART_VCOM_FLOW_CONTROL_TYPE: usartHwFlowControlCtsAndRts

c_defines:
SL_IOSTREAM_USART_VCOM_PERIPHERAL: USART0
SL_IOSTREAM_USART_VCOM_PERIPHERAL_NO: 0

Expand Down

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions manifests/nabucasa/slusb001a_zwave_ncp_serial_api_controller.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Yellow Bootloader
device: MGM210PA32JIA
base_project: src/bootloader-uart-xmodem
base_project: src/bootloader
filename: "{manifest_name}_{gecko_bootloader_version}"
sdk: "gecko_sdk:4.4.4"
toolchain: "12.2.1.20221205"

gbl:
fw_type: gecko-bootloader
dynamic: ["gecko_bootloader_version"]
gecko_bootloader_version: dynamic
baudrate: 115200

c_defines:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Yellow OpenThread RCP
device: MGM210PA32JIA
base_project: src/ot-rcp
base_project: src/openthread_rcp
filename: "{manifest_name}_{ot_rcp_version.split('/')[-1]}_gsdk_{sdk_version}"
sdk: "gecko_sdk:4.4.4"
toolchain: "12.2.1.20221205"

gbl:
fw_type: ot-rcp
dynamic: ["ot_rcp_version"]
fw_type: openthread_rcp
ot_rcp_version: dynamic
baudrate: 460800

add_components:
- id: simple_led
instance: [board_activity]

configuration:
SL_UARTDRV_USART_VCOM_BAUDRATE: 460800

c_defines:
SL_UARTDRV_USART_VCOM_PERIPHERAL: USART0
SL_UARTDRV_USART_VCOM_PERIPHERAL_NO: 0
SL_UARTDRV_USART_VCOM_BAUDRATE: 460800

SL_UARTDRV_USART_VCOM_TX_PORT: gpioPortA
SL_UARTDRV_USART_VCOM_TX_PIN: 5
Expand Down
37 changes: 0 additions & 37 deletions manifests/nabucasa/yellow_rcp-uart-802154.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
name: Yellow Zigbee
device: MGM210PA32JIA
base_project: src/ncp-uart-hw
base_project: src/zigbee_ncp
filename: "{manifest_name}_{ezsp_version}"
sdk: "gecko_sdk:4.4.4"
toolchain: "12.2.1.20221205"

gbl:
fw_type: ncp-uart-hw
dynamic: ["ezsp_version"]
fw_type: zigbee_ncp
ezsp_version: dynamic
baudrate: 115200

add_components:
- id: simple_led
instance: [board_activity]

configuration:
EMBER_CHILD_TABLE_SIZE: 32

c_defines:
EMBER_APS_UNICAST_MESSAGE_COUNT: 32
EMBER_BINDING_TABLE_SIZE: 32
EMBER_BROADCAST_TABLE_SIZE: 64
EMBER_KEY_TABLE_SIZE: 12
EMBER_MAX_END_DEVICE_CHILDREN: 32
EMBER_PACKET_BUFFER_COUNT: 255
EMBER_SOURCE_ROUTE_TABLE_SIZE: 200

SL_IOSTREAM_USART_VCOM_BAUDRATE: 115200
SL_IOSTREAM_USART_VCOM_FLOW_CONTROL_TYPE: usartHwFlowControlCtsAndRts

c_defines:
SL_IOSTREAM_USART_VCOM_PERIPHERAL: USART0
SL_IOSTREAM_USART_VCOM_PERIPHERAL: USART0
SL_IOSTREAM_USART_VCOM_PERIPHERAL_NO: 0

SL_IOSTREAM_USART_VCOM_TX_PORT: gpioPortA
Expand Down
28 changes: 28 additions & 0 deletions manifests/nabucasa/zwave_stick.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Z-Wave Stick
device: EFR32ZG23A020F512GM40
base_project: src/zwave_ncp
filename: "{manifest_name}_{zwave_version}"
sdk: "simplicity_sdk:2024.6.2"
toolchain: "12.2.1.20221205"

gbl:
fw_type: zwave_ncp
zwave_version: dynamic
baudrate: 115200
compression: lz4
sign_key: "{SDK_DIR}/protocol/z-wave/platform/SiliconLabs/PAL/BootLoader/controller-keys/controller_sign.key"
encrypt_key: "{SDK_DIR}/protocol/z-wave/platform/SiliconLabs/PAL/BootLoader/controller-keys/controller_encrypt.key"

c_defines:
ZAF_CONFIG_MANUFACTURER_ID: "0x0466"
ZAF_CONFIG_PRODUCT_TYPE_ID: "0x0001"
ZAF_CONFIG_PRODUCT_ID: "0x0001"

SERIAL_API_PERIPHERAL: USART0
SERIAL_API_PERIPHERAL_NO: 0

SERIAL_API_TX_PORT: gpioPortA
SERIAL_API_TX_PIN: 8

SERIAL_API_RX_PORT: gpioPortA
SERIAL_API_RX_PIN: 9
Loading

0 comments on commit 55b8d76

Please sign in to comment.