Skip to content

Commit

Permalink
silabs-multiprotocol: Update to Gecko SDK v4.4.0 (#3370)
Browse files Browse the repository at this point in the history
* Use Gecko SDK 4.4.0

Add work around to provide missing Silicon Labs component "defines"
zigbee_use_release_libraries and a second architecture specific define
"x86-64", "arm64v8" or "arm32v7".

Also fix linker warnings and add pthread which seems to be required by
libcpc.

* Update and remove OTBR patches

Remove the patches already upstream.

* Address hdolint issue

* Fix stray whitespace

* Use correct indentation for alternate build arches

* Make sure OpenThread builds

* Bump flasher

* Bump firmwares

* Bump addon version

* Add hadolint ignore

* Update CHANGELOG.md

* use working reset flag

* Revert "use working reset flag"

This reverts commit f176f7c.

* Move bootloader reset flag to right place

---------

Co-authored-by: puddly <[email protected]>
  • Loading branch information
agners and puddly authored Jan 5, 2024
1 parent 7a81757 commit 07104ea
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 1,226 deletions.
7 changes: 7 additions & 0 deletions silabs-multiprotocol/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2.4.0

- Use Silicon Labs Gecko SDK 4.4.0
- Bump universal SiLabs flasher to 0.0.16
- Improved firmware configurations for Home Assistant Yellow and SkyConnect
for stability (without ZGP, with watchdog)

## 2.3.2

- Update mDNSResponder to 1790.80.10
Expand Down
33 changes: 23 additions & 10 deletions silabs-multiprotocol/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ RUN \
FROM --platform=linux/amd64 cross-builder-${BUILD_ARCH} AS zigbeed-builder

ARG GECKO_SDK_VERSION
ARG BUILD_ARCH

RUN \
set -x \
Expand All @@ -102,7 +103,7 @@ RUN \
&& curl -O https://www.silabs.com/documents/login/software/slc_cli_linux.zip \
&& unzip slc_cli_linux.zip \
&& cd slc_cli/ && chmod +x slc

ENV PATH="/usr/src/slc_cli/:$PATH"

RUN \
Expand All @@ -115,12 +116,22 @@ COPY --from=cpcd-builder /usr/local/ /usr/${DEBIAN_CROSS_PREFIX}/
COPY gecko-sdk-patches/0001-Use-TCP-socket-instead-of-serial-port-SDK.patch /usr/src
COPY zigbeed-app-patches/0001-Use-TCP-socket-instead-of-serial-port-main-app.patch /usr/src

# hadolint ignore=SC3037,SC2039
RUN \
set -x \
&& cd gecko_sdk \
&& patch -p1 < /usr/src/0001-Use-TCP-socket-instead-of-serial-port-SDK.patch \
&& GECKO_SDK=$(pwd) \
&& slc signature trust --sdk=${GECKO_SDK} \
&& if [ "${BUILD_ARCH}" = "armv7" ]; then \
/bin/echo -e "\nprovides:\n - name: zigbee_use_release_libraries\n - name: arm32v7\n" >> protocol/zigbee/app/zigbeed/zigbeed.slcp; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then \
/bin/echo -e "\nprovides:\n - name: zigbee_use_release_libraries\n" >> protocol/zigbee/app/zigbeed/zigbeed.slcp; \
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
/bin/echo -e "\nprovides:\n - name: zigbee_use_release_libraries\n - name: arm64v8\n" >> protocol/zigbee/app/zigbeed/zigbeed.slcp; \
else \
exit 1; \
fi \
&& cd protocol/zigbee \
&& slc generate \
--sdk=${GECKO_SDK} \
Expand All @@ -136,6 +147,8 @@ RUN \
LD="${DEBIAN_CROSS_PREFIX}-gcc" \
CXX="${DEBIAN_CROSS_PREFIX}-g++" \
C_FLAGS="-std=gnu99 -DEMBER_MULTICAST_TABLE_SIZE=16" \
LD_FLAGS="" \
GROUP_START="-Wl,--start-group" GROUP_END="-Wl,--end-group -lpthread" \
debug

FROM $BUILD_FROM
Expand Down Expand Up @@ -166,10 +179,10 @@ ENV WEB_GUI=1
ENV DOCKER 1

COPY otbr-patches/0001-Avoid-writing-to-system-console.patch /usr/src
COPY otbr-patches/0001-rest-support-erasing-all-persistent-info-1908.patch /usr/src
COPY otbr-patches/0002-rest-support-deleting-the-dataset.patch /usr/src
COPY otbr-patches/0003-mdns-update-mDNSResponder-to-1790.80.10.patch /usr/src
COPY otbr-patches/0004-mdns-add-Linux-specific-patches.patch /usr/src

# OTBR accesses the CPC Daemon build directory
COPY --from=cpcd-builder /usr/src/cpc-daemon /usr/src/gecko_sdk/platform/service/cpc/daemon

# Required and installed during build (script/bootstrap), could be removed
ENV OTBR_BUILD_DEPS build-essential ninja-build cmake wget ca-certificates \
Expand Down Expand Up @@ -197,12 +210,10 @@ RUN \
lsb-release \
netcat \
sudo \
libmbedtls-dev \
&& cd ot-br-posix \
&& patch -p1 < /usr/src/0001-Avoid-writing-to-system-console.patch \
&& patch -p1 < /usr/src/0001-rest-support-erasing-all-persistent-info-1908.patch \
&& patch -p1 < /usr/src/0002-rest-support-deleting-the-dataset.patch \
&& patch -p1 < /usr/src/0003-mdns-update-mDNSResponder-to-1790.80.10.patch \
&& patch -p1 < /usr/src/0004-mdns-add-Linux-specific-patches.patch \
&& ln -s ../../../openthread/ third_party/openthread/repo \
&& (cd third_party/openthread/repo \
&& ln -s ../../../../silabs-vendor-interface/openthread-core-silabs-posix-config.h src/posix/platform/openthread-core-silabs-posix-config.h) \
Expand All @@ -223,11 +234,13 @@ RUN \
-DOTBR_VERSION= \
-DOT_PACKAGE_VERSION= \
-DOTBR_DBUS=OFF \
-DOT_THREAD_VERSION=1.3 \
-DOT_MULTIPAN_RCP=ON \
-DOT_POSIX_CONFIG_RCP_BUS=VENDOR \
-DOT_POSIX_CONFIG_RCP_VENDOR_DEPS_PACKAGE=SilabsRcpDeps \
-DCPCD_SOURCE_DIR=/usr/src/gecko_sdk/platform/service/cpc/daemon \
-DOT_POSIX_RCP_VENDOR_BUS=ON \
-DOT_POSIX_CONFIG_RCP_VENDOR_DEPS_PACKAGE=/usr/src/silabs-vendor-interface/posix_vendor_rcp.cmake \
-DOT_POSIX_CONFIG_RCP_VENDOR_INTERFACE=/usr/src/silabs-vendor-interface/cpc_interface.cpp \
-DOT_CONFIG="openthread-core-silabs-posix-config.h" \
-DOT_PLATFORM_CONFIG="openthread-core-silabs-posix-config.h" \
-DOT_LINK_RAW=1 \
-DOTBR_VENDOR_NAME="Home Assistant" \
-DOTBR_PRODUCT_NAME="Silicon Labs Multiprotocol" \
Expand Down
6 changes: 3 additions & 3 deletions silabs-multiprotocol/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ build_from:
armv7: ghcr.io/home-assistant/armv7-base-debian:bullseye
amd64: ghcr.io/home-assistant/amd64-base-debian:bullseye
args:
CPCD_VERSION: v4.3.1
GECKO_SDK_VERSION: v4.3.1
UNIVERSAL_SILABS_FLASHER: 0.0.13
CPCD_VERSION: v4.4.0
GECKO_SDK_VERSION: v4.4.0
UNIVERSAL_SILABS_FLASHER: 0.0.16
2 changes: 1 addition & 1 deletion silabs-multiprotocol/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 2.3.2
version: 2.4.0
slug: silabs_multiprotocol
name: Silicon Labs Multiprotocol
description: Zigbee and OpenThread multiprotocol add-on
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
From 53d4be5c893dac04a909563444453fb471852ccc Mon Sep 17 00:00:00 2001
Message-Id: <53d4be5c893dac04a909563444453fb471852ccc.1677692173[email protected]>
From e0792b7605e6d6cb2ebd491025aee7f84d1edbaa Mon Sep 17 00:00:00 2001
Message-ID: <e0792b7605e6d6cb2ebd491025aee7f84d1edbaa.1692864566[email protected]>
From: Stefan Agner <[email protected]>
Date: Thu, 17 Feb 2022 22:57:16 +0100
Subject: [PATCH] Avoid writing to system console
Expand All @@ -13,18 +13,18 @@ stderr.
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/logging.cpp b/src/common/logging.cpp
index 5398e47133..69f150dadb 100644
index 5a787e8213..79fccf77ca 100644
--- a/src/common/logging.cpp
+++ b/src/common/logging.cpp
@@ -83,7 +83,7 @@ void otbrLogInit(const char *aIdent, otbrLogLevel aLevel, bool aPrintStderr)
assert(aIdent);
assert(aLevel >= OTBR_LOG_EMERG && aLevel <= OTBR_LOG_DEBUG);
@@ -88,7 +88,7 @@ void otbrLogInit(const char *aProgramName, otbrLogLevel aLevel, bool aPrintStder
ident = strrchr(aProgramName, '/');
ident = (ident != nullptr) ? ident + 1 : aProgramName;

- openlog(aIdent, (LOG_CONS | LOG_PID) | (aPrintStderr ? LOG_PERROR : 0), OTBR_SYSLOG_FACILITY_ID);
+ openlog(aIdent, LOG_PID | (aPrintStderr ? LOG_PERROR : 0), LOG_USER);
- openlog(ident, (LOG_CONS | LOG_PID) | (aPrintStderr ? LOG_PERROR : 0), OTBR_SYSLOG_FACILITY_ID);
+ openlog(ident, LOG_PID | (aPrintStderr ? LOG_PERROR : 0), OTBR_SYSLOG_FACILITY_ID);
sLevel = aLevel;
sDefaultLevel = sLevel;
}
--
2.39.1
2.42.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ab31af226c8d4ad1f46d03616e68a80f2a04a35e Mon Sep 17 00:00:00 2001
Message-ID: <ab31af226c8d4ad1f46d03616e68a80f2a04a35e.1691047014[email protected]>
In-Reply-To: <29c0b6b142c6692a53a83fb4604fc2bcebeb17af.1691047014[email protected]>
References: <29c0b6b142c6692a53a83fb4604fc2bcebeb17af.1691047014[email protected]>
From 2c0c78e5f4dc85a63934fc0c32c035a9c5b5babd Mon Sep 17 00:00:00 2001
Message-ID: <2c0c78e5f4dc85a63934fc0c32c035a9c5b5babd.1692864566[email protected]>
In-Reply-To: <e0792b7605e6d6cb2ebd491025aee7f84d1edbaa.1692864566[email protected]>
References: <e0792b7605e6d6cb2ebd491025aee7f84d1edbaa.1692864566[email protected]>
From: Stefan Agner <[email protected]>
Date: Mon, 5 Jun 2023 23:41:50 +0200
Subject: [PATCH] [rest] support deleting the dataset
Expand Down Expand Up @@ -122,5 +122,5 @@ index d79085dbfc..362e501471 100644
void DeleteOutDatedDiagnostic(void);
void UpdateDiag(std::string aKey, std::vector<otNetworkDiagTlv> &aDiag);
--
2.41.0
2.42.0

This file was deleted.

Loading

0 comments on commit 07104ea

Please sign in to comment.