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 Jul 26, 2024
1 parent dac5f7f commit 1ee19a2
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ot-commissioner
Submodule ot-commissioner updated 145 files
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 @@ -275,21 +285,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"
)
Expand All @@ -102,7 +109,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 @@ -111,7 +118,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 @@ -123,7 +130,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 @@ -132,19 +139,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 @@ -153,7 +160,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 @@ -191,7 +198,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 1ee19a2

Please sign in to comment.