[nrf528xx] move to openthread/ot-nrf528xx (#6585)

This commit is contained in:
Jonathan Hui
2021-05-11 16:53:13 -07:00
committed by GitHub
parent a40b42e299
commit 550c2056de
711 changed files with 13 additions and 699632 deletions
-121
View File
@@ -51,124 +51,6 @@ build_cc2538()
make -f examples/Makefile-cc2538 "${options[@]}"
}
build_nrf52811()
{
local options=(
"COAP=1"
"DNS_CLIENT=1"
"LINK_RAW=1"
"MAC_FILTER=1"
"MTD_NETDIAG=1"
)
# UART transport
reset_source
make -f examples/Makefile-nrf52811 "${options[@]}"
# SPI transport for NCP
reset_source
make -f examples/Makefile-nrf52811 "${options[@]}" NCP_SPI=1
# Build without transport (no CLI or NCP applications)
reset_source
make -f examples/Makefile-nrf52811 DISABLE_TRANSPORTS=1
}
build_nrf52833()
{
local options=(
"BORDER_AGENT=1"
"BORDER_ROUTER=1"
"COAP=1"
"COAPS=1"
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"ECDSA=1"
"FULL_LOGS=1"
"IP6_FRAGM=1"
"JOINER=1"
"LINK_RAW=1"
"MAC_FILTER=1"
"MTD_NETDIAG=1"
"PING_SENDER=1"
"SERVICE=1"
"SLAAC=1"
"SNTP_CLIENT=1"
"SRP_CLIENT=1"
"UDP_FORWARD=1"
)
# UART transport
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}"
# USB transport
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}" USB=1
# SPI transport for NCP
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}" NCP_SPI=1
# Build without transport (no CLI or NCP applications)
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}" DISABLE_TRANSPORTS=1
}
build_nrf52840()
{
local options=(
"BORDER_AGENT=1"
"BORDER_ROUTER=1"
"COAP=1"
"COAPS=1"
"COMMISSIONER=1"
"DEBUG=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"ECDSA=1"
"FULL_LOGS=1"
"IP6_FRAGM=1"
"JOINER=1"
"LINK_RAW=1"
"MAC_FILTER=1"
"MTD_NETDIAG=1"
"PING_SENDER=1"
"SERVICE=1"
"SLAAC=1"
"SNTP_CLIENT=1"
"SRP_CLIENT=1"
"UDP_FORWARD=1"
)
# UART transport
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}"
# USB transport with bootloader e.g. to support PCA10059 dongle
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" BOOTLOADER=1 USB=1
# SPI transport for NCP
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" NCP_SPI=1
# Build without transport (no CLI or NCP applications)
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_TRANSPORTS=1
# Software cryptography
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_BUILTIN_MBEDTLS=0
# Software cryptography with threading support
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_BUILTIN_MBEDTLS=0 MBEDTLS_THREADING=1
}
main()
{
./bootstrap
@@ -177,9 +59,6 @@ main()
if [[ $# == 0 ]]; then
build_cc2538
build_nrf52811
build_nrf52833
build_nrf52840
return 0
fi
-28
View File
@@ -59,40 +59,12 @@ build_cc2538()
"$(dirname "$0")"/cmake-build cc2538 "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}" "${options[@]}"
}
build_nrf52811()
{
reset_source
"$(dirname "$0")"/cmake-build nrf52811 "$1" "${OT_COMMON_OPTIONS[@]}"
}
build_nrf52833()
{
reset_source
"$(dirname "$0")"/cmake-build nrf52833 "$1" "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}"
}
build_nrf52840()
{
reset_source
"$(dirname "$0")"/cmake-build nrf52840 "$1" "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}"
}
main()
{
export CPPFLAGS="${CPPFLAGS:-} -DNDEBUG"
if [[ $# == 0 ]]; then
build_cc2538
# UART transport
build_nrf52840 UART_trans
# USB transport with bootloader e.g. to support PCA10059 dongle
build_nrf52840 USB_trans_bl
# SPI transport for NCP
build_nrf52840 SPI_trans_NCP
# Software cryptography
build_nrf52840 soft_crypto
# Software cryptography with threading support
build_nrf52840 soft_crypto_threading
return 0
fi
+1 -89
View File
@@ -42,10 +42,6 @@
#
# script/cmake-build ${platform} -D${option}=OFF
#
# Need to add build type when compilling nrf528xx:
#
# script/cmake-build ${platform} ${nrf_build_type} -D${option}=ON -D${option}=OFF
#
# Compile with the specified ninja build target:
#
# OT_CMAKE_NINJA_TARGET="ot-cli-ftd" script/cmake-build ${platform}
@@ -68,8 +64,7 @@ set -euxo pipefail
OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET:-}
readonly OT_SRCDIR="$(pwd)"
readonly OT_PLATFORMS=(cc2538 nrf52811 nrf52833 nrf52840 simulation posix)
readonly OT_NRF528XX_BUILD_TYPES=(UART_trans USB_trans_bl SPI_trans_NCP soft_crypto soft_crypto_threading)
readonly OT_PLATFORMS=(cc2538 simulation posix)
readonly OT_POSIX_SIM_COMMON_OPTIONS=(
"-DOT_BORDER_AGENT=ON"
"-DOT_BORDER_ROUTER=ON"
@@ -105,33 +100,6 @@ readonly OT_POSIX_SIM_COMMON_OPTIONS=(
"-DOT_RCP_RESTORATION_MAX_COUNT=2"
)
readonly OT_nrf52811_OPTIONS=(
"-DOT_BORDER_ROUTER=ON"
"-DOT_COAP=ON"
"-DOT_DNS_CLIENT=ON"
"-DOT_LINK_RAW=ON"
"-DOT_MAC_FILTER=ON"
"-DOT_MTD_NETDIAG=ON"
)
readonly OT_nrf52833_OPTIONS=(
"-DOT_BORDER_AGENT=ON"
"-DOT_BORDER_ROUTER=ON"
"-DOT_COAP=ON"
"-DOT_COAPS=ON"
"-DOT_ECDSA=ON"
"-DOT_FULL_LOGS=ON"
"-DOT_IP6_FRAGM=ON"
"-DOT_LINK_RAW=ON"
"-DOT_MAC_FILTER=ON"
"-DOT_MTD_NETDIAG=ON"
"-DOT_SERVICE=ON"
"-DOT_SNTP_CLIENT=ON"
"-DOT_UDP_FORWARD=ON"
)
readonly OT_nrf52840_OPTIONS=("${OT_nrf52833_OPTIONS[@]:0}")
die()
{
echo " ** ERROR: Openthread CMake doesn't support platform \"$1\""
@@ -169,13 +137,6 @@ main()
# Check if the platform supports cmake.
echo "${OT_PLATFORMS[@]}" | grep -wq "${platform}" || die "${platform}"
local nrf_build_type=""
if [[ ${platform} == nrf528* ]]; then
nrf_build_type="$2"
echo "${OT_NRF528XX_BUILD_TYPES[@]}" | grep -wq "${nrf_build_type}" || die "${nrf_build_type}"
shift
fi
shift
local local_options=()
local options=(
@@ -198,55 +159,6 @@ main()
cc2538)
options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=MinSizeRel")
;;
nrf52811)
local_options+=("${OT_nrf52811_OPTIONS[@]}" "-DCMAKE_TOOLCHAIN_FILE=examples/platforms/nrf528xx/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=Release")
case "${nrf_build_type}" in
UART_trans)
OT_CMAKE_NINJA_TARGET=("ot-cli-mtd" "ot-ncp-mtd" "ot-rcp")
options+=("${local_options[@]}")
;;
SPI_trans_NCP)
OT_CMAKE_NINJA_TARGET=("ot-ncp-mtd" "ot-rcp")
options+=("${local_options[@]}" "-DOT_NCP_SPI=ON")
;;
esac
;;
nrf52833)
local_options+=("${OT_nrf52833_OPTIONS[@]}" "-DCMAKE_TOOLCHAIN_FILE=examples/platforms/nrf528xx/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=Release")
case "${nrf_build_type}" in
UART_trans)
options+=("${local_options[@]}")
;;
USB_trans_bl)
options+=("${local_options[@]}" "-DOT_USB=ON" "-DOT_BOOTLOADER=USB")
;;
SPI_trans_NCP)
OT_CMAKE_NINJA_TARGET=("ot-ncp-ftd" "ot-ncp-mtd" "ot-rcp")
options+=("${local_options[@]}" "-DOT_NCP_SPI=ON")
;;
esac
;;
nrf52840)
local_options+=("${OT_nrf52840_OPTIONS[@]}" "-DCMAKE_TOOLCHAIN_FILE=examples/platforms/nrf528xx/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=Release")
case "${nrf_build_type}" in
UART_trans)
options+=("${local_options[@]}" "-DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls")
;;
USB_trans_bl)
options+=("${local_options[@]}" "-DOT_USB=ON" "-DOT_BOOTLOADER=USB" "-DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls")
;;
SPI_trans_NCP)
OT_CMAKE_NINJA_TARGET=("ot-ncp-ftd" "ot-ncp-mtd" "ot-rcp")
options+=("${local_options[@]}" "-DOT_NCP_SPI=ON" "-DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls")
;;
soft_crypto)
options+=("${local_options[@]}")
;;
soft_crypto_threading)
options+=("${local_options[@]}" "-DOT_MBEDTLS_THREADING=ON")
;;
esac
;;
*)
options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake")
;;