Skip to content

Commit

Permalink
* Support Thread 1.4 reference builds
Browse files Browse the repository at this point in the history
* Update ot-commissioner to latest
  • Loading branch information
suveshpratapa committed Aug 2, 2024
1 parent 8a28c07 commit ff80b63
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
41 changes: 33 additions & 8 deletions script/make-firmware.bash
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,28 @@ 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"
"-DOT_DNSSD_SERVER=ON"
"-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=(
""
)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -278,21 +288,36 @@ 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
nrf*)
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
Expand Down
2 changes: 1 addition & 1 deletion script/make-raspbian.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 22 additions & 15 deletions script/otbr-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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[@]}")
;;
Expand All @@ -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[@]}")
;;
Expand All @@ -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[@]}")
;;
Expand All @@ -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[@]}")
;;
Expand All @@ -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[@]}")
;;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ff80b63

Please sign in to comment.