mirror of
https://github.com/espressif/openthread.git
synced 2026-08-18 00:19:52 +00:00
[efr32] add CMake support (#6302)
This commit adds CMake support for the efr32 platforms and Silicon Labs gecko_sdk_suite. It also adds the option to build the efr32 sleepy-demo apps. Other changes: - jlinkrtt: remove NordicSemi specific options/definitions/includes from default build - Remove old include dirs that don't exist anymore from efr32 automake files
This commit is contained in:
+60
-1
@@ -46,6 +46,17 @@
|
||||
#
|
||||
# script/cmake-build ${platform} ${nrf_build_type} -D${option}=ON -D${option}=OFF
|
||||
#
|
||||
# Need to add BOARD when compiling efr32:
|
||||
#
|
||||
# script/cmake-build ${platform} -DBOARD=${EFR32 board}
|
||||
#
|
||||
# Example:
|
||||
# script/cmake-build efr32mg21 -DBOARD=brd4180b
|
||||
#
|
||||
# To enable dynamic multiprotocol support on efr32:
|
||||
#
|
||||
# script/cmake-build ${platform} -DBOARD=${EFR32 board} -DDMP=ON
|
||||
#
|
||||
# Compile with the specified ninja build target:
|
||||
#
|
||||
# OT_CMAKE_NINJA_TARGET="ot-cli-ftd" script/cmake-build ${platform}
|
||||
@@ -68,7 +79,7 @@ set -euxo pipefail
|
||||
OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET:-}
|
||||
|
||||
readonly OT_SRCDIR="$(pwd)"
|
||||
readonly OT_PLATFORMS=(cc1352 cc2538 cc2650 cc2652 kw41z nrf52811 nrf52833 nrf52840 gp712 qpg7015m qpg6095 qpg6100 samr21 simulation posix)
|
||||
readonly OT_PLATFORMS=(cc1352 cc2538 cc2650 cc2652 efr32mg1 efr32mg12 efr32mg13 efr32mg21 kw41z nrf52811 nrf52833 nrf52840 gp712 qpg7015m qpg6095 qpg6100 samr21 simulation posix)
|
||||
readonly OT_NRF528XX_BUILD_TYPES=(UART_trans USB_trans_bl SPI_trans_NCP soft_crypto soft_crypto_threading)
|
||||
readonly OT_POSIX_SIM_COMMON_OPTIONS=(
|
||||
"-DOT_BORDER_AGENT=ON"
|
||||
@@ -131,6 +142,29 @@ readonly OT_nrf52833_OPTIONS=(
|
||||
|
||||
readonly OT_nrf52840_OPTIONS=("${OT_nrf52833_OPTIONS[@]:0}")
|
||||
|
||||
readonly OT_efr32_OPTIONS=(
|
||||
"-DOT_DIAGNOSTIC=ON"
|
||||
"-DOT_EXTERNAL_HEAP=ON"
|
||||
"-DOT_EXTERNAL_MBEDTLS=silabs-mbedtls"
|
||||
"-DOT_BUILTIN_MBEDTLS_MANAGEMENT=OFF"
|
||||
)
|
||||
|
||||
readonly OT_efr32mg1_OPTIONS=(
|
||||
"${OT_efr32_OPTIONS[@]:0}"
|
||||
)
|
||||
|
||||
readonly OT_efr32mg12_OPTIONS=(
|
||||
"${OT_efr32_OPTIONS[@]:0}"
|
||||
)
|
||||
|
||||
readonly OT_efr32mg13_OPTIONS=(
|
||||
"${OT_efr32_OPTIONS[@]:0}"
|
||||
)
|
||||
|
||||
readonly OT_efr32mg21_OPTIONS=(
|
||||
"${OT_efr32_OPTIONS[@]:0}"
|
||||
)
|
||||
|
||||
die()
|
||||
{
|
||||
echo " ** ERROR: Openthread CMake doesn't support platform \"$1\""
|
||||
@@ -209,6 +243,31 @@ main()
|
||||
OT_CMAKE_NINJA_TARGET=("ot-cli-ftd" "ot-rcp")
|
||||
options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-linux-gnueabihf.cmake" "-DCMAKE_BUILD_TYPE=Release")
|
||||
;;
|
||||
efr32*)
|
||||
options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/efr32/${platform}/arm-none-eabi.cmake")
|
||||
|
||||
case "${platform}" in
|
||||
efr32mg1)
|
||||
OT_CMAKE_NINJA_TARGET=("ot-rcp")
|
||||
options+=("${OT_efr32mg1_OPTIONS[@]}")
|
||||
;;
|
||||
efr32mg12)
|
||||
OT_CMAKE_NINJA_TARGET=("ot-rcp" "ot-cli-ftd" "ot-cli-mtd" "ot-ncp-ftd" "ot-ncp-mtd")
|
||||
OT_CMAKE_NINJA_TARGET+=("sleepy-demo-ftd" "sleepy-demo-mtd")
|
||||
options+=("${OT_efr32mg12_OPTIONS[@]}")
|
||||
;;
|
||||
efr32mg13)
|
||||
OT_CMAKE_NINJA_TARGET=("ot-rcp" "ot-cli-ftd" "ot-cli-mtd" "ot-ncp-ftd" "ot-ncp-mtd")
|
||||
OT_CMAKE_NINJA_TARGET+=("sleepy-demo-ftd" "sleepy-demo-mtd")
|
||||
options+=("${OT_efr32mg13_OPTIONS[@]}")
|
||||
;;
|
||||
efr32mg21)
|
||||
OT_CMAKE_NINJA_TARGET=("ot-rcp" "ot-cli-ftd" "ot-cli-mtd" "ot-ncp-ftd" "ot-ncp-mtd")
|
||||
OT_CMAKE_NINJA_TARGET+=("sleepy-demo-ftd" "sleepy-demo-mtd")
|
||||
options+=("${OT_efr32mg21_OPTIONS[@]}")
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user