Skip to content

Commit

Permalink
[sdk] update to GSDK 4.4.0 (#756)
Browse files Browse the repository at this point in the history
This updates the repo to work with the [Gecko SDK
v4.4.0](https://github.com/SiliconLabs/gecko_sdk/releases/tag/v4.4.0)
release

---

# Other changes

- Update scripts to install ARM GNU Toolchain 12
  - `arm-none-eabi-gcc 12` is a requirement of GSDK v4.4.0
  - Removed older toolchains from `Build` workflow
- Add ot_stack_features_config component to ot-efr32 extension
  - This adds a new component that generates a config file for
    `SL_OPENTHREAD_STACK_FEATURES_CONFIG_FILE`
  - This is essentially a copy of the ot_stack_ftd/mtd/rcp components
    except it doesn't define a `OPENTHREAD_<DEVICE_TYPE>` macro
    https://github.com/SiliconLabs/gecko_sdk/blob/124fa19de8c8b3961d21c20857f7df32239786da/protocol/openthread/component/ot_stack_ftd.slcc#L21-L26
  - The component also uses the [validation
    script](https://github.com/SiliconLabs/gecko_sdk/blob/gsdk_4.4/protocol/openthread/component/script/ot_log_validation.lua)
    to ensure
    [`ot_rtt_log`](https://github.com/SiliconLabs/gecko_sdk/blob/gsdk_4.4/protocol/openthread/component/ot_rtt_log.slcc)
    is in a project if the `OPENTHREAD_CONFIG_LOG_OUTPUT` is set to
    `OPENTHREAD_CONFIG_LOG_PLATFORM_DEFINED`
- Update the `openthread` submodule to the head of `main`
  • Loading branch information
lmnotran authored Dec 26, 2023
1 parent fc3d5ea commit 89c6a08
Show file tree
Hide file tree
Showing 30 changed files with 717 additions and 211 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ jobs:
fail-fast: false
matrix:
include:
- gcc_ver: 6
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-6-2017-q2-update
- gcc_ver: 7
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-7-2018-q2-update
- gcc_ver: 9
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-9-2019-q4-major
- gcc_ver: 10.3
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-10.3-2021.10
- gcc_ver: 12.2.Rel1
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
gcc_extract_dir: arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi
- gcc_ver: 12.3.Rel1
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz
gcc_extract_dir: arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi

steps:
- uses: actions/checkout@v4
Expand All @@ -83,13 +77,12 @@ jobs:

- name: Bootstrap
run: |
cd /tmp
wget --tries 4 --no-check-certificate --quiet ${{ matrix.gcc_download_url }} -O gcc-arm.tar.bz2
tar xjf gcc-arm.tar.bz2
script/bootstrap packages
script/bootstrap arm_toolchain ${{ matrix.gcc_download_url }} ${{ matrix.gcc_extract_dir }}
- name: Build
run: |
export PATH=/tmp/${{ matrix.gcc_extract_dir }}/bin:$PATH
export PATH=${HOME}/.local/${{ matrix.gcc_extract_dir }}/bin:$PATH
script/test
- name: Gather SLC generated files
Expand All @@ -107,5 +100,5 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: build-${{ matrix.gcc_ver }}-${{ matrix.os }}
name: build-${{ matrix.gcc_ver }}
path: artifact
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ quality: production

component:
- id: ot_platform_abstraction_core
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: ot_ncp_spidrv
- id: rail_util_pti

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ quality: production

component:
- id: ot_platform_abstraction_core
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ quality: production
component:
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ quality: production
component:
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand Down
2 changes: 1 addition & 1 deletion openthread
Submodule openthread updated 86 files
+3 −0 .github/workflows/build.yml
+1 −1 .github/workflows/docker.yml
+3 −3 .github/workflows/otns.yml
+2 −0 doc/ot_api_doc.h
+2 −0 etc/cmake/options.cmake
+26 −0 include/openthread/border_routing.h
+1 −1 include/openthread/instance.h
+2 −0 include/openthread/ip6.h
+12 −8 include/openthread/platform/crypto.h
+1 −0 script/check-scan-build
+1 −0 script/cmake-build
+47 −0 src/cli/README.md
+1 −1 src/cli/README_SRP.md
+146 −10 src/cli/cli.cpp
+1 −0 src/cli/cli.hpp
+11 −0 src/cli/cli_srp_client.cpp
+5 −0 src/cli/cli_srp_server.cpp
+4 −0 src/cli/cli_tcp.cpp
+7 −0 src/core/api/border_routing_api.cpp
+1 −1 src/core/api/coap_secure_api.cpp
+310 −192 src/core/border_router/routing_manager.cpp
+74 −20 src/core/border_router/routing_manager.hpp
+1 −13 src/core/coap/coap_secure.hpp
+1 −1 src/core/config/dnssd_server.h
+1 −1 src/core/config/srp_client.h
+96 −67 src/core/crypto/crypto_platform.cpp
+4 −7 src/core/meshcop/announce_begin_client.cpp
+6 −6 src/core/meshcop/dataset.cpp
+1 −1 src/core/meshcop/dataset_manager.cpp
+4 −4 src/core/meshcop/dataset_manager_ftd.cpp
+5 −8 src/core/meshcop/energy_scan_client.cpp
+2 −2 src/core/meshcop/meshcop.cpp
+86 −137 src/core/meshcop/meshcop_tlvs.cpp
+68 −205 src/core/meshcop/meshcop_tlvs.hpp
+5 −8 src/core/meshcop/panid_query_client.cpp
+69 −44 src/core/meshcop/secure_transport.cpp
+25 −3 src/core/meshcop/secure_transport.hpp
+16 −3 src/core/net/ip6.cpp
+1 −1 src/core/radio/ble_secure.cpp
+12 −0 src/core/radio/radio.cpp
+75 −18 src/core/radio/radio.hpp
+1 −1 src/core/thread/announce_begin_server.cpp
+23 −10 src/core/thread/discover_scanner.cpp
+1 −1 src/core/thread/discover_scanner.hpp
+7 −10 src/core/thread/energy_scan_server.cpp
+37 −22 src/core/thread/mesh_forwarder.cpp
+2 −1 src/core/thread/mesh_forwarder.hpp
+3 −1 src/core/thread/mesh_forwarder_ftd.cpp
+1 −1 src/core/thread/mesh_forwarder_mtd.cpp
+3 −0 src/core/thread/mle.cpp
+1 −2 src/core/thread/mle_tlvs.cpp
+2 −5 src/core/thread/network_diagnostic.cpp
+5 −8 src/core/thread/panid_query_server.cpp
+2 −2 src/lib/spinel/CMakeLists.txt
+2 −2 src/lib/spinel/example_vendor_hook.cpp
+2 −2 src/lib/spinel/example_vendor_hook.hpp
+13 −3 src/lib/spinel/openthread-spinel-config.h
+1 −1 src/lib/spinel/radio_spinel.cpp
+6 −3 src/lib/spinel/radio_spinel.hpp
+15 −0 src/posix/CMakeLists.txt
+1 −1 src/posix/platform/daemon.cpp
+8 −0 src/posix/platform/include/openthread/openthread-system.h
+3 −3 src/posix/platform/infra_if.cpp
+1 −1 src/posix/platform/multicast_routing.cpp
+24 −24 src/posix/platform/netif.cpp
+2 −0 src/posix/platform/openthread-core-posix-config.h
+0 −34 src/posix/platform/openthread-posix-config.h
+72 −0 src/posix/platform/openthread-posix-daemon-config.h
+0 −8 src/posix/platform/platform-posix.h
+1 −1 src/posix/platform/radio.cpp
+2 −2 src/posix/platform/radio.hpp
+1 −1 src/posix/platform/radio_url.cpp
+14 −1 src/posix/platform/radio_url.hpp
+6 −1 src/posix/platform/udp.cpp
+35 −0 tests/scripts/expect/cli-debug.exp
+14 −14 tests/scripts/thread-cert/border_router/nat64/test_multi_border_routers.py
+16 −16 tests/scripts/thread-cert/border_router/nat64/test_single_border_router.py
+15 −15 tests/scripts/thread-cert/border_router/nat64/test_with_infrastructure_prefix.py
+8 −8 tests/scripts/thread-cert/border_router/test_multi_border_routers.py
+4 −4 tests/scripts/thread-cert/border_router/test_multi_thread_networks.py
+5 −5 tests/scripts/thread-cert/border_router/test_on_link_prefix.py
+2 −0 tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py
+4 −4 tests/scripts/thread-cert/border_router/test_radvd_coexist.py
+12 −12 tests/scripts/thread-cert/border_router/test_single_border_router.py
+12 −12 tests/scripts/thread-cert/node.py
+35 −5 tests/unit/test_routing_manager.cpp
4 changes: 2 additions & 2 deletions ot-efr32.slce
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
id: ot-efr32
version: 0.0.1
description: "ot-efr32 extension for Gecko SDK Suite"
label: "Silicon Labs Matter"
label: "Silicon Labs OpenThread"
sdk:
id: gecko_sdk
version: 4.2.1
version: 4.4.0
component_path:
- path: slc/component
38 changes: 37 additions & 1 deletion script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ install_packages_apt()
python3-pip \
git-lfs \
unzip \
wget
wget \
xz-utils
}

install_packages_opkg()
Expand Down Expand Up @@ -118,6 +119,38 @@ do_bootstrap_silabs()
echo "Bootstrapping silabs"
"${repo_dir}"/script/bootstrap_silabs
}

install_arm_toolchain()
{
local url=${1-"https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz"}
local extract_dir=${2-"arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi"}

local toolchain_dir="${HOME}/.local"

# Check if the toolchain is already present at the desired location
if command -v "${toolchain_dir}/${extract_dir}/bin/arm-none-eabi-gcc"; then
echo "'arm-none-eabi-gcc' found. Skipping GNU ARM Embedded toolchain install"
"${toolchain_dir}"/"${extract_dir}"/bin/arm-none-eabi-gcc --version
return
fi

echo 'Installing GNU ARM Embedded Toolchain...'

# Download
local tarball=gcc-arm.tar.xz
mkdir -p "${toolchain_dir}/${extract_dir}"
wget --tries 4 --no-check-certificate --quiet "${url}" -O "${toolchain_dir}/${tarball}"

# Extract
tar xf "${toolchain_dir}/${tarball}" --directory "${toolchain_dir}/${extract_dir}" --strip-components=1

# Link
sudo ln -s -f "${toolchain_dir}"/"${extract_dir}"/bin/* /usr/local/bin/

# Cleanup
rm -rf "${toolchain_dir:?}/${tarball:?}"
}

main()
{
if [ $# == 0 ]; then
Expand All @@ -126,6 +159,9 @@ main()
do_bootstrap_silabs
elif [ "$1" == 'packages' ]; then
install_packages
elif [ "$1" == 'arm_toolchain' ]; then
shift 1
install_arm_toolchain "$@"
elif [ "$1" == 'openthread' ]; then
do_bootstrap_openthread
elif [ "$1" == 'python' ]; then
Expand Down
24 changes: 24 additions & 0 deletions slc/component/ot_stack_features_config.slcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
id: ot_stack_features_config
label: Stack Features Config
package: OpenThread
category: OpenThread
quality: production
description: This component provides the OpenThread stack features configuration
provides:
- name: ot_stack_features_config
config_file:
- path: third_party/silabs/gecko_sdk/protocol/openthread/config/sl_openthread_features_config.h
file_id: openthread_features
unless: [ot_reference_device]
- path: third_party/silabs/gecko_sdk/protocol/openthread/config/sl_openthread_reference_device_config.h
file_id: openthread_features
condition: [ot_reference_device]
validation_helper:
- path: third_party/silabs/gecko_sdk/protocol/openthread/component/script/ot_log_validation.lua
define:
- name: SL_OPENTHREAD_STACK_FEATURES_CONFIG_FILE
value: "\"sl_openthread_features_config.h\""
unless: [ot_reference_device]
- name: SL_OPENTHREAD_STACK_FEATURES_CONFIG_FILE
value: "\"sl_openthread_reference_device_config.h\""
condition: [ot_reference_device]
8 changes: 7 additions & 1 deletion src/platform_projects/openthread-efr32-rcp-spi.slcp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ quality: production

component:
- id: ot_platform_abstraction_core
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: ot_ncp_spidrv
- id: rail_util_pti

Expand All @@ -20,3 +22,7 @@ define:
value: 1
- name: OPENTHREAD_RADIO
value: 1

sdk_extension:
- id: ot-efr32
version: 0.0.1
8 changes: 7 additions & 1 deletion src/platform_projects/openthread-efr32-rcp-uart.slcp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ quality: production

component:
- id: ot_platform_abstraction_core
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand All @@ -22,3 +24,7 @@ define:
value: 1
- name: OPENTHREAD_RADIO
value: 1

sdk_extension:
- id: ot-efr32
version: 0.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ quality: production
component:
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand Down Expand Up @@ -53,3 +55,7 @@ configuration:
define:
- name: OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
value: 1

sdk_extension:
- id: ot-efr32
version: 0.0.1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ quality: production
component:
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand Down Expand Up @@ -49,3 +51,7 @@ configuration:
condition: [freertos]
- name: SL_STACK_SIZE
value: 4608

sdk_extension:
- id: ot-efr32
version: 0.0.1
8 changes: 7 additions & 1 deletion src/platform_projects/openthread-efr32-soc-with-buttons.slcp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ quality: production
component:
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand Down Expand Up @@ -48,3 +50,7 @@ configuration:
condition: [freertos]
- name: SL_STACK_SIZE
value: 4608

sdk_extension:
- id: ot-efr32
version: 0.0.1
8 changes: 7 additions & 1 deletion src/platform_projects/openthread-efr32-soc.slcp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ quality: production
component:
- id: ot_platform_abstraction_core
- id: ot_psa_crypto
- id: ot_thirdparty
- id: ot_mbedtls
- id: ot_stack_features_config
from: ot-efr32
- id: uartdrv_usart
instance:
- vcom
Expand All @@ -35,3 +37,7 @@ configuration:
condition: [freertos]
- name: SL_STACK_SIZE
value: 4608

sdk_extension:
- id: ot-efr32
version: 0.0.1
1 change: 1 addition & 0 deletions src/src/alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*
*/

#include <assert.h>
#include <openthread-core-config.h>
#include <openthread-system.h>
#include <stdbool.h>
Expand Down
Loading

0 comments on commit 89c6a08

Please sign in to comment.