From 44e724feed1dc285da739a90308c7173eb73d9d9 Mon Sep 17 00:00:00 2001 From: Suvesh Pratapa Date: Mon, 22 Jul 2024 11:51:09 -0400 Subject: [PATCH] * Support Thread 1.4 reference builds * Update ot-commissioner to latest --- .github/workflows/build.yml | 6 +++--- script/make-firmware.bash | 41 +++++++++++++++++++++++++++++-------- script/make-raspbian.bash | 2 +- script/otbr-setup.bash | 37 +++++++++++++++++++-------------- 4 files changed, 59 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03fcb03..e46524d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,16 +59,16 @@ jobs: - name: Build nrf52840 reference release for 1.3 run: | REFERENCE_PLATFORM=nrf52840 REFERENCE_RELEASE_TYPE=1.3 ./script/make-reference-release.bash - - name: Build ncs reference release for 1.3.1 + - name: Build ncs reference release for 1.4 run: | git submodule status export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb export GNUARMEMB_TOOLCHAIN_PATH=/tmp/gcc-arm-none-eabi-9-2019-q4-major/ - REFERENCE_PLATFORM=ncs REFERENCE_RELEASE_TYPE=1.3.1 ./script/make-reference-release.bash + REFERENCE_PLATFORM=ncs REFERENCE_RELEASE_TYPE=1.4 ./script/make-reference-release.bash - uses: actions/upload-artifact@v3 with: name: reference-releases path: | - build/ot-1.3.1* + build/ot-1.4* retention-days: 1 if-no-files-found: error diff --git a/script/make-firmware.bash b/script/make-firmware.bash index c3e8d38..235350e 100755 --- a/script/make-firmware.bash +++ b/script/make-firmware.bash @@ -44,7 +44,8 @@ build_dir="" build_script_flags=() NRFUTIL="" -readonly build_1_3_options_common=( +readonly build_1_4_options_common=( + "-DOT_THREAD_VERSION=1.4" "-DOT_SRP_SERVER=ON" "-DOT_ECDSA=ON" "-DOT_SERVICE=ON" @@ -52,10 +53,19 @@ readonly build_1_3_options_common=( "-DOT_SRP_CLIENT=ON" ) -readonly build_1_3_options_efr32=( +readonly build_1_4_options_nrf=( "" ) +readonly build_1_3_options_common=( + "-DOT_THREAD_VERSION=1.3" + "-DOT_SRP_SERVER=ON" + "-DOT_ECDSA=ON" + "-DOT_SERVICE=ON" + "-DOT_DNSSD_SERVER=ON" + "-DOT_SRP_CLIENT=ON" +) + readonly build_1_3_options_nrf=( "" ) @@ -174,8 +184,8 @@ build_ot() mkdir -p "$OUTPUT_ROOT" case "${thread_version}" in - "1.2") - # Build OpenThread 1.2 + "1.2"|"1.3"|"1.4") + # Build OpenThread 1.2 or 1.3 or 1.4 cd "${platform_repo}" git clean -xfd @@ -278,7 +288,7 @@ build() thread_version=1.1 build_type="USB_trans" build_ot "${build_1_1_env[@]}" "$@" ;; esac - elif [ "${REFERENCE_RELEASE_TYPE}" = "1.3" ] || [ "${REFERENCE_RELEASE_TYPE}" = "1.3.1" ]; then + elif [ "${REFERENCE_RELEASE_TYPE}" = "1.3" ]; then options=("${build_1_3_options_common[@]}") case "${platform}" in @@ -286,13 +296,28 @@ build() options+=("${build_1_3_options_nrf[@]}") platform_repo=ot-nrf528xx - thread_version=1.2 build_type="USB_trans" build_ot "${options[@]}" "$@" + thread_version=1.3 build_type="USB_trans" build_ot "${options[@]}" "$@" + ;; + efr32mg12) + platform_repo=ot-efr32 + build_script_flags=("--skip-silabs-apps") + thread_version=1.3 build_ot "-DBOARD=brd4166a" "${options[@]}" "$@" + ;; + esac + elif [ "${REFERENCE_RELEASE_TYPE}" = "1.4" ]; then + options=("${build_1_4_options_common[@]}") + + case "${platform}" in + nrf*) + options+=("${build_1_4_options_nrf[@]}") + platform_repo=ot-nrf528xx + + thread_version=1.4 build_type="USB_trans" build_ot "${options[@]}" "$@" ;; efr32mg12) - options+=("${build_1_3_options_efr32[@]}") platform_repo=ot-efr32 build_script_flags=("--skip-silabs-apps") - thread_version=1.2 build_ot "-DBOARD=brd4166a" "${options[@]}" "$@" + thread_version=1.4 build_ot "-DBOARD=brd4166a" "${options[@]}" "$@" ;; esac else diff --git a/script/make-raspbian.bash b/script/make-raspbian.bash index 575de69..3aa7170 100755 --- a/script/make-raspbian.bash +++ b/script/make-raspbian.bash @@ -45,7 +45,7 @@ echo "OTBR_RCP_BUS=${OTBR_RCP_BUS:=UART}" echo "REFERENCE_PLATFORM=${REFERENCE_PLATFORM?}" echo "OTBR_RADIO_URL=${OTBR_RADIO_URL:=spinel+hdlc+uart:///dev/ttyACM0}" -if [ "$REFERENCE_RELEASE_TYPE" != "1.2" ] && [ "$REFERENCE_RELEASE_TYPE" != "1.3" ] && [ "$REFERENCE_RELEASE_TYPE" != "1.3.1" ]; then +if [ "$REFERENCE_RELEASE_TYPE" != "1.2" ] && [ "$REFERENCE_RELEASE_TYPE" != "1.3" ] && [ "$REFERENCE_RELEASE_TYPE" != "1.4" ]; then echo "Invalid reference release type: $REFERENCE_RELEASE_TYPE" exit 1 fi diff --git a/script/otbr-setup.bash b/script/otbr-setup.bash index e8687f5..e2a7d2e 100755 --- a/script/otbr-setup.bash +++ b/script/otbr-setup.bash @@ -51,6 +51,7 @@ readonly OTBR_COMMON_OPTIONS=( ) readonly OTBR_THREAD_1_2_OPTIONS=( + ${OTBR_COMMON_OPTIONS[@]} "-DOT_THREAD_VERSION=1.2" "-DOTBR_DUA_ROUTING=ON" "-DOT_DUA=ON" @@ -60,8 +61,9 @@ readonly OTBR_THREAD_1_2_OPTIONS=( "-DOTBR_TREL=OFF" ) -readonly OTBR_THREAD_1_3_COMMON_OPTIONS=( +readonly OTBR_THREAD_1_3_OPTIONS=( ${OTBR_COMMON_OPTIONS[@]} + "-DOT_THREAD_VERSION=1.3" "-DOTBR_DUA_ROUTING=ON" "-DOT_DUA=ON" "-DOT_MLR=ON" @@ -70,16 +72,21 @@ readonly OTBR_THREAD_1_3_COMMON_OPTIONS=( "-DOT_BORDER_ROUTING=ON" "-DOT_SRP_CLIENT=ON" "-DOT_DNS_CLIENT=ON" -) - -readonly OTBR_THREAD_1_3_OPTIONS=( - "-DOT_THREAD_VERSION=1.3" "-DOTBR_TREL=OFF" "-DOTBR_NAT64=OFF" ) -readonly OTBR_THREAD_1_3_1_OPTIONS=( - "-DOT_THREAD_VERSION=1.3.1" +readonly OTBR_THREAD_1_4_OPTIONS=( + ${OTBR_COMMON_OPTIONS[@]} + "-DOT_THREAD_VERSION=1.4" + "-DOTBR_DUA_ROUTING=ON" + "-DOT_DUA=ON" + "-DOT_MLR=ON" + "-DOTBR_DNSSD_DISCOVERY_PROXY=ON" + "-DOTBR_SRP_ADVERTISING_PROXY=ON" + "-DOT_BORDER_ROUTING=ON" + "-DOT_SRP_CLIENT=ON" + "-DOT_DNS_CLIENT=ON" "-DOTBR_TREL=ON" "-DOTBR_NAT64=ON" "-DOTBR_BORDER_ROUTING_DHCP6_PD=ON" @@ -103,7 +110,7 @@ if [ "${REFERENCE_RELEASE_TYPE?}" = "1.2" ]; then 'BORDER_ROUTING=0' 'NAT64=0' 'DNS64=0' - "OTBR_OPTIONS=\"${OTBR_THREAD_1_2_OPTIONS[@]} ${OTBR_COMMON_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100 -DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US=5000'\"" + "OTBR_OPTIONS=\"${OTBR_THREAD_1_2_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100 -DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US=5000'\"" ) build_options+=("${LOCAL_OPTIONS[@]}") ;; @@ -112,7 +119,7 @@ if [ "${REFERENCE_RELEASE_TYPE?}" = "1.2" ]; then 'BORDER_ROUTING=0' 'NAT64=0' 'DNS64=0' - "OTBR_OPTIONS=\"${OTBR_THREAD_1_2_OPTIONS[@]} ${OTBR_COMMON_OPTIONS[@]}\"" + "OTBR_OPTIONS=\"${OTBR_THREAD_1_2_OPTIONS[@]}\"" ) build_options+=("${LOCAL_OPTIONS[@]}") ;; @@ -124,7 +131,7 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.3" ]; then 'BORDER_ROUTING=1' 'NAT64=0' 'DNS64=0' - "OTBR_OPTIONS=\"${OTBR_THREAD_1_3_OPTIONS[@]} ${OTBR_THREAD_1_3_COMMON_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100 -DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US=5000'\"" + "OTBR_OPTIONS=\"${OTBR_THREAD_1_3_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100 -DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US=5000'\"" ) build_options+=("${LOCAL_OPTIONS[@]}") ;; @@ -133,19 +140,19 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.3" ]; then 'BORDER_ROUTING=1' 'NAT64=0' 'DNS64=0' - "OTBR_OPTIONS=\"${OTBR_THREAD_1_3_OPTIONS[@]} ${OTBR_THREAD_1_3_COMMON_OPTIONS[@]}\"" + "OTBR_OPTIONS=\"${OTBR_THREAD_1_3_OPTIONS[@]}\"" ) build_options+=("${LOCAL_OPTIONS[@]}") ;; esac -elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.3.1" ]; then +elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.4" ]; then case "${REFERENCE_PLATFORM}" in efr32mg12) readonly LOCAL_OPTIONS=( 'BORDER_ROUTING=1' 'NAT64=1' 'DNS64=1' - "OTBR_OPTIONS=\"${OTBR_THREAD_1_3_1_OPTIONS[@]} ${OTBR_THREAD_1_3_COMMON_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100\"" + "OTBR_OPTIONS=\"${OTBR_THREAD_1_4_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100 -DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US=5000'\"" ) build_options+=("${LOCAL_OPTIONS[@]}") ;; @@ -154,7 +161,7 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.3.1" ]; then 'BORDER_ROUTING=1' 'NAT64=1' 'DNS64=1' - "OTBR_OPTIONS=\"${OTBR_THREAD_1_3_1_OPTIONS[@]} ${OTBR_THREAD_1_3_COMMON_OPTIONS[@]}\"" + "OTBR_OPTIONS=\"${OTBR_THREAD_1_4_OPTIONS[@]}\"" ) build_options+=("${LOCAL_OPTIONS[@]}") ;; @@ -190,7 +197,7 @@ pip3 install zeroconf su -c "${build_options[*]} script/setup" pi -if [ "$REFERENCE_RELEASE_TYPE" = "1.2" ]; then +if [[ "$REFERENCE_RELEASE_TYPE" = "1.2" || "$REFERENCE_RELEASE_TYPE" = "1.3" || "$REFERENCE_RELEASE_TYPE" = "1.4" ]]; then cd /home/pi/repo/ ./script/make-commissioner.bash fi