mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[efr32] move to openthread/ot-efr32 (#6403)
This commit is contained in:
@@ -178,9 +178,6 @@ elseif(OT_PLATFORM STREQUAL "external")
|
||||
elseif(OT_PLATFORM MATCHES "^nrf*")
|
||||
target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/${OT_PLATFORM})
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx")
|
||||
elseif(OT_PLATFORM MATCHES "^efr*")
|
||||
target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/examples/platforms/efr32/${OT_PLATFORM})
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/examples/platforms/efr32")
|
||||
else()
|
||||
target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM})
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM}")
|
||||
|
||||
+4
-21
@@ -780,15 +780,14 @@ AC_MSG_CHECKING([whether to build examples])
|
||||
|
||||
AC_ARG_WITH(examples,
|
||||
[AS_HELP_STRING([--with-examples=TARGET],
|
||||
[Build example applications for one of: simulation, cc2538, efr32mg1, efr32mg12, efr32mg13, efr32mg21,
|
||||
nrf52811, nrf52833, nrf52840 @<:@default=no@:>@.
|
||||
[Build example applications for one of: simulation, cc2538, nrf52811, nrf52833, nrf52840 @<:@default=no@:>@.
|
||||
Note that building example applications also builds the associated OpenThread platform libraries
|
||||
and any third_party libraries needed to support the examples.])],
|
||||
[
|
||||
case "${with_examples}" in
|
||||
no)
|
||||
;;
|
||||
simulation|cc2538|efr32mg1|efr32mg12|efr32mg13|efr32mg21|nrf52811|nrf52833|nrf52840)
|
||||
simulation|cc2538|nrf52811|nrf52833|nrf52840)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(ERROR)
|
||||
@@ -802,10 +801,6 @@ AM_CONDITIONAL([OPENTHREAD_ENABLE_EXAMPLES], [test ${with_examples} != "no"])
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_SIMULATION],[test "${with_examples}" = "simulation"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2538], [test "${with_examples}" = "cc2538"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG1], [test "${with_examples}" = "efr32mg1"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG12], [test "${with_examples}" = "efr32mg12"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG13], [test "${with_examples}" = "efr32mg13"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32MG21], [test "${with_examples}" = "efr32mg21"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52811], [test "${with_examples}" = "nrf52811"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52833], [test "${with_examples}" = "nrf52833"])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${with_examples}" = "nrf52840"])
|
||||
@@ -813,7 +808,6 @@ AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${with_examples}" = "nrf5
|
||||
AM_COND_IF([OPENTHREAD_EXAMPLES_SIMULATION], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_SIMULATION=1", CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_SIMULATION=0")
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF528XX], [test OPENTHREAD_EXAMPLES_NRF52811 || test OPENTHREAD_EXAMPLES_NRF52833 || test OPENTHREAD_EXAMPLES_NRF52840])
|
||||
AM_CONDITIONAL([OPENTHREAD_EXAMPLES_EFR32], [test "${with_examples}" = "efr32mg1" -o "${with_examples}" = "efr32mg12" -o "${with_examples}" = "efr32mg13" -o "${with_examples}" = "efr32mg21"])
|
||||
|
||||
case ${with_examples} in
|
||||
no)
|
||||
@@ -832,12 +826,11 @@ AC_MSG_CHECKING([whether to build platform libraries])
|
||||
|
||||
AC_ARG_WITH(platform,
|
||||
[AS_HELP_STRING([--with-platform=TARGET],
|
||||
[Build OpenThread platform libraries for one of: cc2538,
|
||||
efr32mg1, efr32mg12, efr32mg13, efr32mg21, nrf52811, nrf52833, nrf52840, posix, simulation @<:@default=simulation@:>@.])],
|
||||
[Build OpenThread platform libraries for one of: cc2538, nrf52811, nrf52833, nrf52840, posix, simulation @<:@default=simulation@:>@.])],
|
||||
[
|
||||
# Make sure the given target is valid.
|
||||
case "${with_platform}" in
|
||||
no|cc2538|efr32mg1|efr32mg12|efr32mg13|efr32mg21|nrf52811|nrf52833|nrf52840|posix|simulation)
|
||||
no|cc2538|nrf52811|nrf52833|nrf52840|posix|simulation)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(ERROR)
|
||||
@@ -869,10 +862,6 @@ AM_CONDITIONAL([OPENTHREAD_ENABLE_PLATFORM], [test ${with_platform} != "no"])
|
||||
OPENTHREAD_ENABLE_PLATFORM=${with_platform}
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_CC2538], [test "${with_platform}" = "cc2538"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG1], [test "${with_platform}" = "efr32mg1"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG12], [test "${with_platform}" = "efr32mg12"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG13], [test "${with_platform}" = "efr32mg13"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32MG21], [test "${with_platform}" = "efr32mg21"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52811], [test "${with_platform}" = "nrf52811"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52833], [test "${with_platform}" = "nrf52833"])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52840], [test "${with_platform}" = "nrf52840"])
|
||||
@@ -880,7 +869,6 @@ AM_CONDITIONAL([OPENTHREAD_PLATFORM_POSIX], [test "${with_platform}" = "posi
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_SIMULATION],[test "${with_platform}" = "simulation"])
|
||||
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF528XX], [test OPENTHREAD_PLATFORM_NRF52811 || test OPENTHREAD_PLATFORM_NRF52833 || test OPENTHREAD_PLATFORM_NRF52840])
|
||||
AM_CONDITIONAL([OPENTHREAD_PLATFORM_EFR32], [test "${with_platform}" = "efr32mg1" -o "${with_platform}" = "efr32mg12" -o "${with_platform}" = "efr32mg13" -o "${with_platform}" = "efr32mg21"])
|
||||
|
||||
AM_COND_IF([OPENTHREAD_PLATFORM_POSIX], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX=1", CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX=0")
|
||||
|
||||
@@ -1015,17 +1003,12 @@ third_party/Makefile
|
||||
third_party/jlink/Makefile
|
||||
third_party/mbedtls/Makefile
|
||||
third_party/NordicSemiconductor/Makefile
|
||||
third_party/silabs/Makefile
|
||||
examples/Makefile
|
||||
examples/apps/Makefile
|
||||
examples/apps/cli/Makefile
|
||||
examples/apps/ncp/Makefile
|
||||
examples/platforms/Makefile
|
||||
examples/platforms/cc2538/Makefile
|
||||
examples/platforms/efr32/Makefile
|
||||
examples/platforms/efr32/sleepy-demo/Makefile
|
||||
examples/platforms/efr32/sleepy-demo/sleepy-demo-mtd/Makefile
|
||||
examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/Makefile
|
||||
examples/platforms/nrf528xx/Makefile
|
||||
examples/platforms/simulation/Makefile
|
||||
examples/platforms/utils/Makefile
|
||||
|
||||
@@ -31,12 +31,10 @@ function(ot_get_platforms arg_platforms)
|
||||
list(APPEND result "NO" "posix" "external")
|
||||
set(platforms_dir "${PROJECT_SOURCE_DIR}/examples/platforms")
|
||||
file(GLOB platforms RELATIVE "${platforms_dir}" "${platforms_dir}/*"
|
||||
RELATIVE "${platforms_dir}/nrf528xx" "${platforms_dir}/nrf528xx/nrf*"
|
||||
RELATIVE "${platforms_dir}/efr32" "${platforms_dir}/efr32/efr32*")
|
||||
RELATIVE "${platforms_dir}/nrf528xx" "${platforms_dir}/nrf528xx/nrf*")
|
||||
foreach(platform IN LISTS platforms)
|
||||
if((IS_DIRECTORY "${platforms_dir}/${platform}") OR
|
||||
(IS_DIRECTORY "${platforms_dir}/nrf528xx/${platform}") OR
|
||||
(IS_DIRECTORY "${platforms_dir}/efr32/${platform}"))
|
||||
(IS_DIRECTORY "${platforms_dir}/nrf528xx/${platform}"))
|
||||
list(APPEND result "${platform}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
EFR32_PLATFORM = efr32mg1
|
||||
PLATFORM_LOWERCASE = $(shell echo $(EFR32_PLATFORM) | tr A-Z a-z)
|
||||
BOARD_LOWERCASE = $(shell echo $(BOARD) | tr A-Z a-z)
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--with-examples=$(EFR32_PLATFORM) \
|
||||
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
|
||||
#
|
||||
# Differentiate between boards
|
||||
#
|
||||
ifeq ($(BOARD_LOWERCASE),brd4151a)
|
||||
MCU = EFR32MG1P232F256GM48
|
||||
else
|
||||
$(error Please provide a value for BOARD variable e.g BOARD= BRD4151A (currently supported BRD4151A))
|
||||
endif
|
||||
|
||||
EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls_config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/src
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/config
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG1P/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/radio/rail_lib/chip/efr32/efr32xg1x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/silicon_labs/silabs_core/memory_manager
|
||||
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32/
|
||||
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(EFR32_PLATFORM)/$(BOARD_LOWERCASE)
|
||||
|
||||
EFR32_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-efr32-config.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-efr32-config-check.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -I$(CONFIG_FILE_PATH)
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-I$(HAL_CONF_DIR) \
|
||||
-D$(MCU) \
|
||||
$(EFR32_CONFIG_FILE_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
#
|
||||
# Platform-Specific switches
|
||||
#
|
||||
|
||||
DMP ?= 0
|
||||
RADIODEBUG ?= 0
|
||||
|
||||
ifeq ($(DMP),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DMP_SUPPORT=1
|
||||
endif
|
||||
|
||||
ifeq ($(RADIODEBUG),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DEBUG_COUNTERS_SUPPORT=1
|
||||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = $(PLATFORM_LOWERCASE)
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -1,331 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
EFR32_PLATFORM = efr32mg12
|
||||
PLATFORM_LOWERCASE = $(shell echo $(EFR32_PLATFORM) | tr A-Z a-z)
|
||||
BOARD_LOWERCASE = $(shell echo $(BOARD) | tr A-Z a-z)
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--with-examples=$(EFR32_PLATFORM) \
|
||||
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
|
||||
#
|
||||
# Differentiate between boards
|
||||
# - BRD4304A / SLWSTK6000B / MGM12P Module / 2.4GHz@19dBm
|
||||
# - BRD4161A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm
|
||||
# - BRD4166A / SLTB004A / Thunderboard Sense 2 / 2.4GHz@10dBm
|
||||
# - BRD4170A / SLWSTK6000B / Multiband Wireless Starter Kit / 2.4GHz@19dBm, 915MHz@19dBm, 868MHz@19dBm
|
||||
#
|
||||
ifeq ($(BOARD_LOWERCASE),brd4304a)
|
||||
MCU = EFR32MG12P432F1024GM48
|
||||
else
|
||||
ifeq ($(BOARD_LOWERCASE),brd4161a)
|
||||
MCU = EFR32MG12P432F1024GL125
|
||||
else
|
||||
ifeq ($(BOARD_LOWERCASE),brd4166a)
|
||||
MCU = EFR32MG12P332F1024GL125
|
||||
else
|
||||
ifeq ($(BOARD_LOWERCASE),brd4170a)
|
||||
MCU = EFR32MG12P433F1024GM68
|
||||
else
|
||||
$(error Please provide a value for BOARD variable e.g BOARD=BRD4161A (currently supported BRD4304A, BRD4161A, BRD4166A or BRD4170A))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls_config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/src
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/config
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG12P/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/radio/rail_lib/chip/efr32/efr32xg1x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/silicon_labs/silabs_core/memory_manager
|
||||
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32/
|
||||
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(EFR32_PLATFORM)/$(BOARD_LOWERCASE)
|
||||
|
||||
EFR32_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-efr32-config.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-efr32-config-check.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -I$(CONFIG_FILE_PATH)
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-I$(HAL_CONF_DIR) \
|
||||
-D$(MCU) \
|
||||
$(EFR32_CONFIG_FILE_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
#
|
||||
# Platform-Specific switches
|
||||
#
|
||||
|
||||
DMP ?= 0
|
||||
RADIODEBUG ?= 0
|
||||
|
||||
ifeq ($(DMP),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DMP_SUPPORT=1
|
||||
endif
|
||||
|
||||
ifeq ($(RADIODEBUG),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DEBUG_COUNTERS_SUPPORT=1
|
||||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = $(PLATFORM_LOWERCASE)
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -1,317 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
EFR32_PLATFORM = efr32mg13
|
||||
PLATFORM_LOWERCASE = $(shell echo $(EFR32_PLATFORM) | tr A-Z a-z)
|
||||
BOARD_LOWERCASE = $(shell echo $(BOARD) | tr A-Z a-z)
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--with-examples=$(EFR32_PLATFORM) \
|
||||
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
|
||||
#
|
||||
# Differentiate between boards
|
||||
# - BRD4168A / SLWSTK6000B / MGM13P Module / 2.4GHz@19dBm
|
||||
#
|
||||
ifeq ($(BOARD_LOWERCASE),brd4168a)
|
||||
MCU = EFR32MG13P732F512GM48
|
||||
else
|
||||
$(error Please provide a value for BOARD variable e.g BOARD=BRD4168A (currently supported BRD4168A))
|
||||
endif
|
||||
|
||||
EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls_config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/src
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/config
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG13P/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/radio/rail_lib/chip/efr32/efr32xg1x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/silicon_labs/silabs_core/memory_manager
|
||||
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32/
|
||||
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(EFR32_PLATFORM)/$(BOARD_LOWERCASE)
|
||||
|
||||
EFR32_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-efr32-config.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-efr32-config-check.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -I$(CONFIG_FILE_PATH)
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-I$(HAL_CONF_DIR) \
|
||||
-D$(MCU) \
|
||||
$(EFR32_CONFIG_FILE_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
#
|
||||
# Platform-Specific switches
|
||||
#
|
||||
|
||||
DMP ?= 0
|
||||
RADIODEBUG ?= 0
|
||||
|
||||
ifeq ($(DMP),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DMP_SUPPORT=1
|
||||
endif
|
||||
|
||||
ifeq ($(RADIODEBUG),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DEBUG_COUNTERS_SUPPORT=1
|
||||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = $(PLATFORM_LOWERCASE)
|
||||
|
||||
ARCHS = cortex-m4
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m4
|
||||
#
|
||||
|
||||
cortex-m4_target_ABI = cortex-m4
|
||||
cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -1,325 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
.NOTPARALLEL:
|
||||
|
||||
AR = arm-none-eabi-ar
|
||||
CCAS = arm-none-eabi-as
|
||||
CPP = arm-none-eabi-cpp
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld
|
||||
STRIP = arm-none-eabi-strip
|
||||
NM = arm-none-eabi-nm
|
||||
RANLIB = arm-none-eabi-ranlib
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
|
||||
EFR32_PLATFORM = efr32mg21
|
||||
PLATFORM_LOWERCASE = $(shell echo $(EFR32_PLATFORM) | tr A-Z a-z)
|
||||
BOARD_LOWERCASE = $(shell echo $(BOARD) | tr A-Z a-z)
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
--enable-radio-only \
|
||||
--enable-linker-map \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--with-examples=$(EFR32_PLATFORM) \
|
||||
MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(DISABLE_BUILTIN_MBEDTLS), 1)
|
||||
configure_OPTIONS += MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)"
|
||||
endif
|
||||
|
||||
TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST))))..
|
||||
AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))..
|
||||
|
||||
|
||||
#
|
||||
# Differentiate between boards
|
||||
# - BRD4180A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@20dBm
|
||||
#
|
||||
ifeq ($(BOARD_LOWERCASE),brd4180a)
|
||||
MCU = EFR32MG21A020F1024IM32
|
||||
else
|
||||
ifeq ($(BOARD_LOWERCASE),brd4180b)
|
||||
MCU = EFR32MG21A020F1024IM32
|
||||
else
|
||||
$(error Please provide a value for BOARD variable e.g BOARD=BRD4180A (currently supported BRD4180A, BRD4180B))
|
||||
endif
|
||||
endif
|
||||
|
||||
EFR32_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls_config.h\"'
|
||||
EFR32_MBEDTLS_CPPFLAGS += -D$(MCU)
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/src
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/crypto
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/include/mbedtls
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/config
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/CMSIS/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG21/Include
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emlib/inc
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/radio/rail_lib/chip/efr32/efr32xg2x
|
||||
EFR32_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/silabs/gecko_sdk_suite/v3.1/util/silicon_labs/silabs_core/memory_manager
|
||||
EFR32_MBEDTLS_CPPFLAGS += -Wno-unused-function
|
||||
EFR32_MBEDTLS_CPPFLAGS += -Wno-unused-parameter
|
||||
|
||||
CONFIG_FILE_PATH = $(AbsTopSourceDir)/examples/platforms/efr32/
|
||||
HAL_CONF_DIR = $(CONFIG_FILE_PATH)/$(EFR32_PLATFORM)/$(BOARD_LOWERCASE)
|
||||
|
||||
EFR32_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-efr32-config.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-efr32-config-check.h\"'
|
||||
EFR32_CONFIG_FILE_CPPFLAGS += -I$(CONFIG_FILE_PATH)
|
||||
|
||||
COMMONCFLAGS := \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Os \
|
||||
-g \
|
||||
-I$(HAL_CONF_DIR) \
|
||||
-D$(MCU) \
|
||||
$(EFR32_CONFIG_FILE_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk
|
||||
|
||||
#
|
||||
# Platform-Specific switches
|
||||
#
|
||||
|
||||
DMP ?= 0
|
||||
RADIODEBUG ?= 0
|
||||
|
||||
ifeq ($(DMP),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DMP_SUPPORT=1
|
||||
endif
|
||||
|
||||
ifeq ($(RADIODEBUG),1)
|
||||
COMMONCFLAGS += -DRADIO_CONFIG_DEBUG_COUNTERS_SUPPORT=1
|
||||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_CXXFLAGS) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS += \
|
||||
$(COMMONCFLAGS) \
|
||||
$(target_LDFLAGS) \
|
||||
-specs=nano.specs \
|
||||
-specs=nosys.specs \
|
||||
-Wl,--gc-sections \
|
||||
$(NULL)
|
||||
|
||||
ECHO := @echo
|
||||
MAKE := make
|
||||
MKDIR_P := mkdir -p
|
||||
LN_S := ln -s
|
||||
RM_F := rm -f
|
||||
|
||||
INSTALL := /usr/bin/install
|
||||
INSTALLFLAGS := -p
|
||||
|
||||
BuildPath = build
|
||||
TopBuildDir = $(BuildPath)
|
||||
AbsTopBuildDir = $(PWD)/$(TopBuildDir)
|
||||
|
||||
ResultPath = output
|
||||
TopResultDir = $(ResultPath)
|
||||
AbsTopResultDir = $(PWD)/$(TopResultDir)
|
||||
|
||||
TargetTuple = $(PLATFORM_LOWERCASE)
|
||||
|
||||
ARCHS = cortex-m33
|
||||
|
||||
TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib
|
||||
|
||||
ifndef BuildJobs
|
||||
BuildJobs := $(shell getconf _NPROCESSORS_ONLN)
|
||||
endif
|
||||
JOBSFLAG := -j$(BuildJobs)
|
||||
|
||||
#
|
||||
# configure-arch <arch>
|
||||
#
|
||||
# Configure OpenThread for the specified architecture.
|
||||
#
|
||||
# arch - The architecture to configure.
|
||||
#
|
||||
define configure-arch
|
||||
$(ECHO) " CONFIG $(TargetTuple)..."
|
||||
(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \
|
||||
INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
|
||||
CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
--host=arm-none-eabi \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/$(TargetTuple) \
|
||||
$(configure_OPTIONS))
|
||||
endef # configure-arch
|
||||
|
||||
#
|
||||
# build-arch <arch>
|
||||
#
|
||||
# Build the OpenThread intermediate build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to build.
|
||||
#
|
||||
define build-arch
|
||||
$(ECHO) " BUILD $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
all
|
||||
endef # build-arch
|
||||
|
||||
#
|
||||
# stage-arch <arch>
|
||||
#
|
||||
# Stage (install) the OpenThread final build products for the specified
|
||||
# architecture.
|
||||
#
|
||||
# arch - The architecture to stage.
|
||||
#
|
||||
define stage-arch
|
||||
$(ECHO) " STAGE $(TargetTuple)"
|
||||
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \
|
||||
DESTDIR=$(AbsTopResultDir) \
|
||||
install
|
||||
endef # stage-arch
|
||||
|
||||
#
|
||||
# ARCH_template <arch>
|
||||
#
|
||||
# Define macros, targets and rules to configure, build, and stage the
|
||||
# OpenThread for a single architecture.
|
||||
#
|
||||
# arch - The architecture to instantiate the template for.
|
||||
#
|
||||
define ARCH_template
|
||||
CONFIGURE_TARGETS += configure-$(1)
|
||||
BUILD_TARGETS += do-build-$(1)
|
||||
STAGE_TARGETS += stage-$(1)
|
||||
BUILD_DIRS += $(BuildPath)/$(TargetTuple)
|
||||
DIRECTORIES += $(BuildPath)/$(TargetTuple)
|
||||
|
||||
configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS)
|
||||
configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS)
|
||||
configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS)
|
||||
configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS)
|
||||
|
||||
configure-$(1): $(BuildPath)/$(TargetTuple)/config.status
|
||||
|
||||
$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple)
|
||||
$$(call configure-arch,$(1))
|
||||
|
||||
do-build-$(1): configure-$(1)
|
||||
|
||||
do-build-$(1):
|
||||
+$$(call build-arch,$(1))
|
||||
|
||||
stage-$(1): do-build-$(1)
|
||||
|
||||
stage-$(1): | $(TopResultDir)
|
||||
$$(call stage-arch,$(1))
|
||||
|
||||
$(1): stage-$(1)
|
||||
endef # ARCH_template
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: stage
|
||||
|
||||
#
|
||||
# cortex-m33
|
||||
#
|
||||
|
||||
cortex-m33_target_ABI = cortex-m33
|
||||
cortex-m33_target_CPPFLAGS = -mcpu=cortex-m33 -mthumb -fmessage-length=0 -ffunction-sections -fdata-sections -mfpu=fpv5-sp-d16 -mfloat-abi=hard
|
||||
cortex-m33_target_CFLAGS = -mcpu=cortex-m33 -mthumb -fmessage-length=0 -ffunction-sections -fdata-sections -mfpu=fpv5-sp-d16 -mfloat-abi=hard
|
||||
cortex-m33_target_CXXFLAGS = -mcpu=cortex-m33 -mthumb -fmessage-length=0 -ffunction-sections -fdata-sections -mfpu=fpv5-sp-d16 -mfloat-abi=hard
|
||||
cortex-m33_target_LDFLAGS = -mcpu=cortex-m33 -mthumb -fmessage-length=0 -ffunction-sections -fdata-sections -mfpu=fpv5-sp-d16 -mfloat-abi=hard
|
||||
|
||||
# Instantiate an architecture-specific build template for each target
|
||||
# architecture.
|
||||
|
||||
$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch))))
|
||||
|
||||
#
|
||||
# Common / Finalization
|
||||
#
|
||||
|
||||
configure: $(CONFIGURE_TARGETS)
|
||||
|
||||
build: $(BUILD_TARGETS)
|
||||
|
||||
stage: $(STAGE_TARGETS)
|
||||
|
||||
DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS)
|
||||
|
||||
CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS)
|
||||
|
||||
all: stage
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(ECHO) " MKDIR $@"
|
||||
@$(MKDIR_P) "$@"
|
||||
|
||||
clean:
|
||||
$(ECHO) " CLEAN"
|
||||
@$(RM_F) -r $(CLEAN_DIRS)
|
||||
|
||||
help:
|
||||
$(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following "
|
||||
$(ECHO) "architectures: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " $(ARCHS)"
|
||||
$(ECHO) ""
|
||||
$(ECHO) "To build only a particular architecture, specify: "
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) <architecture>"
|
||||
$(ECHO) ""
|
||||
@@ -31,6 +31,7 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
EXTRA_DIST = \
|
||||
cc1352 \
|
||||
cc2652 \
|
||||
efr32 \
|
||||
gp712 \
|
||||
k32w \
|
||||
kw41z \
|
||||
@@ -44,7 +45,6 @@ EXTRA_DIST = \
|
||||
|
||||
DIST_SUBDIRS = \
|
||||
cc2538 \
|
||||
efr32 \
|
||||
nrf528xx \
|
||||
simulation \
|
||||
utils \
|
||||
@@ -60,10 +60,6 @@ if OPENTHREAD_PLATFORM_CC2538
|
||||
SUBDIRS += cc2538
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_EFR32
|
||||
SUBDIRS += efr32
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_NRF528XX
|
||||
SUBDIRS += nrf528xx
|
||||
endif
|
||||
|
||||
@@ -45,10 +45,6 @@ if OPENTHREAD_EXAMPLES_CC2538
|
||||
include $(top_srcdir)/examples/platforms/cc2538/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32
|
||||
include $(top_srcdir)/examples/platforms/efr32/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_NRF52811
|
||||
include $(top_srcdir)/examples/platforms/nrf528xx/nrf52811/Makefile.platform.am
|
||||
endif
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/utility.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/includes.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/imported_libs.cmake)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Common sources and includes
|
||||
# ==============================================================================
|
||||
set(EFR32_COMMON_SOURCES
|
||||
src/alarm.c
|
||||
src/diag.c
|
||||
src/entropy.c
|
||||
src/fem-control.c
|
||||
src/flash.c
|
||||
src/ieee802154mac.h
|
||||
src/logging.c
|
||||
src/mbedtls_config.h
|
||||
src/memory.c
|
||||
src/misc.c
|
||||
src/openthread-core-efr32-config-check.h
|
||||
src/openthread-core-efr32-config.h
|
||||
src/platform-band.h
|
||||
src/platform-efr32.h
|
||||
src/radio.c
|
||||
src/rail_config.h
|
||||
src/startup-gcc.c
|
||||
src/system.c
|
||||
src/uart.c
|
||||
)
|
||||
|
||||
set(EFR32_INCLUDES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${EFR32_PLATFORM}/crypto
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${EFR32_PLATFORM}/${BOARD_LOWERCASE}
|
||||
${PROJECT_SOURCE_DIR}/third_party/silabs/rail_config
|
||||
${SILABS_GSDK_INCLUDES}
|
||||
${PROJECT_SOURCE_DIR}/examples/platforms
|
||||
${PROJECT_SOURCE_DIR}/src/core
|
||||
)
|
||||
|
||||
set(EFR32_CFLAGS
|
||||
-Wno-sign-compare
|
||||
-Wno-unused-parameter
|
||||
-Wno-missing-field-initializers
|
||||
)
|
||||
|
||||
# ==============================================================================
|
||||
# mbedtls
|
||||
# ==============================================================================
|
||||
if(NOT OT_EXTERNAL_MBEDTLS)
|
||||
message(FATAL_ERROR "OT_EXTERNAL_MBEDTLS is not set. Please include the define when running cmake\n\t-DOT_EXTERNAL_MBEDTLS=silabs-mbedtls")
|
||||
else()
|
||||
list(APPEND OT_PLATFORM_DEFINES "MBEDTLS_CONFIG_FILE=\"mbedtls_config.h\"")
|
||||
endif()
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
if(PLATFORM_LOWERCASE MATCHES "^efr32mg2\\d*")
|
||||
list(APPEND OT_PUBLIC_INCLUDES
|
||||
"${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/inc"
|
||||
"${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src"
|
||||
)
|
||||
set(OT_PUBLIC_INCLUDES ${OT_PUBLIC_INCLUDES} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# ==============================================================================
|
||||
# General variables
|
||||
# ==============================================================================
|
||||
|
||||
# ==============================================================================
|
||||
# Filter out CFLAGS
|
||||
# ==============================================================================
|
||||
set(ignored_flags
|
||||
"-pedantic-errors" # Needed for RAIL lib
|
||||
"-Wshadow" # Needed for RAIL lib
|
||||
)
|
||||
|
||||
foreach(flag IN LISTS ignored_flags)
|
||||
string(REPLACE "${flag}" "" OT_CFLAGS "${OT_CFLAGS}")
|
||||
endforeach()
|
||||
list(APPEND EFR32_CFLAGS ${OT_CFLAGS})
|
||||
set(OT_CFLAGS ${OT_CFLAGS} PARENT_SCOPE)
|
||||
|
||||
# Use default config file if one isn't specified
|
||||
if(NOT OT_CONFIG)
|
||||
set(OT_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/src/openthread-core-efr32-config.h")
|
||||
set(OT_CONFIG ${OT_CONFIG} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES
|
||||
"OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\""
|
||||
"OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"openthread-core-efr32-config-check.h\""
|
||||
)
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
# ==============================================================================
|
||||
# Platform targets
|
||||
# ==============================================================================
|
||||
set(EFR32_COMMON_3RD_LIBS
|
||||
jlinkrtt
|
||||
${OT_MBEDTLS}
|
||||
)
|
||||
|
||||
include(${PLATFORM_LOWERCASE}/${PLATFORM_LOWERCASE}.cmake)
|
||||
|
||||
list(APPEND OT_PUBLIC_INCLUDES ${EFR32_INCLUDES})
|
||||
set(OT_PUBLIC_INCLUDES ${OT_PUBLIC_INCLUDES} PARENT_SCOPE)
|
||||
|
||||
# ==============================================================================
|
||||
# sleepy-demo
|
||||
# ==============================================================================
|
||||
option(EFR32_APP_SLEEPY_DEMO "enable sleepy-demo app" ON)
|
||||
|
||||
if(EFR32_APP_SLEEPY_DEMO)
|
||||
add_subdirectory(sleepy-demo)
|
||||
endif()
|
||||
@@ -1,70 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# Use automake includes since we cannot use SUBDIRS feature due to cleanup
|
||||
# errors - few targets may use the same source file but dependency file is
|
||||
# created only once which leads to errors when auto-generated Makefile tries
|
||||
# to remove .Po files that were already removed
|
||||
|
||||
|
||||
# Always package (e.g. for 'make dist') these subdirectories.
|
||||
DIST_SUBDIRS = sleepy-demo
|
||||
|
||||
# Always build (e.g. for 'make all') these subdirectories.
|
||||
SUBDIRS = $(NULL)
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
include efr32mg1/Makefile.am
|
||||
# SUBDIRS = sleepy-demo
|
||||
# NOTE: The sleepy-demo app currently does not fit on this platform.
|
||||
#
|
||||
# .../arm-none-eabi/bin/ld: sleepy-demo-mtd section `.bss' will not fit in region `RAM'
|
||||
# .../arm-none-eabi/bin/ld: sleepy-demo-mtd section `.nvm' will not fit in region `FLASH'
|
||||
# .../arm-none-eabi/bin/ld: region RAM overflowed with stack
|
||||
# .../arm-none-eabi/bin/ld: region `FLASH' overflowed by 33428 bytes
|
||||
# .../arm-none-eabi/bin/ld: region `RAM' overflowed by 4536 bytes
|
||||
|
||||
else # not OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG12
|
||||
include efr32mg12/Makefile.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG13
|
||||
include efr32mg13/Makefile.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG21
|
||||
include efr32mg21/Makefile.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_ENABLE_EXECUTABLE
|
||||
SUBDIRS += sleepy-demo
|
||||
endif
|
||||
|
||||
endif # OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
@@ -1,82 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32_platform_defs.am
|
||||
|
||||
# ==============================================================================
|
||||
# Add mbedtls archive to LDADD_COMMON
|
||||
# ==============================================================================
|
||||
if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
LDADD_COMMON += \
|
||||
$(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
|
||||
$(NULL)
|
||||
else
|
||||
LDADD_COMMON += \
|
||||
$(top_builddir)/third_party/silabs/libsilabs-mbedtls.a \
|
||||
$(NULL)
|
||||
endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
|
||||
# ==============================================================================
|
||||
# Linker flags
|
||||
# ==============================================================================
|
||||
RAIL_SUFFIX = $(shell echo $(PLATFORM_LOWERCASE)| tr mg xg)_gcc_release.a
|
||||
LIBRAIL = $(shell \
|
||||
if [ "$(DMP)" = "1" ]; then \
|
||||
echo librail_multiprotocol_$(RAIL_SUFFIX); \
|
||||
else \
|
||||
echo librail_$(RAIL_SUFFIX); \
|
||||
fi; )
|
||||
|
||||
LDADD_COMMON += \
|
||||
$(top_builddir)/examples/platforms/efr32/libopenthread-$(PLATFORM_LOWERCASE).a \
|
||||
$(top_builddir)/third_party/silabs/libsilabs-$(PLATFORM_LOWERCASE)-sdk.a \
|
||||
$(top_srcdir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/radio/rail_lib/autogen/librail_release/$(LIBRAIL) \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS_COMMON += \
|
||||
-T $(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/$(PLATFORM_LOWERCASE).ld \
|
||||
$(NULL)
|
||||
|
||||
# ==============================================================================
|
||||
# Platform includes
|
||||
# ==============================================================================
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32mg1/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG12
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32mg12/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG13
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32mg13/Makefile.platform.am
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG21
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32mg21/Makefile.platform.am
|
||||
endif
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM)
|
||||
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
|
||||
set(CMAKE_RANLIB arm-none-eabi-ranlib)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -fdata-sections -ffunction-sections")
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_ASM_FLAGS_DEBUG "-g")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_ASM_FLAGS_RELEASE "")
|
||||
@@ -1,166 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
|
||||
# ==============================================================================
|
||||
# General variables
|
||||
# ==============================================================================
|
||||
SDK_SRC_DIR = $(top_srcdir)/third_party/silabs/gecko_sdk_suite/v3.1
|
||||
|
||||
EFR32_PLATFORM = $(subst /,,$(exec_prefix))
|
||||
# NOTE: This is a work-around that sets EFR32_PLATFORM to the correct platform name.
|
||||
# Example:
|
||||
# EFR32_PLATFORM = efr32mg12
|
||||
|
||||
PLATFORM_LOWERCASE = $(shell echo $(EFR32_PLATFORM) | tr A-Z a-z)
|
||||
PLATFORM_UPPERCASE = $(shell echo $(EFR32_PLATFORM) | tr a-z A-Z)
|
||||
|
||||
BOARD_LOWERCASE = $(shell echo $(BOARD) | tr A-Z a-z)
|
||||
BOARD_UPPERCASE = $(shell echo $(BOARD) | tr a-z A-Z)
|
||||
|
||||
$(top_builddir)/examples/platforms/efr32/libopenthread-$(PLATFORM_LOWERCASE).a:
|
||||
echo MAKING examples/platforms/efr32/libopenthread-$(PLATFORM_LOWERCASE).a
|
||||
(cd $(top_builddir)/examples/platforms/efr32/ && $(MAKE) $(AM_MAKEFLAGS) libopenthread-$(PLATFORM_LOWERCASE).a )
|
||||
|
||||
# ==============================================================================
|
||||
# filter-out flags for RAIL
|
||||
# ==============================================================================
|
||||
# Do not enable -Wconversion for rail and Silicon Labs SDK sources
|
||||
override CFLAGS := $(filter-out -Wconversion,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wconversion,$(CXXFLAGS))
|
||||
|
||||
# Do not enable -pedantic-errors for rail and Silicon Labs SDK sources
|
||||
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS))
|
||||
|
||||
# Do not enable -Wundef for rail and Silicon Labs SDK sources
|
||||
override CFLAGS := $(filter-out -Wundef,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS))
|
||||
|
||||
# ==============================================================================
|
||||
# GSDK CPPFLAGS
|
||||
# ==============================================================================
|
||||
SILABS_GSDK_CPPFLAGS = \
|
||||
-I$(SDK_SRC_DIR) \
|
||||
-I$(SDK_SRC_DIR)/hardware/board/config/$(BOARD_LOWERCASE)_brd4001a \
|
||||
-I$(SDK_SRC_DIR)/hardware/board/config/$(BOARD_LOWERCASE) \
|
||||
-I$(SDK_SRC_DIR)/hardware/kit/$(PLATFORM_UPPERCASE)_$(BOARD_UPPERCASE)/config \
|
||||
-I$(SDK_SRC_DIR)/hardware/kit/common/bsp \
|
||||
-I$(SDK_SRC_DIR)/hardware/kit/common/drivers \
|
||||
-I$(SDK_SRC_DIR)/platform/base/hal/micro/cortexm3/efm32 \
|
||||
-I$(SDK_SRC_DIR)/platform/base/hal/micro/cortexm3/efm32/config \
|
||||
-I$(SDK_SRC_DIR)/platform/base/hal/plugin/antenna/ \
|
||||
-I$(SDK_SRC_DIR)/platform/CMSIS/Include \
|
||||
-I$(SDK_SRC_DIR)/platform/common/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/common/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/dmadrv/config \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/dmadrv/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/gpiointerrupt/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/nvm3/config \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/nvm3/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/uartdrv/config \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/uartdrv/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/ustimer/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/emlib/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/halconfig/inc/hal-config \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/chip/efr32 \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/common \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/hal \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/hal/efr32 \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/plugin/pa-conversions \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/protocol/ieee802154 \
|
||||
-I$(SDK_SRC_DIR)/platform/service/device_init/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/service/mpu/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/service/sleeptimer/config \
|
||||
-I$(SDK_SRC_DIR)/platform/service/sleeptimer/inc \
|
||||
-I$(SDK_SRC_DIR)/util/plugin/plugin-common/fem-control \
|
||||
$(NULL)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Series-level CPPFLAGS
|
||||
# ==============================================================================
|
||||
SILABS_EFR32MG1X_CPPFLAGS = \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/nvm3/config/s1 \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/chip/efr32/efr32xg1x \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/plugin/pa-conversions/efr32xg1x/config \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG2X_CPPFLAGS = \
|
||||
-I$(SDK_SRC_DIR)/platform/emdrv/nvm3/config/s2 \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/chip/efr32/efr32xg2x \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21/config \
|
||||
-I$(SDK_SRC_DIR)/util/third_party/crypto/sl_component/se_manager/inc \
|
||||
-I$(SDK_SRC_DIR)/util/third_party/crypto/sl_component/se_manager/src \
|
||||
$(NULL)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Platform-level CPPFLAGS
|
||||
# ==============================================================================
|
||||
PLATFORM_COMMON_SOURCES_LIST = \
|
||||
src/alarm.c \
|
||||
src/diag.c \
|
||||
src/entropy.c \
|
||||
src/fem-control.c \
|
||||
src/flash.c \
|
||||
src/logging.c \
|
||||
src/memory.c \
|
||||
src/misc.c \
|
||||
src/openthread-core-efr32-config-check.h \
|
||||
src/openthread-core-efr32-config.h \
|
||||
src/platform-band.h \
|
||||
src/platform-efr32.h \
|
||||
src/radio.c \
|
||||
src/rail_config.h \
|
||||
src/startup-gcc.c \
|
||||
src/system.c \
|
||||
src/uart.c \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG1_CPPFLAGS = \
|
||||
-I$(SDK_SRC_DIR)/platform/Device/SiliconLabs/EFR32MG1P/Include \
|
||||
$(SILABS_EFR32MG1X_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG12_CPPFLAGS = \
|
||||
-I$(SDK_SRC_DIR)/platform/Device/SiliconLabs/EFR32MG12P/Include \
|
||||
$(SILABS_EFR32MG1X_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG13_CPPFLAGS = \
|
||||
-I$(SDK_SRC_DIR)/platform/Device/SiliconLabs/EFR32MG13P/Include \
|
||||
$(SILABS_EFR32MG1X_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG21_CPPFLAGS = \
|
||||
-I$(SDK_SRC_DIR)/platform/Device/SiliconLabs/EFR32MG21/Include \
|
||||
$(SILABS_EFR32MG2X_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32_platform_defs.am
|
||||
|
||||
lib_LIBRARIES = libopenthread-efr32mg1.a
|
||||
|
||||
libopenthread_efr32mg1_a_CPPFLAGS = \
|
||||
-DPLATFORM_HEADER=\"platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
|
||||
-Wno-sign-compare \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/$(BOARD_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
$(SILABS_EFR32MG1_CPPFLAGS) \
|
||||
$(SILABS_GSDK_CPPFLAGS) \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
$(NULL)
|
||||
|
||||
PLATFORM_SOURCES = \
|
||||
$(NULL)
|
||||
|
||||
noinst_HEADERS = \
|
||||
src/platform-band.h \
|
||||
src/platform-efr32.h \
|
||||
$(NULL)
|
||||
|
||||
libopenthread_efr32mg1_a_SOURCES = \
|
||||
$(PLATFORM_COMMON_SOURCES_LIST) \
|
||||
$(PLATFORM_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
Dash = -
|
||||
libopenthread_efr32mg1_a_LIBADD = \
|
||||
$(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") \
|
||||
$(shell find $(top_builddir)/third_party/jlink/SEGGER_RTT_V640/RTT $(Dash)type f $(Dash)name "*.o")
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# efr32mg1 platform-specific Makefile
|
||||
#
|
||||
|
||||
LDADD_COMMON += \
|
||||
$(top_srcdir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a \
|
||||
$(NULL)
|
||||
@@ -1,275 +1 @@
|
||||
# OpenThread on EFR32MG1P Example
|
||||
|
||||
This directory contains example platform drivers for the [Silicon Labs EFR32MG1P][efr32mg1p] based on [EFR32™ Mighty Gecko Wireless Starter Kit][slwstk6000b].
|
||||
|
||||
[efr32mg]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc
|
||||
[slwstk6000b]: http://www.silabs.com/products/development-tools/wireless/mesh-networking/mighty-gecko-starter-kit
|
||||
|
||||
The example platform drivers are intended to present the minimal code necessary to support OpenThread. [EFR32MG1P SoC][efr32mg1p] has rich memory and peripheral resources which can support all OpenThread capabilities. See the "Run the example with EFR32MG1 boards" section below for an example using basic OpenThread capabilities.
|
||||
|
||||
## Toolchain
|
||||
|
||||
Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
|
||||
|
||||
[gnu-toolchain]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
|
||||
|
||||
In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./script/bootstrap
|
||||
```
|
||||
|
||||
## Build Examples
|
||||
|
||||
1. Download and install the [Simplicity Studio][simplicity_studio].
|
||||
|
||||
[simplicity_studio]: http://www.silabs.com/products/development-tools/software/simplicity-studio
|
||||
|
||||
2. Install Flex (Gecko) SDK including RAIL Library from Simplicity Studio.
|
||||
- Connect EFR32MG1P Wireless Starter Kit to Simplicity Studio.
|
||||
- Find Flex SDK v3.1 in the Software Update page and click Install.
|
||||
- Flex SDK v3.1 will be installed in the path:
|
||||
- Mac
|
||||
- `/Applications/Simplicity\ Studio.app/Contents/Eclipse/developer/sdks/gecko_sdk_suite`
|
||||
- Windows
|
||||
- `C:\SiliconLabs\SimplicityStudio\v5\developer\sdks\gecko_sdk_suite`
|
||||
- Linux
|
||||
- `./SimplicityStudio_v5/developer/sdks/gecko_sdk_suite`
|
||||
|
||||
For more information on configuring, building, and installing applications for the Wireless Gecko (EFR32) portfolio using FLEX, see [Getting Started with the Silicon Labs Flex Software Development Kit for the Wireless Gecko (EFR32™) Portfolio][qsg138]. For more information on RAIL, see [Radio Abstraction Interface Layer][rail].
|
||||
|
||||
[qsg138]: https://www.silabs.com/documents/public/quick-start-guides/qsg138-flex-efr32.pdf
|
||||
[rail]: http://www.silabs.com/products/development-tools/software/radio-abstraction-interface-layer-sdk
|
||||
|
||||
3. Configure the path to Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/third_party
|
||||
$ mkdir silabs
|
||||
$ cd <path-to-Simplicity-Studio>/developer/sdks
|
||||
$ cp -rf gecko_sdk_suite <path-to-openthread>/third_party/silabs/
|
||||
```
|
||||
|
||||
Alternatively create a symbolic link to the Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/third_party
|
||||
$ mkdir silabs
|
||||
$ ln -s <path-to-Simplicity-Studio>/developer/sdks/gecko_sdk_suite silabs/gecko_sdk_suite
|
||||
```
|
||||
|
||||
4. Build OpenThread Firmware (CLI example) on EFR32 platform.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
```
|
||||
|
||||
For EFR32MG1™ Mighty Gecko Wireless Starter Kit, this can be done using both the CMake and autotools build systems
|
||||
|
||||
**CMake (preferred)**
|
||||
|
||||
```bash
|
||||
$ ./script/cmake-build efr32mg1 -DBOARD=brd4151a
|
||||
...
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: <path-to-openthread>/build/efr32mg1
|
||||
+ [[ -n ot-rcp ]]
|
||||
+ ninja ot-rcp
|
||||
[160/160] Linking CXX executable examples/apps/ncp/ot-rcp
|
||||
+ cd <path-to-openthread>
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/build/efr32mg1/examples`.
|
||||
|
||||
```bash
|
||||
# For linux
|
||||
$ find build/efr32mg1/examples -type f -executable
|
||||
build/efr32mg1/examples/apps/ncp/ot-rcp
|
||||
|
||||
# For BSD/Darwin/mac systems
|
||||
$ find build/efr32mg1/examples -type f -perm +111
|
||||
build/efr32mg1/examples/apps/ncp/ot-rcp
|
||||
```
|
||||
|
||||
**autotools (soon to be depracated)**
|
||||
|
||||
```bash
|
||||
$ make -f examples/Makefile-efr32mg1 BOARD=BRD4151A
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/output/efr32mg1/bin`.
|
||||
|
||||
## Flash Binaries
|
||||
|
||||
Compiled binaries may be flashed onto the EFR32 using [JLinkGDBServer][jlinkgdbserver]. EFR32 Starter kit mainboard integrates an on-board SEGGER J-Link debugger.
|
||||
|
||||
[jlinkgdbserver]: https://www.segger.com/jlink-gdb-server.html
|
||||
|
||||
```bash
|
||||
$ cd <path-to-JLinkGDBServer>
|
||||
$ sudo ./JLinkGDBServer -if swd -device EFR32MG1PxxxF256
|
||||
$ cd <path-to-openthread>/output/efr32mg1/bin
|
||||
$ arm-none-eabi-gdb ot-cli-ftd
|
||||
$ (gdb) target remote 127.0.0.1:2331
|
||||
$ (gdb) load
|
||||
$ (gdb) monitor reset
|
||||
$ (gdb) c
|
||||
```
|
||||
|
||||
Or Compiled binaries also may be flashed onto the specified EFR32 dev board using [J-Link Commander][j-link-commander].
|
||||
|
||||
[j-link-commander]: https://www.segger.com/products/debug-probes/j-link/tools/j-link-commander/
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/output/efr32mg1/bin
|
||||
$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex
|
||||
$ JLinkExe -device EFR32MG1PxxxF256 -speed 4000 -if SWD -autoconnect 1 -SelectEmuBySN <SerialNo>
|
||||
$ J-Link>loadfile ot-cli-ftd.hex
|
||||
$ J-Link>r
|
||||
$ J-Link>q
|
||||
```
|
||||
|
||||
Note: SerialNo is J-Link serial number. Use the following command to get the serial number of the connected J-Link.
|
||||
|
||||
```bash
|
||||
$ JLinkExe
|
||||
```
|
||||
|
||||
Alternatively Simplicity Commander provides a graphical interface for J-Link Commander.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/output/efr32mg1/bin
|
||||
$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.ihex
|
||||
$ <path-to-simplicity-studio>/developer/adapter_packs/commander/commander
|
||||
```
|
||||
|
||||
In the J-Link Device drop-down list select the serial number of the device to flash. Click the Adapter Connect button. Ensure the Debug Interface drop-down list is set to SWD and click the Target Connect button. Click on the Flash icon on the left side of the window to switch to the flash page. In the Flash MCU pane enter the path of the ot-cli-ftd.s37 file or choose the file with the Browse... button. Click the Flash button located under the Browse... button.
|
||||
|
||||
## Run the example with EFR32MG1 boards
|
||||
|
||||
1. Flash two EFR32 boards with the `CLI example` firmware (as shown above).
|
||||
2. Open terminal to first device `/dev/ttyACM0` (serial port settings: 115200 8-N-1). Type `help` for a list of commands.
|
||||
|
||||
```bash
|
||||
> help
|
||||
help
|
||||
channel
|
||||
childtimeout
|
||||
contextreusedelay
|
||||
extaddr
|
||||
extpanid
|
||||
ipaddr
|
||||
keysequence
|
||||
leaderweight
|
||||
masterkey
|
||||
mode
|
||||
netdata register
|
||||
networkidtimeout
|
||||
networkname
|
||||
panid
|
||||
ping
|
||||
prefix
|
||||
releaserouterid
|
||||
rloc16
|
||||
route
|
||||
routerupgradethreshold
|
||||
scan
|
||||
start
|
||||
state
|
||||
stop
|
||||
```
|
||||
|
||||
3. Start a Thread network as Leader.
|
||||
|
||||
```bash
|
||||
> dataset init new
|
||||
Done
|
||||
> dataset
|
||||
Active Timestamp: 1
|
||||
Channel: 13
|
||||
Channel Mask: 0x07fff800
|
||||
Ext PAN ID: d63e8e3e495ebbc3
|
||||
Mesh Local Prefix: fd3d:b50b:f96d:722d::/64
|
||||
Master Key: dfd34f0f05cad978ec4e32b0413038ff
|
||||
Network Name: OpenThread-8f28
|
||||
PAN ID: 0x8f28
|
||||
PSKc: c23a76e98f1a6483639b1ac1271e2e27
|
||||
Security Policy: 0, onrcb
|
||||
Done
|
||||
> dataset commit active
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
leader
|
||||
Done
|
||||
```
|
||||
|
||||
4. Open terminal to second device `/dev/ttyACM1` (serial port settings: 115200 8-N-1) and attach it to the Thread network as a Router.
|
||||
|
||||
```bash
|
||||
> dataset masterkey dfd34f0f05cad978ec4e32b0413038ff
|
||||
Done
|
||||
> dataset commit active
|
||||
Done
|
||||
> routerselectionjitter 1
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
router
|
||||
Done
|
||||
```
|
||||
|
||||
5. List all IPv6 addresses of Leader.
|
||||
|
||||
```bash
|
||||
> ipaddr
|
||||
fd3d:b50b:f96d:722d:0:ff:fe00:fc00
|
||||
fd3d:b50b:f96d:722d:0:ff:fe00:c00
|
||||
fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
|
||||
fe80:0:0:0:6c41:9001:f3d6:4148
|
||||
Done
|
||||
```
|
||||
|
||||
6. Send an ICMPv6 ping to Leader's Mesh-EID IPv6 address.
|
||||
|
||||
```bash
|
||||
> ping fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
|
||||
16 bytes from fd3d:b50b:f96d:722d:558:f56b:d688:799: icmp_seq=1 hlim=64 time=24ms
|
||||
```
|
||||
|
||||
The above example demonstrates basic OpenThread capabilities. Enable more features/roles (e.g. commissioner, joiner, DHCPv6 Server/Client, etc.) by assigning compile-options before compiling.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
$ make -f examples/Makefile-efr32mg1 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1
|
||||
```
|
||||
|
||||
For a list of all available commands, visit [OpenThread CLI Reference README.md][cli].
|
||||
|
||||
[cli]: https://github.com/openthread/openthread/blob/main/src/cli/README.md
|
||||
|
||||
## Verification
|
||||
|
||||
The following toolchain has been used for testing and verification:
|
||||
|
||||
- gcc version 7.3.1
|
||||
|
||||
The EFR32 example has been verified with following Flex SDK/RAIL Library version:
|
||||
|
||||
- Flex SDK v3.1.x
|
||||
The OpenThread on EFR32 example has moved to https://github.com/openthread/ot-efr32
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM)
|
||||
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
|
||||
set(CMAKE_RANLIB arm-none-eabi-ranlib)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -fdata-sections -ffunction-sections")
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_ASM_FLAGS_DEBUG "-g")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_ASM_FLAGS_RELEASE "")
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
#endif
|
||||
|
||||
#define RADIO_CONFIG_PA_USES_DCDC 0 /// The PA(s) is(are) fed from VBAT
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,407 +0,0 @@
|
||||
#ifndef HAL_CONFIG_H
|
||||
#define HAL_CONFIG_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ADC0]
|
||||
// [ADC0]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BATTERYMON]
|
||||
// [BATTERYMON]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BULBPWM]
|
||||
// [BULBPWM]$
|
||||
|
||||
// $[BULBPWM_COLOR]
|
||||
// [BULBPWM_COLOR]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (6U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON1_PIN (7U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_LFBCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_CTUNE (0)
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define HAL_CLK_LFACLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_CTUNE (338)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE_TOKEN (0)
|
||||
#define HAL_CLK_HFXO_AUTOSTART (HAL_CLK_HFXO_AUTOSTART_NONE)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[CS5463]
|
||||
// [CS5463]$
|
||||
|
||||
// $[CSEN0]
|
||||
// [CSEN0]$
|
||||
|
||||
// $[DCDC]
|
||||
#define BSP_DCDC_PRESENT (1)
|
||||
|
||||
#define HAL_DCDC_BYPASS (0)
|
||||
#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT
|
||||
// [DCDC]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[GPIO]
|
||||
#define PORTIO_GPIO_SWCLKTCK_PIN (0)
|
||||
#define PORTIO_GPIO_SWCLKTCK_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_DBGROUTE_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_SWDIOTMS_PIN (1)
|
||||
#define PORTIO_GPIO_SWDIOTMS_PORT (gpioPortF)
|
||||
|
||||
#define PORTIO_GPIO_SWV_PIN (2)
|
||||
#define PORTIO_GPIO_SWV_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_SWV_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TCLK_PIN (8)
|
||||
#define PORTIO_GPIO_TCLK_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TCLK_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD0_PIN (9)
|
||||
#define PORTIO_GPIO_TD0_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD0_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD1_PIN (10)
|
||||
#define PORTIO_GPIO_TD1_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD1_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD2_PIN (11)
|
||||
#define PORTIO_GPIO_TD2_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD2_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD3_PIN (12)
|
||||
#define PORTIO_GPIO_TD3_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD3_LOC (0)
|
||||
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
#define PORTIO_I2C0_SCL_PIN (10)
|
||||
#define PORTIO_I2C0_SCL_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SCL_LOC (14)
|
||||
|
||||
#define PORTIO_I2C0_SDA_PIN (11)
|
||||
#define PORTIO_I2C0_SDA_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SDA_LOC (16)
|
||||
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IDAC0]
|
||||
// [IDAC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (4)
|
||||
#define BSP_LED0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_LED1_PIN (5)
|
||||
#define BSP_LED1_PORT (gpioPortF)
|
||||
|
||||
#define HAL_LED_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define HAL_LED_COUNT (2)
|
||||
#define BSP_LED_COUNT (2)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
// [LED]$
|
||||
|
||||
// $[LESENSE]
|
||||
// [LESENSE]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LEUART0]
|
||||
// [LEUART0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[LNA]
|
||||
// [LNA]$
|
||||
|
||||
// $[PA]
|
||||
#define HAL_PA_ENABLE (1)
|
||||
|
||||
#define HAL_PA_RAMP (10)
|
||||
#define HAL_PA_2P4_LOWPOWER (0)
|
||||
#define HAL_PA_POWER (252)
|
||||
#define HAL_PA_VOLTAGE (3300)
|
||||
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
|
||||
// [PA]$
|
||||
|
||||
// $[PCNT0]
|
||||
// [PCNT0]$
|
||||
|
||||
// $[PCNT1]
|
||||
// [PCNT1]$
|
||||
|
||||
// $[PCNT2]
|
||||
// [PCNT2]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
#define PORTIO_PRS_CH4_PIN (13)
|
||||
#define PORTIO_PRS_CH4_PORT (gpioPortD)
|
||||
#define PORTIO_PRS_CH4_LOC (4)
|
||||
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DFRAME_PIN (13)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DFRAME_LOC (6)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (12)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DOUT_LOC (6)
|
||||
|
||||
#define HAL_PTI_ENABLE (1)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (13)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define BSP_PTI_DFRAME_LOC (6)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (12)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortB)
|
||||
#define BSP_PTI_DOUT_LOC (6)
|
||||
|
||||
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
|
||||
#define HAL_PTI_BAUD_RATE (1600000)
|
||||
// [PTI]$
|
||||
|
||||
// $[PYD1698]
|
||||
// [PYD1698]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define HAL_SERIAL_USART0_ENABLE (0)
|
||||
#define HAL_SERIAL_LEUART0_ENABLE (0)
|
||||
#define HAL_SERIAL_USART1_ENABLE (0)
|
||||
#define HAL_SERIAL_USART2_ENABLE (0)
|
||||
#define HAL_SERIAL_USART3_ENABLE (0)
|
||||
#define HAL_SERIAL_RXWAKE_ENABLE (0)
|
||||
#define BSP_SERIAL_APP_CTS_PIN (2)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_CTS_LOC (30)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (1)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RX_LOC (0)
|
||||
|
||||
#define BSP_SERIAL_APP_TX_PIN (0)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_TX_LOC (0)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (3)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RTS_LOC (30)
|
||||
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16)
|
||||
#define HAL_SERIAL_APP_RXSTART (16)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPIDISPLAY]
|
||||
// [SPIDISPLAY]$
|
||||
|
||||
// $[SPINCP]
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[UARTNCP]
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (2)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_CTS_LOC (30)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (3)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RTS_LOC (30)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (1)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RX_LOC (0)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (0)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_TX_LOC (0)
|
||||
|
||||
#define HAL_USART0_ENABLE (1)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (2)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_CTS_LOC (30)
|
||||
|
||||
#define BSP_USART0_RX_PIN (1)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
#define BSP_USART0_RX_LOC (0)
|
||||
|
||||
#define BSP_USART0_TX_PIN (0)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
#define BSP_USART0_TX_LOC (0)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (3)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_RTS_LOC (30)
|
||||
|
||||
#define HAL_USART0_RX_QUEUE_SIZE (128)
|
||||
#define HAL_USART0_BAUD_RATE (115200)
|
||||
#define HAL_USART0_RXSTOP (16)
|
||||
#define HAL_USART0_RXSTART (16)
|
||||
#define HAL_USART0_TX_QUEUE_SIZE (128)
|
||||
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE)
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
#define PORTIO_USART1_CLK_PIN (8)
|
||||
#define PORTIO_USART1_CLK_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CLK_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_CS_PIN (9)
|
||||
#define PORTIO_USART1_CS_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CS_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_RX_PIN (7)
|
||||
#define PORTIO_USART1_RX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_RX_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_TX_PIN (6)
|
||||
#define PORTIO_USART1_TX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_TX_LOC (11)
|
||||
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
#define PORTIO_USART2_CLK_PIN (8)
|
||||
#define PORTIO_USART2_CLK_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_CLK_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_CS_PIN (9)
|
||||
#define PORTIO_USART2_CS_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_CS_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_RX_PIN (7)
|
||||
#define PORTIO_USART2_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_RX_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_TX_PIN (6)
|
||||
#define PORTIO_USART2_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_TX_LOC (1)
|
||||
|
||||
// [USART2]$
|
||||
|
||||
// $[USART3]
|
||||
#define PORTIO_USART3_CTS_PIN (8)
|
||||
#define PORTIO_USART3_CTS_PORT (gpioPortD)
|
||||
#define PORTIO_USART3_CTS_LOC (28)
|
||||
|
||||
#define PORTIO_USART3_RTS_PIN (9)
|
||||
#define PORTIO_USART3_RTS_PORT (gpioPortD)
|
||||
#define PORTIO_USART3_RTS_LOC (28)
|
||||
|
||||
#define PORTIO_USART3_RX_PIN (7)
|
||||
#define PORTIO_USART3_RX_PORT (gpioPortB)
|
||||
#define PORTIO_USART3_RX_LOC (10)
|
||||
|
||||
#define PORTIO_USART3_TX_PIN (6)
|
||||
#define PORTIO_USART3_TX_PORT (gpioPortB)
|
||||
#define PORTIO_USART3_TX_LOC (10)
|
||||
|
||||
// [USART3]$
|
||||
|
||||
// $[VCOM]
|
||||
// [VCOM]$
|
||||
|
||||
// $[VDAC0]
|
||||
// [VDAC0]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
// [WDOG]$
|
||||
|
||||
// $[WTIMER0]
|
||||
// [WTIMER0]$
|
||||
|
||||
// $[WTIMER1]
|
||||
// [WTIMER1]$
|
||||
|
||||
#endif /* HAL_CONFIG_H */
|
||||
@@ -1,68 +0,0 @@
|
||||
// This is an autogenerated config file, any changes to this file will be overwritten
|
||||
|
||||
#ifndef MBEDTLS_CONFIG_AUTOGEN_H
|
||||
#define MBEDTLS_CONFIG_AUTOGEN_H
|
||||
|
||||
#define MBEDTLS_ECP_MAX_BITS 256
|
||||
|
||||
#define MBEDTLS_MPI_MAX_SIZE 32
|
||||
|
||||
#define MBEDTLS_AES_C
|
||||
#define MBEDTLS_CIPHER_MODE_CTR
|
||||
#define MBEDTLS_CIPHER_MODE_CBC
|
||||
#define MBEDTLS_CIPHER_MODE_CFB
|
||||
#define MBEDTLS_ASN1_PARSE_C
|
||||
#define MBEDTLS_ASN1_WRITE_C
|
||||
#define MBEDTLS_BASE64_C
|
||||
#define MBEDTLS_CCM_C
|
||||
#define MBEDTLS_CIPHER_C
|
||||
#define MBEDTLS_CMAC_C
|
||||
#define MBEDTLS_SSL_PROTO_DTLS
|
||||
#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
|
||||
#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
|
||||
#define MBEDTLS_SSL_COOKIE_C
|
||||
#define MBEDTLS_ECP_C
|
||||
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
#define MBEDTLS_ECDH_C
|
||||
#define MBEDTLS_ECDH_LEGACY_CONTEXT
|
||||
#define MBEDTLS_ECDSA_C
|
||||
#define MBEDTLS_ENTROPY_ADC_C
|
||||
#define MBEDTLS_ENTROPY_HARDWARE_ALT
|
||||
#define MBEDTLS_MD_C
|
||||
#define MBEDTLS_ECJPAKE_C
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
||||
#define MBEDTLS_BIGNUM_C
|
||||
#define MBEDTLS_PEM_PARSE_C
|
||||
#define MBEDTLS_ENTROPY_C
|
||||
#define MBEDTLS_ENTROPY_FORCE_SHA256
|
||||
#define MBEDTLS_ENTROPY_MAX_SOURCES 2
|
||||
#define MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
#define MBEDTLS_CTR_DRBG_C
|
||||
#define MBEDTLS_SHA256_C
|
||||
#define MBEDTLS_SSL_TLS_C
|
||||
#define MBEDTLS_SSL_CLI_C
|
||||
#define MBEDTLS_SSL_PROTO_TLS1_2
|
||||
#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
|
||||
#define MBEDTLS_SSL_SRV_C
|
||||
#define MBEDTLS_X509_USE_C
|
||||
#define MBEDTLS_X509_CRT_PARSE_C
|
||||
#define MBEDTLS_X509_CRL_PARSE_C
|
||||
#define MBEDTLS_X509_CSR_PARSE_C
|
||||
#define MBEDTLS_OID_C
|
||||
#define MBEDTLS_PK_C
|
||||
#define MBEDTLS_PK_PARSE_C
|
||||
#define MBEDTLS_PSA_CRYPTO_DRIVERS
|
||||
|
||||
#include "config-device-acceleration.h"
|
||||
|
||||
#if !defined(TEST_SUITE_MEMORY_BUFFER_ALLOC)
|
||||
#include "sl_malloc.h"
|
||||
|
||||
#define MBEDTLS_PLATFORM_FREE_MACRO sl_free
|
||||
#define MBEDTLS_PLATFORM_CALLOC_MACRO sl_calloc
|
||||
#endif
|
||||
|
||||
#define MBEDTLS_PLATFORM_MEMORY
|
||||
#define MBEDTLS_PLATFORM_C
|
||||
|
||||
#endif
|
||||
@@ -1,246 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread linker script for the
|
||||
* Silicon Labs efr32mg1 platform.
|
||||
*
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
|
||||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapBase
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __Vectors_End
|
||||
* __Vectors_Size
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
__Vectors_End = .;
|
||||
__Vectors_Size = __Vectors_End - __Vectors;
|
||||
__end__ = .;
|
||||
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG (__data2_end__ - __data2_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
LONG (__bss2_start__)
|
||||
LONG (__bss2_end__ - __bss2_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
__etext = .;
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
. = ALIGN (4);
|
||||
PROVIDE (__ram_func_section_start = .);
|
||||
*(.ram)
|
||||
PROVIDE (__ram_func_section_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM
|
||||
|
||||
.heap (COPY):
|
||||
{
|
||||
__HeapBase = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
_end = __end__;
|
||||
KEEP(*(.heap*))
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy (COPY):
|
||||
{
|
||||
KEEP(*(.stack*))
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/*******************************************************************/
|
||||
/* Define flash block for nvm3 */
|
||||
.nvm (DSECT) : {
|
||||
KEEP(*(.simee*))
|
||||
} > FLASH
|
||||
|
||||
linker_nvm_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
||||
linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm);
|
||||
linker_nvm_size = SIZEOF(.nvm);
|
||||
__nvm3Base = linker_nvm_begin;
|
||||
/*******************************************************************/
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
|
||||
/* Check if FLASH usage exceeds FLASH size */
|
||||
ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32_platform_defs.am
|
||||
|
||||
lib_LIBRARIES = libopenthread-efr32mg12.a
|
||||
|
||||
libopenthread_efr32mg12_a_CPPFLAGS = \
|
||||
-DPLATFORM_HEADER=\"platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
|
||||
-Wno-sign-compare \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/$(BOARD_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
$(SILABS_EFR32MG12_CPPFLAGS) \
|
||||
$(SILABS_GSDK_CPPFLAGS) \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
$(NULL)
|
||||
|
||||
PLATFORM_SOURCES = \
|
||||
$(NULL)
|
||||
|
||||
noinst_HEADERS = \
|
||||
src/platform-band.h \
|
||||
src/platform-efr32.h \
|
||||
$(NULL)
|
||||
|
||||
libopenthread_efr32mg12_a_SOURCES = \
|
||||
$(PLATFORM_COMMON_SOURCES_LIST) \
|
||||
$(PLATFORM_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
Dash = -
|
||||
libopenthread_efr32mg12_a_LIBADD = \
|
||||
$(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") \
|
||||
$(shell find $(top_builddir)/third_party/jlink/SEGGER_RTT_V640/RTT $(Dash)type f $(Dash)name "*.o")
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# efr32mg12 platform-specific Makefile
|
||||
#
|
||||
|
||||
LDADD_COMMON += \
|
||||
$(top_srcdir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a \
|
||||
$(NULL)
|
||||
@@ -1,300 +1 @@
|
||||
# OpenThread on EFR32MG12 Example
|
||||
|
||||
This directory contains example platform drivers for the [Silicon Labs EFR32MG12][efr32mg12] based on [EFR32™ Mighty Gecko Wireless Starter Kit][slwstk6000b] or [Thunderboard™ Sense 2 Sensor-to-Cloud Advanced IoT Development Kit][sltb004a].
|
||||
|
||||
[efr32mg]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc
|
||||
[slwstk6000b]: http://www.silabs.com/products/development-tools/wireless/mesh-networking/mighty-gecko-starter-kit
|
||||
[sltb004a]: https://www.silabs.com/products/development-tools/thunderboard/thunderboard-sense-two-kit
|
||||
|
||||
The example platform drivers are intended to present the minimal code necessary to support OpenThread. [EFR32MG12P SoC][efr32mg12p] has rich memory and peripheral resources which can support all OpenThread capabilities. See the "Run the example with EFR32MG12 boards" section below for an example using basic OpenThread capabilities.
|
||||
|
||||
See [sleepy-demo/README.md](sleepy-demo/README.md) for instructions for an example that uses the low-energy modes of the EFR32MG12 when running as a Sleepy End Device.
|
||||
|
||||
[efr32mg12p]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc/device.EFR32MG12P432F1024GL125
|
||||
|
||||
## Toolchain
|
||||
|
||||
Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
|
||||
|
||||
[gnu-toolchain]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
|
||||
|
||||
In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./script/bootstrap
|
||||
```
|
||||
|
||||
## Build Examples
|
||||
|
||||
1. Download and install the [Simplicity Studio][simplicity_studio].
|
||||
|
||||
[simplicity_studio]: http://www.silabs.com/products/development-tools/software/simplicity-studio
|
||||
|
||||
2. Install Flex (Gecko) SDK including RAIL Library from Simplicity Studio.
|
||||
- Connect EFR32MG12P Wireless Starter Kit to Simplicity Studio.
|
||||
- Find Flex SDK v3.1 in the Software Update page and click Install.
|
||||
- Flex SDK v3.1 will be installed in the path:
|
||||
- Mac
|
||||
- `/Applications/Simplicity\ Studio.app/Contents/Eclipse/developer/sdks/gecko_sdk_suite`
|
||||
- Windows
|
||||
- `C:\SiliconLabs\SimplicityStudio\v5\developer\sdks\gecko_sdk_suite`
|
||||
- Linux
|
||||
- `./SimplicityStudio_v5/developer/sdks/gecko_sdk_suite`
|
||||
|
||||
For more information on configuring, building, and installing applications for the Wireless Gecko (EFR32) portfolio using FLEX, see [Getting Started with the Silicon Labs Flex Software Development Kit for the Wireless Gecko (EFR32™) Portfolio][qsg138]. For more information on RAIL, see [Radio Abstraction Interface Layer][rail].
|
||||
|
||||
[qsg138]: https://www.silabs.com/documents/public/quick-start-guides/qsg138-flex-efr32.pdf
|
||||
[rail]: http://www.silabs.com/products/development-tools/software/radio-abstraction-interface-layer-sdk
|
||||
|
||||
3. Configure the path to Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/third_party
|
||||
$ mkdir silabs
|
||||
$ cd <path-to-Simplicity-Studio>/developer/sdks
|
||||
$ cp -rf gecko_sdk_suite <path-to-openthread>/third_party/silabs/
|
||||
```
|
||||
|
||||
Alternatively create a symbolic link to the Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/third_party
|
||||
$ mkdir silabs
|
||||
$ ln -s <path-to-Simplicity-Studio>/developer/sdks/gecko_sdk_suite silabs/gecko_sdk_suite
|
||||
```
|
||||
|
||||
4. Build OpenThread Firmware (CLI example) on EFR32 platform.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
```
|
||||
|
||||
For EFR32MG12™ Mighty Gecko Wireless Starter Kit, this can be done using both the CMake and autotools build systems
|
||||
|
||||
**CMake (preferred)**
|
||||
|
||||
```bash
|
||||
$ ./script/cmake-build efr32mg12 -DBOARD=brd4161a
|
||||
...
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: <path-to-openthread>/build/efr32mg12
|
||||
+ [[ -n ot-rcp ot-cli-ftd ot-cli-mtd ot-ncp-ftd ot-ncp-mtd sleepy-demo-ftd sleepy-demo-mtd ]]
|
||||
+ ninja ot-rcp ot-cli-ftd ot-cli-mtd ot-ncp-ftd ot-ncp-mtd sleepy-demo-ftd sleepy-demo-mtd
|
||||
[572/572] Linking CXX executable examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/sleepy-demo-ftd
|
||||
+ cd <path-to-openthread>
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/build/efr32mg12/examples`.
|
||||
|
||||
```bash
|
||||
# For linux
|
||||
$ find build/efr32mg12/examples -type f -executable
|
||||
build/efr32mg12/examples/apps/cli/ot-cli-mtd
|
||||
build/efr32mg12/examples/apps/cli/ot-cli-ftd
|
||||
build/efr32mg12/examples/apps/ncp/ot-ncp-ftd
|
||||
build/efr32mg12/examples/apps/ncp/ot-ncp-mtd
|
||||
build/efr32mg12/examples/apps/ncp/ot-rcp
|
||||
build/efr32mg12/examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/sleepy-demo-ftd
|
||||
build/efr32mg12/examples/platforms/efr32/sleepy-demo/sleepy-demo-mtd/sleepy-demo-mtd
|
||||
|
||||
# For BSD/Darwin/mac systems
|
||||
$ find build/efr32mg12/examples -type f -perm +111
|
||||
build/efr32mg12/examples/apps/cli/ot-cli-mtd
|
||||
build/efr32mg12/examples/apps/cli/ot-cli-ftd
|
||||
build/efr32mg12/examples/apps/ncp/ot-ncp-ftd
|
||||
build/efr32mg12/examples/apps/ncp/ot-ncp-mtd
|
||||
build/efr32mg12/examples/apps/ncp/ot-rcp
|
||||
build/efr32mg12/examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/sleepy-demo-ftd
|
||||
build/efr32mg12/examples/platforms/efr32/sleepy-demo/sleepy-demo-mtd/sleepy-demo-mtd
|
||||
```
|
||||
|
||||
**autotools (soon to be depracated)**
|
||||
|
||||
```bash
|
||||
$ make -f examples/Makefile-efr32mg12 BOARD=BRD4161A
|
||||
```
|
||||
|
||||
or alternatively for the Thunderboard™ Sense 2:
|
||||
|
||||
```bash
|
||||
$ make -f examples/Makefile-efr32mg12 BOARD=BRD4166A
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/output/efr32mg12/bin`.
|
||||
|
||||
## Flash Binaries
|
||||
|
||||
Compiled binaries may be flashed onto the EFR32 using [JLinkGDBServer][jlinkgdbserver]. EFR32 Starter kit mainboard integrates an on-board SEGGER J-Link debugger.
|
||||
|
||||
[jlinkgdbserver]: https://www.segger.com/jlink-gdb-server.html
|
||||
|
||||
```bash
|
||||
$ cd <path-to-JLinkGDBServer>
|
||||
$ sudo ./JLinkGDBServer -if swd -device EFR32MG12PxxxF1024
|
||||
$ cd <path-to-openthread>/output/efr32/bin
|
||||
$ arm-none-eabi-gdb ot-cli-ftd
|
||||
$ (gdb) target remote 127.0.0.1:2331
|
||||
$ (gdb) load
|
||||
$ (gdb) monitor reset
|
||||
$ (gdb) c
|
||||
```
|
||||
|
||||
Note: Support for the "EFR32MG12PxxxF1024" device was added to JLinkGDBServer V6.14d.
|
||||
|
||||
Or Compiled binaries also may be flashed onto the specified EFR32 dev board using [J-Link Commander][j-link-commander].
|
||||
|
||||
[j-link-commander]: https://www.segger.com/products/debug-probes/j-link/tools/j-link-commander/
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/output/efr32mg12/bin
|
||||
$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex
|
||||
$ JLinkExe -device EFR32MG12PxxxF1024 -speed 4000 -if SWD -autoconnect 1 -SelectEmuBySN <SerialNo>
|
||||
$ J-Link>loadfile ot-cli-ftd.hex
|
||||
$ J-Link>r
|
||||
$ J-Link>q
|
||||
```
|
||||
|
||||
Note: SerialNo is J-Link serial number. Use the following command to get the serial number of the connected J-Link.
|
||||
|
||||
```bash
|
||||
$ JLinkExe
|
||||
```
|
||||
|
||||
Alternatively Simplicity Commander provides a graphical interface for J-Link Commander.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/output/efr32mg12/bin
|
||||
$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.ihex
|
||||
$ <path-to-simplicity-studio>/developer/adapter_packs/commander/commander
|
||||
```
|
||||
|
||||
In the J-Link Device drop-down list select the serial number of the device to flash. Click the Adapter Connect button. Ensure the Debug Interface drop-down list is set to SWD and click the Target Connect button. Click on the Flash icon on the left side of the window to switch to the flash page. In the Flash MCU pane enter the path of the ot-cli-ftd.s37 file or choose the file with the Browse... button. Click the Flash button located under the Browse... button.
|
||||
|
||||
## Run the example with EFR32MG12 boards
|
||||
|
||||
1. Flash two EFR32 boards with the `CLI example` firmware (as shown above).
|
||||
2. Open terminal to first device `/dev/ttyACM0` (serial port settings: 115200 8-N-1). Type `help` for a list of commands.
|
||||
|
||||
```bash
|
||||
> help
|
||||
help
|
||||
channel
|
||||
childtimeout
|
||||
contextreusedelay
|
||||
extaddr
|
||||
extpanid
|
||||
ipaddr
|
||||
keysequence
|
||||
leaderweight
|
||||
masterkey
|
||||
mode
|
||||
netdata register
|
||||
networkidtimeout
|
||||
networkname
|
||||
panid
|
||||
ping
|
||||
prefix
|
||||
releaserouterid
|
||||
rloc16
|
||||
route
|
||||
routerupgradethreshold
|
||||
scan
|
||||
start
|
||||
state
|
||||
stop
|
||||
```
|
||||
|
||||
3. Start a Thread network as Leader.
|
||||
|
||||
```bash
|
||||
> dataset init new
|
||||
Done
|
||||
> dataset
|
||||
Active Timestamp: 1
|
||||
Channel: 13
|
||||
Channel Mask: 0x07fff800
|
||||
Ext PAN ID: d63e8e3e495ebbc3
|
||||
Mesh Local Prefix: fd3d:b50b:f96d:722d::/64
|
||||
Master Key: dfd34f0f05cad978ec4e32b0413038ff
|
||||
Network Name: OpenThread-8f28
|
||||
PAN ID: 0x8f28
|
||||
PSKc: c23a76e98f1a6483639b1ac1271e2e27
|
||||
Security Policy: 0, onrcb
|
||||
Done
|
||||
> dataset commit active
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
leader
|
||||
Done
|
||||
```
|
||||
|
||||
4. Open terminal to second device `/dev/ttyACM1` (serial port settings: 115200 8-N-1) and attach it to the Thread network as a Router.
|
||||
|
||||
```bash
|
||||
> dataset masterkey dfd34f0f05cad978ec4e32b0413038ff
|
||||
Done
|
||||
> dataset commit active
|
||||
Done
|
||||
> routerselectionjitter 1
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
router
|
||||
Done
|
||||
```
|
||||
|
||||
5. List all IPv6 addresses of Leader.
|
||||
|
||||
```bash
|
||||
> ipaddr
|
||||
fd3d:b50b:f96d:722d:0:ff:fe00:fc00
|
||||
fd3d:b50b:f96d:722d:0:ff:fe00:c00
|
||||
fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
|
||||
fe80:0:0:0:6c41:9001:f3d6:4148
|
||||
Done
|
||||
```
|
||||
|
||||
6. Send an ICMPv6 ping to Leader's Mesh-EID IPv6 address.
|
||||
|
||||
```bash
|
||||
> ping fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
|
||||
16 bytes from fd3d:b50b:f96d:722d:558:f56b:d688:799: icmp_seq=1 hlim=64 time=24ms
|
||||
```
|
||||
|
||||
The above example demonstrates basic OpenThread capabilities. Enable more features/roles (e.g. commissioner, joiner, DHCPv6 Server/Client, etc.) by assigning compile-options before compiling.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
$ make -f examples/Makefile-efr32mg12 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1
|
||||
```
|
||||
|
||||
For a list of all available commands, visit [OpenThread CLI Reference README.md][cli].
|
||||
|
||||
[cli]: https://github.com/openthread/openthread/blob/main/src/cli/README.md
|
||||
|
||||
## Verification
|
||||
|
||||
The following toolchain has been used for testing and verification:
|
||||
|
||||
- gcc version 7.3.1
|
||||
|
||||
The EFR32 example has been verified with following Flex SDK/RAIL Library version:
|
||||
|
||||
- Flex SDK v3.1.x
|
||||
The OpenThread on EFR32 example has moved to https://github.com/openthread/ot-efr32
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM)
|
||||
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
|
||||
set(CMAKE_RANLIB arm-none-eabi-ranlib)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -fdata-sections -ffunction-sections")
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_ASM_FLAGS_DEBUG "-g")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_ASM_FLAGS_RELEASE "")
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
#endif
|
||||
|
||||
#define RADIO_CONFIG_PA_USES_DCDC 0 /// The PA(s) is(are) fed from VBAT
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,407 +0,0 @@
|
||||
#ifndef HAL_CONFIG_H
|
||||
#define HAL_CONFIG_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ADC0]
|
||||
// [ADC0]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BATTERYMON]
|
||||
// [BATTERYMON]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BULBPWM]
|
||||
// [BULBPWM]$
|
||||
|
||||
// $[BULBPWM_COLOR]
|
||||
// [BULBPWM_COLOR]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (6U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON1_PIN (7U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_LFBCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_CTUNE (0)
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define HAL_CLK_LFACLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_CTUNE (338)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE_TOKEN (0)
|
||||
#define HAL_CLK_HFXO_AUTOSTART (HAL_CLK_HFXO_AUTOSTART_NONE)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[CS5463]
|
||||
// [CS5463]$
|
||||
|
||||
// $[CSEN0]
|
||||
// [CSEN0]$
|
||||
|
||||
// $[DCDC]
|
||||
#define BSP_DCDC_PRESENT (1)
|
||||
|
||||
#define HAL_DCDC_BYPASS (0)
|
||||
#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT
|
||||
// [DCDC]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[GPIO]
|
||||
#define PORTIO_GPIO_SWCLKTCK_PIN (0)
|
||||
#define PORTIO_GPIO_SWCLKTCK_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_DBGROUTE_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_SWDIOTMS_PIN (1)
|
||||
#define PORTIO_GPIO_SWDIOTMS_PORT (gpioPortF)
|
||||
|
||||
#define PORTIO_GPIO_SWV_PIN (2)
|
||||
#define PORTIO_GPIO_SWV_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_SWV_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TCLK_PIN (8)
|
||||
#define PORTIO_GPIO_TCLK_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TCLK_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD0_PIN (9)
|
||||
#define PORTIO_GPIO_TD0_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD0_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD1_PIN (10)
|
||||
#define PORTIO_GPIO_TD1_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD1_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD2_PIN (11)
|
||||
#define PORTIO_GPIO_TD2_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD2_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD3_PIN (12)
|
||||
#define PORTIO_GPIO_TD3_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD3_LOC (0)
|
||||
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
#define PORTIO_I2C0_SCL_PIN (10)
|
||||
#define PORTIO_I2C0_SCL_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SCL_LOC (14)
|
||||
|
||||
#define PORTIO_I2C0_SDA_PIN (11)
|
||||
#define PORTIO_I2C0_SDA_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SDA_LOC (16)
|
||||
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IDAC0]
|
||||
// [IDAC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (4)
|
||||
#define BSP_LED0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_LED1_PIN (5)
|
||||
#define BSP_LED1_PORT (gpioPortF)
|
||||
|
||||
#define HAL_LED_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define HAL_LED_COUNT (2)
|
||||
#define BSP_LED_COUNT (2)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
// [LED]$
|
||||
|
||||
// $[LESENSE]
|
||||
// [LESENSE]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LEUART0]
|
||||
// [LEUART0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[LNA]
|
||||
// [LNA]$
|
||||
|
||||
// $[PA]
|
||||
#define HAL_PA_ENABLE (1)
|
||||
|
||||
#define HAL_PA_RAMP (10)
|
||||
#define HAL_PA_2P4_LOWPOWER (0)
|
||||
#define HAL_PA_POWER (252)
|
||||
#define HAL_PA_VOLTAGE (3300)
|
||||
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
|
||||
// [PA]$
|
||||
|
||||
// $[PCNT0]
|
||||
// [PCNT0]$
|
||||
|
||||
// $[PCNT1]
|
||||
// [PCNT1]$
|
||||
|
||||
// $[PCNT2]
|
||||
// [PCNT2]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
#define PORTIO_PRS_CH4_PIN (13)
|
||||
#define PORTIO_PRS_CH4_PORT (gpioPortD)
|
||||
#define PORTIO_PRS_CH4_LOC (4)
|
||||
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DFRAME_PIN (13)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DFRAME_LOC (6)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (12)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DOUT_LOC (6)
|
||||
|
||||
#define HAL_PTI_ENABLE (1)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (13)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define BSP_PTI_DFRAME_LOC (6)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (12)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortB)
|
||||
#define BSP_PTI_DOUT_LOC (6)
|
||||
|
||||
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
|
||||
#define HAL_PTI_BAUD_RATE (1600000)
|
||||
// [PTI]$
|
||||
|
||||
// $[PYD1698]
|
||||
// [PYD1698]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define HAL_SERIAL_USART0_ENABLE (0)
|
||||
#define HAL_SERIAL_LEUART0_ENABLE (0)
|
||||
#define HAL_SERIAL_USART1_ENABLE (0)
|
||||
#define HAL_SERIAL_USART2_ENABLE (0)
|
||||
#define HAL_SERIAL_USART3_ENABLE (0)
|
||||
#define HAL_SERIAL_RXWAKE_ENABLE (0)
|
||||
#define BSP_SERIAL_APP_CTS_PIN (2)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_CTS_LOC (30)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (1)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RX_LOC (0)
|
||||
|
||||
#define BSP_SERIAL_APP_TX_PIN (0)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_TX_LOC (0)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (3)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RTS_LOC (30)
|
||||
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16)
|
||||
#define HAL_SERIAL_APP_RXSTART (16)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPIDISPLAY]
|
||||
// [SPIDISPLAY]$
|
||||
|
||||
// $[SPINCP]
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[UARTNCP]
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (2)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_CTS_LOC (30)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (3)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RTS_LOC (30)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (1)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RX_LOC (0)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (0)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_TX_LOC (0)
|
||||
|
||||
#define HAL_USART0_ENABLE (1)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (2)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_CTS_LOC (30)
|
||||
|
||||
#define BSP_USART0_RX_PIN (1)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
#define BSP_USART0_RX_LOC (0)
|
||||
|
||||
#define BSP_USART0_TX_PIN (0)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
#define BSP_USART0_TX_LOC (0)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (3)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_RTS_LOC (30)
|
||||
|
||||
#define HAL_USART0_RX_QUEUE_SIZE (128)
|
||||
#define HAL_USART0_BAUD_RATE (115200)
|
||||
#define HAL_USART0_RXSTOP (16)
|
||||
#define HAL_USART0_RXSTART (16)
|
||||
#define HAL_USART0_TX_QUEUE_SIZE (128)
|
||||
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE)
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
#define PORTIO_USART1_CLK_PIN (8)
|
||||
#define PORTIO_USART1_CLK_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CLK_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_CS_PIN (9)
|
||||
#define PORTIO_USART1_CS_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CS_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_RX_PIN (7)
|
||||
#define PORTIO_USART1_RX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_RX_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_TX_PIN (6)
|
||||
#define PORTIO_USART1_TX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_TX_LOC (11)
|
||||
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
#define PORTIO_USART2_CLK_PIN (8)
|
||||
#define PORTIO_USART2_CLK_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_CLK_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_CS_PIN (9)
|
||||
#define PORTIO_USART2_CS_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_CS_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_RX_PIN (7)
|
||||
#define PORTIO_USART2_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_RX_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_TX_PIN (6)
|
||||
#define PORTIO_USART2_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_TX_LOC (1)
|
||||
|
||||
// [USART2]$
|
||||
|
||||
// $[USART3]
|
||||
#define PORTIO_USART3_CTS_PIN (8)
|
||||
#define PORTIO_USART3_CTS_PORT (gpioPortD)
|
||||
#define PORTIO_USART3_CTS_LOC (28)
|
||||
|
||||
#define PORTIO_USART3_RTS_PIN (9)
|
||||
#define PORTIO_USART3_RTS_PORT (gpioPortD)
|
||||
#define PORTIO_USART3_RTS_LOC (28)
|
||||
|
||||
#define PORTIO_USART3_RX_PIN (7)
|
||||
#define PORTIO_USART3_RX_PORT (gpioPortB)
|
||||
#define PORTIO_USART3_RX_LOC (10)
|
||||
|
||||
#define PORTIO_USART3_TX_PIN (6)
|
||||
#define PORTIO_USART3_TX_PORT (gpioPortB)
|
||||
#define PORTIO_USART3_TX_LOC (10)
|
||||
|
||||
// [USART3]$
|
||||
|
||||
// $[VCOM]
|
||||
// [VCOM]$
|
||||
|
||||
// $[VDAC0]
|
||||
// [VDAC0]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
// [WDOG]$
|
||||
|
||||
// $[WTIMER0]
|
||||
// [WTIMER0]$
|
||||
|
||||
// $[WTIMER1]
|
||||
// [WTIMER1]$
|
||||
|
||||
#endif /* HAL_CONFIG_H */
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
#endif
|
||||
|
||||
#define RADIO_CONFIG_PA_USES_DCDC 1 /// The PA(s) is(are) fed from the DCDC
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,407 +0,0 @@
|
||||
#ifndef HAL_CONFIG_H
|
||||
#define HAL_CONFIG_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ADC0]
|
||||
// [ADC0]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BATTERYMON]
|
||||
// [BATTERYMON]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BULBPWM]
|
||||
// [BULBPWM]$
|
||||
|
||||
// $[BULBPWM_COLOR]
|
||||
// [BULBPWM_COLOR]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (14U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortD)
|
||||
|
||||
#define BSP_BUTTON1_PIN (15U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortD)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_LFBCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_CTUNE (32U)
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define HAL_CLK_LFACLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_CTUNE (332)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE_TOKEN (0)
|
||||
#define HAL_CLK_HFXO_AUTOSTART (HAL_CLK_HFXO_AUTOSTART_NONE)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[CS5463]
|
||||
// [CS5463]$
|
||||
|
||||
// $[CSEN0]
|
||||
// [CSEN0]$
|
||||
|
||||
// $[DCDC]
|
||||
#define BSP_DCDC_PRESENT (1)
|
||||
|
||||
#define HAL_DCDC_BYPASS (0)
|
||||
#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT
|
||||
// [DCDC]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[GPIO]
|
||||
#define PORTIO_GPIO_SWCLKTCK_PIN (0)
|
||||
#define PORTIO_GPIO_SWCLKTCK_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_DBGROUTE_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_SWDIOTMS_PIN (1)
|
||||
#define PORTIO_GPIO_SWDIOTMS_PORT (gpioPortF)
|
||||
|
||||
#define PORTIO_GPIO_SWV_PIN (2)
|
||||
#define PORTIO_GPIO_SWV_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_SWV_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TCLK_PIN (8)
|
||||
#define PORTIO_GPIO_TCLK_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TCLK_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD0_PIN (9)
|
||||
#define PORTIO_GPIO_TD0_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD0_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD1_PIN (10)
|
||||
#define PORTIO_GPIO_TD1_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD1_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD2_PIN (11)
|
||||
#define PORTIO_GPIO_TD2_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD2_LOC (0)
|
||||
|
||||
#define PORTIO_GPIO_TD3_PIN (12)
|
||||
#define PORTIO_GPIO_TD3_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_TD3_LOC (0)
|
||||
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
#define PORTIO_I2C0_SCL_PIN (10)
|
||||
#define PORTIO_I2C0_SCL_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SCL_LOC (14)
|
||||
|
||||
#define PORTIO_I2C0_SDA_PIN (11)
|
||||
#define PORTIO_I2C0_SDA_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SDA_LOC (16)
|
||||
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IDAC0]
|
||||
// [IDAC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (8)
|
||||
#define BSP_LED0_PORT (gpioPortD)
|
||||
|
||||
#define BSP_LED1_PIN (9)
|
||||
#define BSP_LED1_PORT (gpioPortD)
|
||||
|
||||
#define HAL_LED_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define HAL_LED_COUNT (2)
|
||||
#define BSP_LED_COUNT (2)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
// [LED]$
|
||||
|
||||
// $[LESENSE]
|
||||
// [LESENSE]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LEUART0]
|
||||
// [LEUART0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[LNA]
|
||||
// [LNA]$
|
||||
|
||||
// $[PA]
|
||||
#define HAL_PA_ENABLE (1)
|
||||
|
||||
#define HAL_PA_RAMP (10)
|
||||
#define HAL_PA_2P4_LOWPOWER (0)
|
||||
#define HAL_PA_POWER (252)
|
||||
#define HAL_PA_VOLTAGE (3300)
|
||||
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
|
||||
// [PA]$
|
||||
|
||||
// $[PCNT0]
|
||||
// [PCNT0]$
|
||||
|
||||
// $[PCNT1]
|
||||
// [PCNT1]$
|
||||
|
||||
// $[PCNT2]
|
||||
// [PCNT2]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
#define PORTIO_PRS_CH4_PIN (13)
|
||||
#define PORTIO_PRS_CH4_PORT (gpioPortD)
|
||||
#define PORTIO_PRS_CH4_LOC (4)
|
||||
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DFRAME_PIN (13)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DFRAME_LOC (6)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (12)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DOUT_LOC (6)
|
||||
|
||||
#define HAL_PTI_ENABLE (1)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (13)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define BSP_PTI_DFRAME_LOC (6)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (12)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortB)
|
||||
#define BSP_PTI_DOUT_LOC (6)
|
||||
|
||||
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
|
||||
#define HAL_PTI_BAUD_RATE (1600000)
|
||||
// [PTI]$
|
||||
|
||||
// $[PYD1698]
|
||||
// [PYD1698]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define HAL_SERIAL_USART0_ENABLE (0)
|
||||
#define HAL_SERIAL_LEUART0_ENABLE (0)
|
||||
#define HAL_SERIAL_USART1_ENABLE (0)
|
||||
#define HAL_SERIAL_USART2_ENABLE (0)
|
||||
#define HAL_SERIAL_USART3_ENABLE (0)
|
||||
#define HAL_SERIAL_RXWAKE_ENABLE (0)
|
||||
#define BSP_SERIAL_APP_CTS_PIN (2)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_CTS_LOC (30)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (1)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RX_LOC (0)
|
||||
|
||||
#define BSP_SERIAL_APP_TX_PIN (0)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_TX_LOC (0)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (3)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RTS_LOC (30)
|
||||
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16)
|
||||
#define HAL_SERIAL_APP_RXSTART (16)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPIDISPLAY]
|
||||
// [SPIDISPLAY]$
|
||||
|
||||
// $[SPINCP]
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[UARTNCP]
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (2)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_CTS_LOC (30)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (3)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RTS_LOC (30)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (1)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RX_LOC (0)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (0)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_TX_LOC (0)
|
||||
|
||||
#define HAL_USART0_ENABLE (1)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (2)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_CTS_LOC (30)
|
||||
|
||||
#define BSP_USART0_RX_PIN (1)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
#define BSP_USART0_RX_LOC (0)
|
||||
|
||||
#define BSP_USART0_TX_PIN (0)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
#define BSP_USART0_TX_LOC (0)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (3)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_RTS_LOC (30)
|
||||
|
||||
#define HAL_USART0_RX_QUEUE_SIZE (128)
|
||||
#define HAL_USART0_BAUD_RATE (115200)
|
||||
#define HAL_USART0_RXSTOP (16)
|
||||
#define HAL_USART0_RXSTART (16)
|
||||
#define HAL_USART0_TX_QUEUE_SIZE (128)
|
||||
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE)
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
#define PORTIO_USART1_CLK_PIN (8)
|
||||
#define PORTIO_USART1_CLK_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CLK_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_CS_PIN (9)
|
||||
#define PORTIO_USART1_CS_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CS_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_RX_PIN (7)
|
||||
#define PORTIO_USART1_RX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_RX_LOC (11)
|
||||
|
||||
#define PORTIO_USART1_TX_PIN (6)
|
||||
#define PORTIO_USART1_TX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_TX_LOC (11)
|
||||
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
#define PORTIO_USART2_CLK_PIN (8)
|
||||
#define PORTIO_USART2_CLK_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_CLK_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_CS_PIN (9)
|
||||
#define PORTIO_USART2_CS_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_CS_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_RX_PIN (7)
|
||||
#define PORTIO_USART2_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_RX_LOC (1)
|
||||
|
||||
#define PORTIO_USART2_TX_PIN (6)
|
||||
#define PORTIO_USART2_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART2_TX_LOC (1)
|
||||
|
||||
// [USART2]$
|
||||
|
||||
// $[USART3]
|
||||
#define PORTIO_USART3_CTS_PIN (8)
|
||||
#define PORTIO_USART3_CTS_PORT (gpioPortD)
|
||||
#define PORTIO_USART3_CTS_LOC (28)
|
||||
|
||||
#define PORTIO_USART3_RTS_PIN (9)
|
||||
#define PORTIO_USART3_RTS_PORT (gpioPortD)
|
||||
#define PORTIO_USART3_RTS_LOC (28)
|
||||
|
||||
#define PORTIO_USART3_RX_PIN (7)
|
||||
#define PORTIO_USART3_RX_PORT (gpioPortB)
|
||||
#define PORTIO_USART3_RX_LOC (10)
|
||||
|
||||
#define PORTIO_USART3_TX_PIN (6)
|
||||
#define PORTIO_USART3_TX_PORT (gpioPortB)
|
||||
#define PORTIO_USART3_TX_LOC (10)
|
||||
|
||||
// [USART3]$
|
||||
|
||||
// $[VCOM]
|
||||
// [VCOM]$
|
||||
|
||||
// $[VDAC0]
|
||||
// [VDAC0]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
// [WDOG]$
|
||||
|
||||
// $[WTIMER0]
|
||||
// [WTIMER0]$
|
||||
|
||||
// $[WTIMER1]
|
||||
// [WTIMER1]$
|
||||
|
||||
#endif /* HAL_CONFIG_H */
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
#endif
|
||||
|
||||
#define RADIO_CONFIG_PA_USES_DCDC 0 /// The PA(s) is(are) fed from VBAT
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,331 +0,0 @@
|
||||
#ifndef HAL_CONFIG_H
|
||||
#define HAL_CONFIG_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ADC0]
|
||||
// [ADC0]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BATTERYMON]
|
||||
// [BATTERYMON]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BULBPWM]
|
||||
// [BULBPWM]$
|
||||
|
||||
// $[BULBPWM_COLOR]
|
||||
// [BULBPWM_COLOR]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (6U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON1_PIN (7U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
#define HAL_BUTTON_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define HAL_BUTTON_COUNT (2U)
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_LFBCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_CTUNE (32U)
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define HAL_CLK_LFACLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_CTUNE (342)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE_TOKEN (0)
|
||||
#define HAL_CLK_HFXO_AUTOSTART (HAL_CLK_HFXO_AUTOSTART_NONE)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[CS5463]
|
||||
// [CS5463]$
|
||||
|
||||
// $[CSEN]
|
||||
// [CSEN]$
|
||||
|
||||
// $[DCDC]
|
||||
#define BSP_DCDC_PRESENT (1)
|
||||
|
||||
#define HAL_DCDC_BYPASS (0)
|
||||
#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT
|
||||
// [DCDC]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[FEM]
|
||||
// [FEM]$
|
||||
|
||||
// $[GPIO]
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IDAC0]
|
||||
// [IDAC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (4U)
|
||||
#define BSP_LED0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_LED1_PIN (5U)
|
||||
#define BSP_LED1_PORT (gpioPortF)
|
||||
|
||||
#define HAL_LED_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define HAL_LED_COUNT (2U)
|
||||
#define BSP_LED_COUNT (2U)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
// [LED]$
|
||||
|
||||
// $[LESENSE]
|
||||
// [LESENSE]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LEUART0]
|
||||
// [LEUART0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[PA]
|
||||
#define HAL_PA_ENABLE (1)
|
||||
|
||||
#define HAL_PA_RAMP (10UL)
|
||||
#define HAL_PA_2P4_LOWPOWER (0)
|
||||
#define HAL_PA_POWER (252U)
|
||||
#define HAL_PA_VOLTAGE (3300U)
|
||||
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
|
||||
// [PA]$
|
||||
|
||||
// $[PCNT0]
|
||||
// [PCNT0]$
|
||||
|
||||
// $[PCNT1]
|
||||
// [PCNT1]$
|
||||
|
||||
// $[PCNT2]
|
||||
// [PCNT2]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DCLK_PIN (11U)
|
||||
#define PORTIO_PTI_DCLK_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DCLK_LOC (6U)
|
||||
|
||||
#define PORTIO_PTI_DFRAME_PIN (13U)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DFRAME_LOC (6U)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (12U)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DOUT_LOC (6U)
|
||||
|
||||
#define HAL_PTI_ENABLE (1)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (13U)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define BSP_PTI_DFRAME_LOC (6U)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (12U)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortB)
|
||||
#define BSP_PTI_DOUT_LOC (6U)
|
||||
|
||||
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
|
||||
#define HAL_PTI_BAUD_RATE (1600000UL)
|
||||
// [PTI]$
|
||||
|
||||
// $[PYD1698]
|
||||
// [PYD1698]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define HAL_SERIAL_USART0_ENABLE (0)
|
||||
#define HAL_SERIAL_LEUART0_ENABLE (0)
|
||||
#define HAL_SERIAL_USART1_ENABLE (0)
|
||||
#define HAL_SERIAL_USART2_ENABLE (0)
|
||||
#define HAL_SERIAL_USART3_ENABLE (0)
|
||||
#define HAL_SERIAL_RXWAKE_ENABLE (0)
|
||||
#define HAL_SERIAL_IDLE_WAKE_ENABLE (1)
|
||||
#define BSP_SERIAL_APP_CTS_PIN (2U)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_CTS_LOC (30U)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (1U)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RX_LOC (0U)
|
||||
|
||||
#define BSP_SERIAL_APP_TX_PIN (0U)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_TX_LOC (0U)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (3U)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RTS_LOC (30U)
|
||||
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128UL)
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200UL)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16UL)
|
||||
#define HAL_SERIAL_APP_RXSTART (16UL)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPIDISPLAY]
|
||||
// [SPIDISPLAY]$
|
||||
|
||||
// $[SPINCP]
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[UARTNCP]
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (2U)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_CTS_LOC (30U)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (3U)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RTS_LOC (30U)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (1U)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RX_LOC (0U)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (0U)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_TX_LOC (0U)
|
||||
|
||||
#define HAL_USART0_ENABLE (1)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (2U)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_CTS_LOC (30U)
|
||||
|
||||
#define BSP_USART0_RX_PIN (1U)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
#define BSP_USART0_RX_LOC (0U)
|
||||
|
||||
#define BSP_USART0_TX_PIN (0U)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
#define BSP_USART0_TX_LOC (0U)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (3U)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_RTS_LOC (30U)
|
||||
|
||||
#define HAL_USART0_RX_QUEUE_SIZE (128UL)
|
||||
#define HAL_USART0_BAUD_RATE (115200UL)
|
||||
#define HAL_USART0_RXSTOP (16UL)
|
||||
#define HAL_USART0_RXSTART (16UL)
|
||||
#define HAL_USART0_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE)
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
// [USART2]$
|
||||
|
||||
// $[USART3]
|
||||
// [USART3]$
|
||||
|
||||
// $[VCOM]
|
||||
#define HAL_VCOM_ENABLE (1)
|
||||
|
||||
#define BSP_VCOM_ENABLE_PIN (5U)
|
||||
#define BSP_VCOM_ENABLE_PORT (gpioPortA)
|
||||
|
||||
// [VCOM]$
|
||||
|
||||
// $[VDAC0]
|
||||
// [VDAC0]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
// [WDOG]$
|
||||
|
||||
// $[WTIMER0]
|
||||
// [WTIMER0]$
|
||||
|
||||
// $[WTIMER1]
|
||||
// [WTIMER1]$
|
||||
|
||||
#endif /* HAL_CONFIG_H */
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
#endif
|
||||
|
||||
#define RADIO_CONFIG_PA_USES_DCDC 0 /// The PA(s) is(are) fed from VBAT
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,372 +0,0 @@
|
||||
#ifndef HAL_CONFIG_H
|
||||
#define HAL_CONFIG_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ADC0]
|
||||
// [ADC0]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BATTERYMON]
|
||||
// [BATTERYMON]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BULBPWM]
|
||||
// [BULBPWM]$
|
||||
|
||||
// $[BULBPWM_COLOR]
|
||||
// [BULBPWM_COLOR]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (6U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON1_PIN (7U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_LFBCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_CTUNE (0U)
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define HAL_CLK_LFACLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_CTUNE (285)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE_TOKEN (1)
|
||||
#define HAL_CLK_HFXO_AUTOSTART (HAL_CLK_HFXO_AUTOSTART_NONE)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[CS5463]
|
||||
// [CS5463]$
|
||||
|
||||
// $[CSEN]
|
||||
// [CSEN]$
|
||||
|
||||
// $[DCDC]
|
||||
#define BSP_DCDC_PRESENT (1)
|
||||
|
||||
#define HAL_DCDC_BYPASS (0)
|
||||
#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT
|
||||
// [DCDC]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[FEM]
|
||||
#define HAL_FEM_ENABLE (1)
|
||||
|
||||
#define BSP_FEM_RX_PIN (10U)
|
||||
#define BSP_FEM_RX_PORT (gpioPortD)
|
||||
#define BSP_FEM_RX_LOC (0U)
|
||||
|
||||
#define BSP_FEM_SLEEP_PIN (11U)
|
||||
#define BSP_FEM_SLEEP_PORT (gpioPortD)
|
||||
#define BSP_FEM_SLEEP_LOC (13U)
|
||||
|
||||
#define HAL_FEM_RX_ACTIVE (1)
|
||||
#define BSP_FEM_RX_CHANNEL (5)
|
||||
#define HAL_FEM_TX_ACTIVE (0)
|
||||
#define HAL_FEM_BYPASS_ENABLE (0)
|
||||
#define BSP_FEM_SLEEP_CHANNEL (6)
|
||||
#define HAL_FEM_TX_HIGH_POWER (0)
|
||||
// [FEM]$
|
||||
|
||||
// $[GPIO]
|
||||
#define PORTIO_GPIO_SWV_PIN (2U)
|
||||
#define PORTIO_GPIO_SWV_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_SWV_LOC (0U)
|
||||
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
#define PORTIO_I2C0_SCL_PIN (11U)
|
||||
#define PORTIO_I2C0_SCL_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SCL_LOC (15U)
|
||||
|
||||
#define PORTIO_I2C0_SDA_PIN (10U)
|
||||
#define PORTIO_I2C0_SDA_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SDA_LOC (15U)
|
||||
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IDAC0]
|
||||
// [IDAC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (6U)
|
||||
#define BSP_LED0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_LED1_PIN (7U)
|
||||
#define BSP_LED1_PORT (gpioPortF)
|
||||
|
||||
#define HAL_LED_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define HAL_LED_COUNT (2U)
|
||||
#define BSP_LED_COUNT (2U)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
// [LED]$
|
||||
|
||||
// $[LESENSE]
|
||||
// [LESENSE]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LEUART0]
|
||||
// [LEUART0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[PA]
|
||||
#define HAL_PA_ENABLE (1)
|
||||
|
||||
#define HAL_PA_RAMP (10UL)
|
||||
#define HAL_PA_2P4_LOWPOWER (0)
|
||||
#define HAL_PA_POWER (252U)
|
||||
#define HAL_PA_VOLTAGE (3300U)
|
||||
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
|
||||
// [PA]$
|
||||
|
||||
// $[PCNT0]
|
||||
// [PCNT0]$
|
||||
|
||||
// $[PCNT1]
|
||||
// [PCNT1]$
|
||||
|
||||
// $[PCNT2]
|
||||
// [PCNT2]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
#define PORTIO_PRS_CH4_PIN (13U)
|
||||
#define PORTIO_PRS_CH4_PORT (gpioPortD)
|
||||
#define PORTIO_PRS_CH4_LOC (4U)
|
||||
|
||||
#define PORTIO_PRS_CH5_PIN (10U)
|
||||
#define PORTIO_PRS_CH5_PORT (gpioPortD)
|
||||
#define PORTIO_PRS_CH5_LOC (0U)
|
||||
|
||||
#define PORTIO_PRS_CH6_PIN (11U)
|
||||
#define PORTIO_PRS_CH6_PORT (gpioPortD)
|
||||
#define PORTIO_PRS_CH6_LOC (13U)
|
||||
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DFRAME_PIN (13U)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DFRAME_LOC (6U)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (11U)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DOUT_LOC (5U)
|
||||
|
||||
#define HAL_PTI_ENABLE (1)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (13U)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define BSP_PTI_DFRAME_LOC (6U)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (11U)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortB)
|
||||
#define BSP_PTI_DOUT_LOC (5U)
|
||||
|
||||
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
|
||||
#define HAL_PTI_BAUD_RATE (1600000UL)
|
||||
// [PTI]$
|
||||
|
||||
// $[PYD1698]
|
||||
// [PYD1698]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define HAL_SERIAL_USART0_ENABLE (0)
|
||||
#define HAL_SERIAL_LEUART0_ENABLE (0)
|
||||
#define HAL_SERIAL_USART1_ENABLE (0)
|
||||
#define HAL_SERIAL_USART2_ENABLE (0)
|
||||
#define HAL_SERIAL_USART3_ENABLE (0)
|
||||
#define HAL_SERIAL_RXWAKE_ENABLE (0)
|
||||
#define BSP_SERIAL_APP_CTS_PIN (2U)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_CTS_LOC (30U)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (1U)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RX_LOC (0U)
|
||||
|
||||
#define BSP_SERIAL_APP_TX_PIN (0U)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_TX_LOC (0U)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (3U)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RTS_LOC (30U)
|
||||
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128UL)
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200UL)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16UL)
|
||||
#define HAL_SERIAL_APP_RXSTART (16UL)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPIDISPLAY]
|
||||
// [SPIDISPLAY]$
|
||||
|
||||
// $[SPINCP]
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[UARTNCP]
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (2U)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_CTS_LOC (30U)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (3U)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RTS_LOC (30U)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (1U)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RX_LOC (0U)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (0U)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_TX_LOC (0U)
|
||||
|
||||
#define HAL_USART0_ENABLE (1)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (2U)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_CTS_LOC (30U)
|
||||
|
||||
#define BSP_USART0_RX_PIN (1U)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
#define BSP_USART0_RX_LOC (0U)
|
||||
|
||||
#define BSP_USART0_TX_PIN (0U)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
#define BSP_USART0_TX_LOC (0U)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (3U)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_RTS_LOC (30U)
|
||||
|
||||
#define HAL_USART0_RX_QUEUE_SIZE (128UL)
|
||||
#define HAL_USART0_BAUD_RATE (115200UL)
|
||||
#define HAL_USART0_RXSTOP (16UL)
|
||||
#define HAL_USART0_RXSTART (16UL)
|
||||
#define HAL_USART0_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
#define PORTIO_USART1_CLK_PIN (8U)
|
||||
#define PORTIO_USART1_CLK_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CLK_LOC (11U)
|
||||
|
||||
#define PORTIO_USART1_CS_PIN (9U)
|
||||
#define PORTIO_USART1_CS_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CS_LOC (11U)
|
||||
|
||||
#define PORTIO_USART1_RX_PIN (7U)
|
||||
#define PORTIO_USART1_RX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_RX_LOC (11U)
|
||||
|
||||
#define PORTIO_USART1_TX_PIN (6U)
|
||||
#define PORTIO_USART1_TX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_TX_LOC (11U)
|
||||
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
// [USART2]$
|
||||
|
||||
// $[USART3]
|
||||
// [USART3]$
|
||||
|
||||
// $[VCOM]
|
||||
// [VCOM]$
|
||||
|
||||
// $[VDAC0]
|
||||
// [VDAC0]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
// [WDOG]$
|
||||
|
||||
// $[WTIMER0]
|
||||
// [WTIMER0]$
|
||||
|
||||
// $[WTIMER1]
|
||||
// [WTIMER1]$
|
||||
|
||||
#endif /* HAL_CONFIG_H */
|
||||
@@ -1,68 +0,0 @@
|
||||
// This is an autogenerated config file, any changes to this file will be overwritten
|
||||
|
||||
#ifndef MBEDTLS_CONFIG_AUTOGEN_H
|
||||
#define MBEDTLS_CONFIG_AUTOGEN_H
|
||||
|
||||
#define MBEDTLS_ECP_MAX_BITS 256
|
||||
|
||||
#define MBEDTLS_MPI_MAX_SIZE 32
|
||||
|
||||
#define MBEDTLS_AES_C
|
||||
#define MBEDTLS_CIPHER_MODE_CTR
|
||||
#define MBEDTLS_CIPHER_MODE_CBC
|
||||
#define MBEDTLS_CIPHER_MODE_CFB
|
||||
#define MBEDTLS_ASN1_PARSE_C
|
||||
#define MBEDTLS_ASN1_WRITE_C
|
||||
#define MBEDTLS_BASE64_C
|
||||
#define MBEDTLS_CCM_C
|
||||
#define MBEDTLS_CIPHER_C
|
||||
#define MBEDTLS_CMAC_C
|
||||
#define MBEDTLS_SSL_PROTO_DTLS
|
||||
#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
|
||||
#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
|
||||
#define MBEDTLS_SSL_COOKIE_C
|
||||
#define MBEDTLS_ECP_C
|
||||
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
#define MBEDTLS_ECDH_C
|
||||
#define MBEDTLS_ECDH_LEGACY_CONTEXT
|
||||
#define MBEDTLS_ECDSA_C
|
||||
#define MBEDTLS_ENTROPY_ADC_C
|
||||
#define MBEDTLS_ENTROPY_HARDWARE_ALT
|
||||
#define MBEDTLS_MD_C
|
||||
#define MBEDTLS_ECJPAKE_C
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
||||
#define MBEDTLS_BIGNUM_C
|
||||
#define MBEDTLS_PEM_PARSE_C
|
||||
#define MBEDTLS_ENTROPY_C
|
||||
#define MBEDTLS_ENTROPY_FORCE_SHA256
|
||||
#define MBEDTLS_ENTROPY_MAX_SOURCES 2
|
||||
#define MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
#define MBEDTLS_CTR_DRBG_C
|
||||
#define MBEDTLS_SHA256_C
|
||||
#define MBEDTLS_SSL_TLS_C
|
||||
#define MBEDTLS_SSL_CLI_C
|
||||
#define MBEDTLS_SSL_PROTO_TLS1_2
|
||||
#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
|
||||
#define MBEDTLS_SSL_SRV_C
|
||||
#define MBEDTLS_X509_USE_C
|
||||
#define MBEDTLS_X509_CRT_PARSE_C
|
||||
#define MBEDTLS_X509_CRL_PARSE_C
|
||||
#define MBEDTLS_X509_CSR_PARSE_C
|
||||
#define MBEDTLS_OID_C
|
||||
#define MBEDTLS_PK_C
|
||||
#define MBEDTLS_PK_PARSE_C
|
||||
#define MBEDTLS_PSA_CRYPTO_DRIVERS
|
||||
|
||||
#include "config-device-acceleration.h"
|
||||
|
||||
#if !defined(TEST_SUITE_MEMORY_BUFFER_ALLOC)
|
||||
#include "sl_malloc.h"
|
||||
|
||||
#define MBEDTLS_PLATFORM_FREE_MACRO sl_free
|
||||
#define MBEDTLS_PLATFORM_CALLOC_MACRO sl_calloc
|
||||
#endif
|
||||
|
||||
#define MBEDTLS_PLATFORM_MEMORY
|
||||
#define MBEDTLS_PLATFORM_C
|
||||
|
||||
#endif
|
||||
@@ -1,98 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# ==============================================================================
|
||||
# Verify board is supported for platform
|
||||
# ==============================================================================
|
||||
if(BOARD_LOWERCASE STREQUAL "brd4304a")
|
||||
set(MCU "EFR32MG12P432F1024GM48")
|
||||
elseif(BOARD_LOWERCASE STREQUAL "brd4161a")
|
||||
set(MCU "EFR32MG12P432F1024GL125")
|
||||
elseif(BOARD_LOWERCASE STREQUAL "brd4166a")
|
||||
set(MCU "EFR32MG12P332F1024GL125")
|
||||
elseif(BOARD_LOWERCASE STREQUAL "brd4170a")
|
||||
set(MCU "EFR32MG12P433F1024GM68")
|
||||
else()
|
||||
message(FATAL_ERROR "
|
||||
BOARD=${BOARD} not supported.
|
||||
|
||||
Please provide a value for BOARD variable e.g BOARD=brd4161a.
|
||||
Currently supported:
|
||||
- brd4161a
|
||||
- brd4166a
|
||||
- brd4170a
|
||||
- brd4304a
|
||||
")
|
||||
endif()
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES "${MCU}")
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
# ==============================================================================
|
||||
# Platform library
|
||||
# ==============================================================================
|
||||
set(OT_PLATFORM_LIB "openthread-efr32mg12")
|
||||
set(OT_PLATFORM_LIB ${OT_PLATFORM_LIB} PARENT_SCOPE)
|
||||
|
||||
set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/efr32mg12/efr32mg12.ld")
|
||||
|
||||
add_library(openthread-efr32mg12
|
||||
${EFR32_COMMON_SOURCES}
|
||||
$<TARGET_OBJECTS:openthread-platform-utils>
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-efr32mg12
|
||||
PUBLIC
|
||||
${EFR32_COMMON_3RD_LIBS}
|
||||
silabs-libnvm3_CM4_gcc
|
||||
silabs-efr32mg12-sdk
|
||||
-T${LD_FILE}
|
||||
-Wl,--gc-sections
|
||||
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
|
||||
PRIVATE
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-efr32mg12
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-efr32mg12
|
||||
PRIVATE
|
||||
${EFR32_CFLAGS}
|
||||
)
|
||||
|
||||
target_include_directories(openthread-efr32mg12
|
||||
PUBLIC
|
||||
${EFR32_INCLUDES}
|
||||
PRIVATE
|
||||
${SILABS_EFR32MG1X_INCLUDES}
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
)
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread linker script for the
|
||||
* Silicon Labs efr32mg12 platform.
|
||||
*
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1024K
|
||||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapBase
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __Vectors_End
|
||||
* __Vectors_Size
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
__Vectors_End = .;
|
||||
__Vectors_Size = __Vectors_End - __Vectors;
|
||||
__end__ = .;
|
||||
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG (__data2_end__ - __data2_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
LONG (__bss2_start__)
|
||||
LONG (__bss2_end__ - __bss2_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
__etext = .;
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
. = ALIGN (4);
|
||||
PROVIDE (__ram_func_section_start = .);
|
||||
*(.ram)
|
||||
PROVIDE (__ram_func_section_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM
|
||||
|
||||
.heap (COPY):
|
||||
{
|
||||
__HeapBase = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
_end = __end__;
|
||||
KEEP(*(.heap*))
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy (COPY):
|
||||
{
|
||||
KEEP(*(.stack*))
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/*******************************************************************/
|
||||
/* Define flash block for nvm3 */
|
||||
.nvm (DSECT) : {
|
||||
KEEP(*(.simee*))
|
||||
} > FLASH
|
||||
|
||||
linker_nvm_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
||||
linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm);
|
||||
linker_nvm_size = SIZEOF(.nvm);
|
||||
__nvm3Base = linker_nvm_begin;
|
||||
/*******************************************************************/
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
|
||||
/* Check if FLASH usage exceeds FLASH size */
|
||||
ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32_platform_defs.am
|
||||
|
||||
lib_LIBRARIES = libopenthread-efr32mg13.a
|
||||
|
||||
libopenthread_efr32mg13_a_CPPFLAGS = \
|
||||
-DPLATFORM_HEADER=\"platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
|
||||
-Wno-sign-compare \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/$(BOARD_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
$(SILABS_EFR32MG13_CPPFLAGS) \
|
||||
$(SILABS_GSDK_CPPFLAGS) \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
$(NULL)
|
||||
|
||||
PLATFORM_SOURCES = \
|
||||
$(NULL)
|
||||
|
||||
noinst_HEADERS = \
|
||||
src/platform-band.h \
|
||||
src/platform-efr32.h \
|
||||
$(NULL)
|
||||
|
||||
libopenthread_efr32mg13_a_SOURCES = \
|
||||
$(PLATFORM_COMMON_SOURCES_LIST) \
|
||||
$(PLATFORM_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
Dash = -
|
||||
libopenthread_efr32mg13_a_LIBADD = \
|
||||
$(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") \
|
||||
$(shell find $(top_builddir)/third_party/jlink/SEGGER_RTT_V640/RTT $(Dash)type f $(Dash)name "*.o")
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# efr32mg13 platform-specific Makefile
|
||||
#
|
||||
|
||||
LDADD_COMMON += \
|
||||
$(top_srcdir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a \
|
||||
$(NULL)
|
||||
@@ -1,293 +1 @@
|
||||
# OpenThread on EFR32MG13 Example
|
||||
|
||||
This directory contains example platform drivers for the [Silicon Labs EFR32MG13][efr32mg13] based on [EFR32™ Mighty Gecko Wireless Starter Kit][slwstk6000b].
|
||||
|
||||
[efr32mg]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc
|
||||
[slwstk6000b]: http://www.silabs.com/products/development-tools/wireless/mesh-networking/mighty-gecko-starter-kit
|
||||
|
||||
The example platform drivers are intended to present the minimal code necessary to support OpenThread. [EFR32MG13P SoC][efr32mg13p] has rich memory and peripheral resources which can support all OpenThread capabilities. See the "Run the example with EFR32MG13 boards" section below for an example using basic OpenThread capabilities.
|
||||
|
||||
See [sleepy-demo/README.md](sleepy-demo/README.md) for instructions for an example that uses the low-energy modes of the EFR32MG13 when running as a Sleepy End Device.
|
||||
|
||||
[efr32mg13p]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc/device.EFR32MG13P432F1024GL125
|
||||
|
||||
## Toolchain
|
||||
|
||||
Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
|
||||
|
||||
[gnu-toolchain]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
|
||||
|
||||
In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./script/bootstrap
|
||||
```
|
||||
|
||||
## Build Examples
|
||||
|
||||
1. Download and install the [Simplicity Studio][simplicity_studio].
|
||||
|
||||
[simplicity_studio]: http://www.silabs.com/products/development-tools/software/simplicity-studio
|
||||
|
||||
2. Install Flex (Gecko) SDK including RAIL Library from Simplicity Studio.
|
||||
- Connect EFR32MG13P Wireless Starter Kit to Simplicity Studio.
|
||||
- Find Flex SDK v3.1 in the Software Update page and click Install.
|
||||
- Flex SDK v3.1 will be installed in the path:
|
||||
- Mac
|
||||
- `/Applications/Simplicity\ Studio.app/Contents/Eclipse/developer/sdks/gecko_sdk_suite`
|
||||
- Windows
|
||||
- `C:\SiliconLabs\SimplicityStudio\v5\developer\sdks\gecko_sdk_suite`
|
||||
- Linux
|
||||
- `./SimplicityStudio_v5/developer/sdks/gecko_sdk_suite`
|
||||
|
||||
For more information on configuring, building, and installing applications for the Wireless Gecko (EFR32) portfolio using FLEX, see [Getting Started with the Silicon Labs Flex Software Development Kit for the Wireless Gecko (EFR32™) Portfolio][qsg138]. For more information on RAIL, see [Radio Abstraction Interface Layer][rail].
|
||||
|
||||
[qsg138]: https://www.silabs.com/documents/public/quick-start-guides/qsg138-flex-efr32.pdf
|
||||
[rail]: http://www.silabs.com/products/development-tools/software/radio-abstraction-interface-layer-sdk
|
||||
|
||||
3. Configure the path to Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/third_party
|
||||
$ mkdir silabs
|
||||
$ cd <path-to-Simplicity-Studio>/developer/sdks
|
||||
$ cp -rf gecko_sdk_suite <path-to-openthread>/third_party/silabs/
|
||||
```
|
||||
|
||||
Alternatively create a symbolic link to the Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/third_party
|
||||
$ mkdir silabs
|
||||
$ ln -s <path-to-Simplicity-Studio>/developer/sdks/gecko_sdk_suite silabs/gecko_sdk_suite
|
||||
```
|
||||
|
||||
4. Build OpenThread Firmware (CLI example) on EFR32 platform.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
```
|
||||
|
||||
For EFR32MG13™ Mighty Gecko Wireless Starter Kit, this can be done using both the CMake and autotools build systems
|
||||
|
||||
**CMake (preferred)**
|
||||
|
||||
```bash
|
||||
$ ./script/cmake-build efr32mg13 -DBOARD=brd4168a
|
||||
...
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: <path-to-openthread>/build/efr32mg13
|
||||
+ [[ -n ot-rcp ot-cli-ftd ot-cli-mtd ot-ncp-ftd ot-ncp-mtd sleepy-demo-ftd sleepy-demo-mtd ]]
|
||||
+ ninja ot-rcp ot-cli-ftd ot-cli-mtd ot-ncp-ftd ot-ncp-mtd sleepy-demo-ftd sleepy-demo-mtd
|
||||
[573/573] Linking CXX executable examples/apps/ncp/ot-ncp-ftd
|
||||
+ cd <path-to-openthread>
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/build/efr32mg13/examples`.
|
||||
|
||||
```bash
|
||||
# For linux
|
||||
$ find build/efr32mg13/examples -type f -executable
|
||||
build/efr32mg13/examples/apps/cli/ot-cli-mtd
|
||||
build/efr32mg13/examples/apps/cli/ot-cli-ftd
|
||||
build/efr32mg13/examples/apps/ncp/ot-ncp-ftd
|
||||
build/efr32mg13/examples/apps/ncp/ot-ncp-mtd
|
||||
build/efr32mg13/examples/apps/ncp/ot-rcp
|
||||
build/efr32mg13/examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/sleepy-demo-ftd
|
||||
build/efr32mg13/examples/platforms/efr32/sleepy-demo/sleepy-demo-mtd/sleepy-demo-mtd
|
||||
|
||||
# For BSD/Darwin/mac systems
|
||||
$ find build/efr32mg13/examples -type f -perm +111
|
||||
build/efr32mg13/examples/apps/cli/ot-cli-mtd
|
||||
build/efr32mg13/examples/apps/cli/ot-cli-ftd
|
||||
build/efr32mg13/examples/apps/ncp/ot-ncp-ftd
|
||||
build/efr32mg13/examples/apps/ncp/ot-ncp-mtd
|
||||
build/efr32mg13/examples/apps/ncp/ot-rcp
|
||||
build/efr32mg13/examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/sleepy-demo-ftd
|
||||
build/efr32mg13/examples/platforms/efr32/sleepy-demo/sleepy-demo-mtd/sleepy-demo-mtd
|
||||
```
|
||||
|
||||
**autotools (soon to be depracated)**
|
||||
|
||||
```bash
|
||||
$ make -f examples/Makefile-efr32mg13 BOARD=BRD4168A
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/output/efr32mg13/bin`.
|
||||
|
||||
## Flash Binaries
|
||||
|
||||
Compiled binaries may be flashed onto the EFR32 using [JLinkGDBServer][jlinkgdbserver]. EFR32 Starter kit mainboard integrates an on-board SEGGER J-Link debugger.
|
||||
|
||||
[jlinkgdbserver]: https://www.segger.com/jlink-gdb-server.html
|
||||
|
||||
```bash
|
||||
$ cd <path-to-JLinkGDBServer>
|
||||
$ sudo ./JLinkGDBServer -if swd -device EFR32MG13PxxxF1024
|
||||
$ cd <path-to-openthread>/output/efr32/bin
|
||||
$ arm-none-eabi-gdb ot-cli-ftd
|
||||
$ (gdb) target remote 127.0.0.1:2331
|
||||
$ (gdb) load
|
||||
$ (gdb) monitor reset
|
||||
$ (gdb) c
|
||||
```
|
||||
|
||||
Note: Support for the "EFR32MG13PxxxF1024" device was added to JLinkGDBServer V6.14d.
|
||||
|
||||
Or Compiled binaries also may be flashed onto the specified EFR32 dev board using [J-Link Commander][j-link-commander].
|
||||
|
||||
[j-link-commander]: https://www.segger.com/products/debug-probes/j-link/tools/j-link-commander/
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/output/efr32mg13/bin
|
||||
$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex
|
||||
$ JLinkExe -device EFR32MG13PxxxF1024 -speed 4000 -if SWD -autoconnect 1 -SelectEmuBySN <SerialNo>
|
||||
$ J-Link>loadfile ot-cli-ftd.hex
|
||||
$ J-Link>r
|
||||
$ J-Link>q
|
||||
```
|
||||
|
||||
Note: SerialNo is J-Link serial number. Use the following command to get the serial number of the connected J-Link.
|
||||
|
||||
```bash
|
||||
$ JLinkExe
|
||||
```
|
||||
|
||||
Alternatively Simplicity Commander provides a graphical interface for J-Link Commander.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/output/efr32mg13/bin
|
||||
$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.ihex
|
||||
$ <path-to-simplicity-studio>/developer/adapter_packs/commander/commander
|
||||
```
|
||||
|
||||
In the J-Link Device drop-down list select the serial number of the device to flash. Click the Adapter Connect button. Ensure the Debug Interface drop-down list is set to SWD and click the Target Connect button. Click on the Flash icon on the left side of the window to switch to the flash page. In the Flash MCU pane enter the path of the ot-cli-ftd.s37 file or choose the file with the Browse... button. Click the Flash button located under the Browse... button.
|
||||
|
||||
## Run the example with EFR32MG13 boards
|
||||
|
||||
1. Flash two EFR32 boards with the `CLI example` firmware (as shown above).
|
||||
2. Open terminal to first device `/dev/ttyACM0` (serial port settings: 115200 8-N-1). Type `help` for a list of commands.
|
||||
|
||||
```bash
|
||||
> help
|
||||
help
|
||||
channel
|
||||
childtimeout
|
||||
contextreusedelay
|
||||
extaddr
|
||||
extpanid
|
||||
ipaddr
|
||||
keysequence
|
||||
leaderweight
|
||||
masterkey
|
||||
mode
|
||||
netdata register
|
||||
networkidtimeout
|
||||
networkname
|
||||
panid
|
||||
ping
|
||||
prefix
|
||||
releaserouterid
|
||||
rloc16
|
||||
route
|
||||
routerupgradethreshold
|
||||
scan
|
||||
start
|
||||
state
|
||||
stop
|
||||
```
|
||||
|
||||
3. Start a Thread network as Leader.
|
||||
|
||||
```bash
|
||||
> dataset init new
|
||||
Done
|
||||
> dataset
|
||||
Active Timestamp: 1
|
||||
Channel: 13
|
||||
Channel Mask: 0x07fff800
|
||||
Ext PAN ID: d63e8e3e495ebbc3
|
||||
Mesh Local Prefix: fd3d:b50b:f96d:722d::/64
|
||||
Master Key: dfd34f0f05cad978ec4e32b0413038ff
|
||||
Network Name: OpenThread-8f28
|
||||
PAN ID: 0x8f28
|
||||
PSKc: c23a76e98f1a6483639b1ac1271e2e27
|
||||
Security Policy: 0, onrcb
|
||||
Done
|
||||
> dataset commit active
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
leader
|
||||
Done
|
||||
```
|
||||
|
||||
4. Open terminal to second device `/dev/ttyACM1` (serial port settings: 115200 8-N-1) and attach it to the Thread network as a Router.
|
||||
|
||||
```bash
|
||||
> dataset masterkey dfd34f0f05cad978ec4e32b0413038ff
|
||||
Done
|
||||
> dataset commit active
|
||||
Done
|
||||
> routerselectionjitter 1
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
router
|
||||
Done
|
||||
```
|
||||
|
||||
5. List all IPv6 addresses of Leader.
|
||||
|
||||
```bash
|
||||
> ipaddr
|
||||
fd3d:b50b:f96d:722d:0:ff:fe00:fc00
|
||||
fd3d:b50b:f96d:722d:0:ff:fe00:c00
|
||||
fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
|
||||
fe80:0:0:0:6c41:9001:f3d6:4148
|
||||
Done
|
||||
```
|
||||
|
||||
6. Send an ICMPv6 ping to Leader's Mesh-EID IPv6 address.
|
||||
|
||||
```bash
|
||||
> ping fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
|
||||
16 bytes from fd3d:b50b:f96d:722d:558:f56b:d688:799: icmp_seq=1 hlim=64 time=24ms
|
||||
```
|
||||
|
||||
The above example demonstrates basic OpenThread capabilities. Enable more features/roles (e.g. commissioner, joiner, DHCPv6 Server/Client, etc.) by assigning compile-options before compiling.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
$ make -f examples/Makefile-efr32mg13 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1
|
||||
```
|
||||
|
||||
For a list of all available commands, visit [OpenThread CLI Reference README.md][cli].
|
||||
|
||||
[cli]: https://github.com/openthread/openthread/blob/main/src/cli/README.md
|
||||
|
||||
## Verification
|
||||
|
||||
The following toolchain has been used for testing and verification:
|
||||
|
||||
- gcc version 7.3.1
|
||||
|
||||
The EFR32 example has been verified with following Flex SDK/RAIL Library version:
|
||||
|
||||
- Flex SDK v3.1.x
|
||||
The OpenThread on EFR32 example has moved to https://github.com/openthread/ot-efr32
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM)
|
||||
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
|
||||
set(CMAKE_RANLIB arm-none-eabi-ranlib)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -fdata-sections -ffunction-sections")
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_ASM_FLAGS_DEBUG "-g")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_ASM_FLAGS_RELEASE "")
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
|
||||
#define RADIO_CONFIG_PA_USES_DCDC 0 /// The PA(s) is(are) fed from VBAT
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,450 +0,0 @@
|
||||
#ifndef HAL_CONFIG_BOARD_H
|
||||
#define HAL_CONFIG_BOARD_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ADC0]
|
||||
// [ADC0]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BATTERYMON]
|
||||
|
||||
// [BATTERYMON]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
|
||||
#define BSP_BTL_BUTTON_PIN (6U)
|
||||
#define BSP_BTL_BUTTON_PORT (gpioPortF)
|
||||
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BULBPWM]
|
||||
// [BULBPWM]$
|
||||
|
||||
// $[BULBPWM_COLOR]
|
||||
// [BULBPWM_COLOR]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (6U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON1_PIN (7U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortF)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_LFBCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE (330)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define BSP_CLK_LFXO_CTUNE (32U)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[CS5463]
|
||||
// [CS5463]$
|
||||
|
||||
// $[CSEN]
|
||||
// [CSEN]$
|
||||
|
||||
// $[DCDC]
|
||||
#define BSP_DCDC_PRESENT (1)
|
||||
|
||||
#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT
|
||||
// [DCDC]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
#define BSP_EXTFLASH_CS_PIN (4U)
|
||||
#define BSP_EXTFLASH_CS_PORT (gpioPortA)
|
||||
|
||||
#define BSP_EXTFLASH_INTERNAL (0)
|
||||
#define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART1)
|
||||
#define BSP_EXTFLASH_MOSI_PIN (6U)
|
||||
#define BSP_EXTFLASH_MOSI_PORT (gpioPortC)
|
||||
#define BSP_EXTFLASH_MOSI_LOC (11U)
|
||||
|
||||
#define BSP_EXTFLASH_MISO_PIN (7U)
|
||||
#define BSP_EXTFLASH_MISO_PORT (gpioPortC)
|
||||
#define BSP_EXTFLASH_MISO_LOC (11U)
|
||||
|
||||
#define BSP_EXTFLASH_CLK_PIN (8U)
|
||||
#define BSP_EXTFLASH_CLK_PORT (gpioPortC)
|
||||
#define BSP_EXTFLASH_CLK_LOC (11U)
|
||||
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[FEM]
|
||||
// [FEM]$
|
||||
|
||||
// $[GPIO]
|
||||
#define PORTIO_GPIO_SWV_PIN (2U)
|
||||
#define PORTIO_GPIO_SWV_PORT (gpioPortF)
|
||||
#define PORTIO_GPIO_SWV_LOC (0U)
|
||||
|
||||
#define BSP_TRACE_SWO_PIN (2U)
|
||||
#define BSP_TRACE_SWO_PORT (gpioPortF)
|
||||
#define BSP_TRACE_SWO_LOC (0U)
|
||||
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
#define PORTIO_I2C0_SCL_PIN (10U)
|
||||
#define PORTIO_I2C0_SCL_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SCL_LOC (14U)
|
||||
|
||||
#define PORTIO_I2C0_SDA_PIN (11U)
|
||||
#define PORTIO_I2C0_SDA_PORT (gpioPortC)
|
||||
#define PORTIO_I2C0_SDA_LOC (16U)
|
||||
|
||||
#define BSP_I2C0_SCL_PIN (10U)
|
||||
#define BSP_I2C0_SCL_PORT (gpioPortC)
|
||||
#define BSP_I2C0_SCL_LOC (14U)
|
||||
|
||||
#define BSP_I2C0_SDA_PIN (11U)
|
||||
#define BSP_I2C0_SDA_PORT (gpioPortC)
|
||||
#define BSP_I2C0_SDA_LOC (16U)
|
||||
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
|
||||
#define BSP_I2CSENSOR_ENABLE_PIN (15U)
|
||||
#define BSP_I2CSENSOR_ENABLE_PORT (gpioPortD)
|
||||
|
||||
#define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0)
|
||||
#define BSP_I2CSENSOR_SCL_PIN (10U)
|
||||
#define BSP_I2CSENSOR_SCL_PORT (gpioPortC)
|
||||
#define BSP_I2CSENSOR_SCL_LOC (14U)
|
||||
|
||||
#define BSP_I2CSENSOR_SDA_PIN (11U)
|
||||
#define BSP_I2CSENSOR_SDA_PORT (gpioPortC)
|
||||
#define BSP_I2CSENSOR_SDA_LOC (16U)
|
||||
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IDAC0]
|
||||
// [IDAC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (4U)
|
||||
#define BSP_LED0_PORT (gpioPortF)
|
||||
|
||||
#define BSP_LED1_PIN (5U)
|
||||
#define BSP_LED1_PORT (gpioPortF)
|
||||
|
||||
#define BSP_LED_COUNT (2U)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
#define BSP_LED_POLARITY (1)
|
||||
// [LED]$
|
||||
|
||||
// $[LESENSE]
|
||||
// [LESENSE]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LEUART0]
|
||||
// [LEUART0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[MODEM]
|
||||
// [MODEM]$
|
||||
|
||||
// $[PA]
|
||||
|
||||
#define BSP_PA_VOLTAGE (3300U)
|
||||
// [PA]$
|
||||
|
||||
// $[PCNT0]
|
||||
// [PCNT0]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
#define PORTIO_PRS_CH4_PIN (13U)
|
||||
#define PORTIO_PRS_CH4_PORT (gpioPortD)
|
||||
#define PORTIO_PRS_CH4_LOC (4U)
|
||||
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DCLK_PIN (11U)
|
||||
#define PORTIO_PTI_DCLK_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DCLK_LOC (6U)
|
||||
|
||||
#define PORTIO_PTI_DFRAME_PIN (13U)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DFRAME_LOC (6U)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (12U)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortB)
|
||||
#define PORTIO_PTI_DOUT_LOC (6U)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (13U)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortB)
|
||||
#define BSP_PTI_DFRAME_LOC (6U)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (12U)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortB)
|
||||
#define BSP_PTI_DOUT_LOC (6U)
|
||||
|
||||
// [PTI]$
|
||||
|
||||
// $[PYD1698]
|
||||
// [PYD1698]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define BSP_SERIAL_APP_TX_PIN (0U)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_TX_LOC (0U)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (1U)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RX_LOC (0U)
|
||||
|
||||
#define BSP_SERIAL_APP_CTS_PIN (2U)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_CTS_LOC (30U)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (3U)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortA)
|
||||
#define BSP_SERIAL_APP_RTS_LOC (30U)
|
||||
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16)
|
||||
#define HAL_SERIAL_APP_RXSTART (16)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPIDISPLAY]
|
||||
|
||||
#define BSP_SPIDISPLAY_CS_PIN (14U)
|
||||
#define BSP_SPIDISPLAY_CS_PORT (gpioPortD)
|
||||
|
||||
#define BSP_SPIDISPLAY_ENABLE_PIN (15U)
|
||||
#define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD)
|
||||
|
||||
#define BSP_SPIDISPLAY_EXTCOMIN_PIN (13U)
|
||||
#define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD)
|
||||
#define BSP_SPIDISPLAY_EXTCOMIN_LOC (4U)
|
||||
|
||||
#define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03)
|
||||
#define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART1)
|
||||
#define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4)
|
||||
#define BSP_SPIDISPLAY_MOSI_PIN (6U)
|
||||
#define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC)
|
||||
#define BSP_SPIDISPLAY_MOSI_LOC (11U)
|
||||
|
||||
#define BSP_SPIDISPLAY_MISO_PIN (7U)
|
||||
#define BSP_SPIDISPLAY_MISO_PORT (gpioPortC)
|
||||
#define BSP_SPIDISPLAY_MISO_LOC (11U)
|
||||
|
||||
#define BSP_SPIDISPLAY_CLK_PIN (8U)
|
||||
#define BSP_SPIDISPLAY_CLK_PORT (gpioPortC)
|
||||
#define BSP_SPIDISPLAY_CLK_LOC (11U)
|
||||
|
||||
// [SPIDISPLAY]$
|
||||
|
||||
// $[SPINCP]
|
||||
#define BSP_SPINCP_NHOSTINT_PIN (6U)
|
||||
#define BSP_SPINCP_NHOSTINT_PORT (gpioPortF)
|
||||
|
||||
#define BSP_SPINCP_NWAKE_PIN (7U)
|
||||
#define BSP_SPINCP_NWAKE_PORT (gpioPortF)
|
||||
|
||||
#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART1)
|
||||
#define BSP_SPINCP_MOSI_PIN (6U)
|
||||
#define BSP_SPINCP_MOSI_PORT (gpioPortC)
|
||||
#define BSP_SPINCP_MOSI_LOC (11U)
|
||||
|
||||
#define BSP_SPINCP_MISO_PIN (7U)
|
||||
#define BSP_SPINCP_MISO_PORT (gpioPortC)
|
||||
#define BSP_SPINCP_MISO_LOC (11U)
|
||||
|
||||
#define BSP_SPINCP_CLK_PIN (8U)
|
||||
#define BSP_SPINCP_CLK_PORT (gpioPortC)
|
||||
#define BSP_SPINCP_CLK_LOC (11U)
|
||||
|
||||
#define BSP_SPINCP_CS_PIN (9U)
|
||||
#define BSP_SPINCP_CS_PORT (gpioPortC)
|
||||
#define BSP_SPINCP_CS_LOC (11U)
|
||||
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[UARTNCP]
|
||||
#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0)
|
||||
#define BSP_UARTNCP_TX_PIN (0U)
|
||||
#define BSP_UARTNCP_TX_PORT (gpioPortA)
|
||||
#define BSP_UARTNCP_TX_LOC (0U)
|
||||
|
||||
#define BSP_UARTNCP_RX_PIN (1U)
|
||||
#define BSP_UARTNCP_RX_PORT (gpioPortA)
|
||||
#define BSP_UARTNCP_RX_LOC (0U)
|
||||
|
||||
#define BSP_UARTNCP_CTS_PIN (2U)
|
||||
#define BSP_UARTNCP_CTS_PORT (gpioPortA)
|
||||
#define BSP_UARTNCP_CTS_LOC (30U)
|
||||
|
||||
#define BSP_UARTNCP_RTS_PIN (3U)
|
||||
#define BSP_UARTNCP_RTS_PORT (gpioPortA)
|
||||
#define BSP_UARTNCP_RTS_LOC (30U)
|
||||
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (2U)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_CTS_LOC (30U)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (3U)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RTS_LOC (30U)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (1U)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_RX_LOC (0U)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (0U)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
#define PORTIO_USART0_TX_LOC (0U)
|
||||
|
||||
#define BSP_USART0_TX_PIN (0U)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
#define BSP_USART0_TX_LOC (0U)
|
||||
|
||||
#define BSP_USART0_RX_PIN (1U)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
#define BSP_USART0_RX_LOC (0U)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (2U)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_CTS_LOC (30U)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (3U)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortA)
|
||||
#define BSP_USART0_RTS_LOC (30U)
|
||||
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
#define PORTIO_USART1_CLK_PIN (8U)
|
||||
#define PORTIO_USART1_CLK_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CLK_LOC (11U)
|
||||
|
||||
#define PORTIO_USART1_CS_PIN (9U)
|
||||
#define PORTIO_USART1_CS_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_CS_LOC (11U)
|
||||
|
||||
#define PORTIO_USART1_RX_PIN (7U)
|
||||
#define PORTIO_USART1_RX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_RX_LOC (11U)
|
||||
|
||||
#define PORTIO_USART1_TX_PIN (6U)
|
||||
#define PORTIO_USART1_TX_PORT (gpioPortC)
|
||||
#define PORTIO_USART1_TX_LOC (11U)
|
||||
|
||||
#define BSP_USART1_MOSI_PIN (6U)
|
||||
#define BSP_USART1_MOSI_PORT (gpioPortC)
|
||||
#define BSP_USART1_MOSI_LOC (11U)
|
||||
|
||||
#define BSP_USART1_MISO_PIN (7U)
|
||||
#define BSP_USART1_MISO_PORT (gpioPortC)
|
||||
#define BSP_USART1_MISO_LOC (11U)
|
||||
|
||||
#define BSP_USART1_CLK_PIN (8U)
|
||||
#define BSP_USART1_CLK_PORT (gpioPortC)
|
||||
#define BSP_USART1_CLK_LOC (11U)
|
||||
|
||||
#define BSP_USART1_CS_PIN (9U)
|
||||
#define BSP_USART1_CS_PORT (gpioPortC)
|
||||
#define BSP_USART1_CS_LOC (11U)
|
||||
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
// [USART2]$
|
||||
|
||||
// $[VCOM]
|
||||
|
||||
#define BSP_VCOM_ENABLE_PIN (5U)
|
||||
#define BSP_VCOM_ENABLE_PORT (gpioPortA)
|
||||
|
||||
// [VCOM]$
|
||||
|
||||
// $[VDAC0]
|
||||
// [VDAC0]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
// [WDOG]$
|
||||
|
||||
// $[WTIMER0]
|
||||
// [WTIMER0]$
|
||||
|
||||
#if defined(_SILICON_LABS_MODULE)
|
||||
#include "sl_module.h"
|
||||
#endif
|
||||
|
||||
#endif /* HAL_CONFIG_BOARD_H */
|
||||
@@ -1,68 +0,0 @@
|
||||
// This is an autogenerated config file, any changes to this file will be overwritten
|
||||
|
||||
#ifndef MBEDTLS_CONFIG_AUTOGEN_H
|
||||
#define MBEDTLS_CONFIG_AUTOGEN_H
|
||||
|
||||
#define MBEDTLS_ECP_MAX_BITS 256
|
||||
|
||||
#define MBEDTLS_MPI_MAX_SIZE 32
|
||||
|
||||
#define MBEDTLS_AES_C
|
||||
#define MBEDTLS_CIPHER_MODE_CTR
|
||||
#define MBEDTLS_CIPHER_MODE_CBC
|
||||
#define MBEDTLS_CIPHER_MODE_CFB
|
||||
#define MBEDTLS_ASN1_PARSE_C
|
||||
#define MBEDTLS_ASN1_WRITE_C
|
||||
#define MBEDTLS_BASE64_C
|
||||
#define MBEDTLS_CCM_C
|
||||
#define MBEDTLS_CIPHER_C
|
||||
#define MBEDTLS_CMAC_C
|
||||
#define MBEDTLS_SSL_PROTO_DTLS
|
||||
#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
|
||||
#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
|
||||
#define MBEDTLS_SSL_COOKIE_C
|
||||
#define MBEDTLS_ECP_C
|
||||
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
#define MBEDTLS_ECDH_C
|
||||
#define MBEDTLS_ECDH_LEGACY_CONTEXT
|
||||
#define MBEDTLS_ECDSA_C
|
||||
#define MBEDTLS_ENTROPY_ADC_C
|
||||
#define MBEDTLS_ENTROPY_HARDWARE_ALT
|
||||
#define MBEDTLS_MD_C
|
||||
#define MBEDTLS_ECJPAKE_C
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
||||
#define MBEDTLS_BIGNUM_C
|
||||
#define MBEDTLS_PEM_PARSE_C
|
||||
#define MBEDTLS_ENTROPY_C
|
||||
#define MBEDTLS_ENTROPY_FORCE_SHA256
|
||||
#define MBEDTLS_ENTROPY_MAX_SOURCES 2
|
||||
#define MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
#define MBEDTLS_CTR_DRBG_C
|
||||
#define MBEDTLS_SHA256_C
|
||||
#define MBEDTLS_SSL_TLS_C
|
||||
#define MBEDTLS_SSL_CLI_C
|
||||
#define MBEDTLS_SSL_PROTO_TLS1_2
|
||||
#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
|
||||
#define MBEDTLS_SSL_SRV_C
|
||||
#define MBEDTLS_X509_USE_C
|
||||
#define MBEDTLS_X509_CRT_PARSE_C
|
||||
#define MBEDTLS_X509_CRL_PARSE_C
|
||||
#define MBEDTLS_X509_CSR_PARSE_C
|
||||
#define MBEDTLS_OID_C
|
||||
#define MBEDTLS_PK_C
|
||||
#define MBEDTLS_PK_PARSE_C
|
||||
#define MBEDTLS_PSA_CRYPTO_DRIVERS
|
||||
|
||||
#include "config-device-acceleration.h"
|
||||
|
||||
#if !defined(TEST_SUITE_MEMORY_BUFFER_ALLOC)
|
||||
#include "sl_malloc.h"
|
||||
|
||||
#define MBEDTLS_PLATFORM_FREE_MACRO sl_free
|
||||
#define MBEDTLS_PLATFORM_CALLOC_MACRO sl_calloc
|
||||
#endif
|
||||
|
||||
#define MBEDTLS_PLATFORM_MEMORY
|
||||
#define MBEDTLS_PLATFORM_C
|
||||
|
||||
#endif
|
||||
@@ -1,89 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# ==============================================================================
|
||||
# Verify board is supported for platform
|
||||
# ==============================================================================
|
||||
if(BOARD_LOWERCASE STREQUAL "brd4168a")
|
||||
set(MCU "EFR32MG13P732F512GM48")
|
||||
else()
|
||||
message(FATAL_ERROR "
|
||||
BOARD=${BOARD} not supported.
|
||||
|
||||
Please provide a value for BOARD variable e.g BOARD=brd4168a.
|
||||
Currently supported:
|
||||
- brd4168a
|
||||
")
|
||||
endif()
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES "${MCU}")
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
# ==============================================================================
|
||||
# Platform library
|
||||
# ==============================================================================
|
||||
set(OT_PLATFORM_LIB "openthread-efr32mg13")
|
||||
set(OT_PLATFORM_LIB ${OT_PLATFORM_LIB} PARENT_SCOPE)
|
||||
|
||||
set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/efr32mg13/efr32mg13.ld")
|
||||
|
||||
add_library(openthread-efr32mg13
|
||||
${EFR32_COMMON_SOURCES}
|
||||
$<TARGET_OBJECTS:openthread-platform-utils>
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-efr32mg13
|
||||
PUBLIC
|
||||
${EFR32_COMMON_3RD_LIBS}
|
||||
silabs-libnvm3_CM4_gcc
|
||||
silabs-efr32mg13-sdk
|
||||
-T${LD_FILE}
|
||||
-Wl,--gc-sections
|
||||
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
|
||||
PRIVATE
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-efr32mg13
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-efr32mg13
|
||||
PRIVATE
|
||||
${EFR32_CFLAGS}
|
||||
)
|
||||
|
||||
target_include_directories(openthread-efr32mg13
|
||||
PUBLIC
|
||||
${EFR32_INCLUDES}
|
||||
PRIVATE
|
||||
${SILABS_EFR32MG1X_INCLUDES}
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
)
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread linker script for the
|
||||
* Silicon Labs efr32mg13 platform.
|
||||
*
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K
|
||||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapBase
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __Vectors_End
|
||||
* __Vectors_Size
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
__Vectors_End = .;
|
||||
__Vectors_Size = __Vectors_End - __Vectors;
|
||||
__end__ = .;
|
||||
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG (__data2_end__ - __data2_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
LONG (__bss2_start__)
|
||||
LONG (__bss2_end__ - __bss2_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
__etext = .;
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
. = ALIGN (4);
|
||||
PROVIDE (__ram_func_section_start = .);
|
||||
*(.ram)
|
||||
PROVIDE (__ram_func_section_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM
|
||||
|
||||
.heap (COPY):
|
||||
{
|
||||
__HeapBase = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
_end = __end__;
|
||||
KEEP(*(.heap*))
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy (COPY):
|
||||
{
|
||||
KEEP(*(.stack*))
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/*******************************************************************/
|
||||
/* Define flash block for nvm3 */
|
||||
.nvm (DSECT) : {
|
||||
KEEP(*(.simee*))
|
||||
} > FLASH
|
||||
|
||||
linker_nvm_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
||||
linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm);
|
||||
linker_nvm_size = SIZEOF(.nvm);
|
||||
__nvm3Base = linker_nvm_begin;
|
||||
/*******************************************************************/
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
|
||||
/* Check if FLASH usage exceeds FLASH size */
|
||||
ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32_platform_defs.am
|
||||
|
||||
lib_LIBRARIES = libopenthread-efr32mg21.a
|
||||
|
||||
libopenthread_efr32mg21_a_CPPFLAGS = \
|
||||
-DPLATFORM_HEADER=\"platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
|
||||
-Wno-sign-compare \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/$(BOARD_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
$(SILABS_EFR32MG21_CPPFLAGS) \
|
||||
$(SILABS_GSDK_CPPFLAGS) \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
$(NULL)
|
||||
|
||||
PLATFORM_SOURCES = \
|
||||
$(NULL)
|
||||
|
||||
noinst_HEADERS = \
|
||||
src/platform-band.h \
|
||||
src/platform-efr32.h \
|
||||
$(NULL)
|
||||
|
||||
libopenthread_efr32mg21_a_SOURCES = \
|
||||
$(PLATFORM_COMMON_SOURCES_LIST) \
|
||||
$(PLATFORM_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
Dash = -
|
||||
libopenthread_efr32mg21_a_LIBADD = \
|
||||
$(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") \
|
||||
$(shell find $(top_builddir)/third_party/jlink/SEGGER_RTT_V640/RTT $(Dash)type f $(Dash)name "*.o")
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# efr32mg21 platform-specific Makefile
|
||||
#
|
||||
|
||||
LDADD_COMMON += \
|
||||
$(top_srcdir)/third_party/silabs/gecko_sdk_suite/v3.1/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a \
|
||||
$(NULL)
|
||||
@@ -1,236 +1 @@
|
||||
# OpenThread on EFR32MG21 Example
|
||||
|
||||
This directory contains example platform drivers for the [Silicon Labs EFR32MG21][efr32mg] based on [EFR32™ Mighty Gecko Wireless Starter Kit][slwstk6000b]
|
||||
|
||||
[efr32mg]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc
|
||||
[slwstk6000b]: http://www.silabs.com/products/development-tools/wireless/mesh-networking/mighty-gecko-starter-kit
|
||||
|
||||
The example platform drivers are intended to present the minimal code necessary to support OpenThread. [EFR32MG21 SoC][efr32mg21] has rich memory and peripheral resources which can support all OpenThread capabilities. See the "Run the example with EFR32 boards" section below for an example using basic OpenThread capabilities.
|
||||
|
||||
[efr32mg21]: https://www.silabs.com/products/wireless/mesh-networking/series-2-efr32-mighty-gecko-zigbee-thread-soc/device.efr32mg21a020f768im32
|
||||
|
||||
## Toolchain
|
||||
|
||||
Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
|
||||
|
||||
[gnu-toolchain]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
|
||||
|
||||
In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./script/bootstrap
|
||||
```
|
||||
|
||||
## Build Examples
|
||||
|
||||
1. Download and install the [Simplicity Studio][simplicity_studio].
|
||||
|
||||
[simplicity_studio]: http://www.silabs.com/products/development-tools/software/simplicity-studio
|
||||
|
||||
2. Install Flex (Gecko) SDK including RAIL Library from Simplicity Studio.
|
||||
- Connect EFR32MG21 Wireless Starter Kit to Simplicity Studio.
|
||||
- Find Flex SDK v3.1 in the Software Update page and click Install.
|
||||
- Flex SDK v3.1 will be installed in the path:
|
||||
- Mac
|
||||
- `/Applications/Simplicity\ Studio.app/Contents/Eclipse/developer/sdks/gecko_sdk_suite`
|
||||
- Windows
|
||||
- `C:\SiliconLabs\SimplicityStudio\v5\developer\sdks\gecko_sdk_suite`
|
||||
- Linux
|
||||
- `./SimplicityStudio_v5/developer/sdks/gecko_sdk_suite`
|
||||
|
||||
For more information on configuring, building, and installing applications for the Wireless Gecko (EFR32) portfolio using FLEX, see [Getting Started with the Silicon Labs Flex Software Development Kit for the Wireless Gecko (EFR32™) Portfolio][qsg138]. For more information on RAIL, see [Radio Abstraction Interface Layer][rail].
|
||||
|
||||
[qsg138]: https://www.silabs.com/documents/public/quick-start-guides/qsg138-flex-efr32.pdf
|
||||
[rail]: http://www.silabs.com/products/development-tools/software/radio-abstraction-interface-layer-sdk
|
||||
|
||||
3. Configure the path to Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-Simplicity-Studio>/developer/sdks
|
||||
$ cp -rf gecko_sdk_suite <path-to-openthread>/third_party/silabs/
|
||||
```
|
||||
|
||||
Alternatively create a symbolic link to the Flex SDK source code.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/third_party
|
||||
$ ln -s <path-to-Simplicity-Studio>/developer/sdks/gecko_sdk_suite silabs/gecko_sdk_suite
|
||||
```
|
||||
|
||||
4. Build OpenThread Firmware (CLI example) on EFR32 platform.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
```
|
||||
|
||||
For EFR32MG21™ Mighty Gecko Wireless Starter Kit, this can be done using both the CMake and autotools build systems
|
||||
|
||||
**CMake (preferred)**
|
||||
|
||||
```bash
|
||||
$ ./script/cmake-build efr32mg21 -DBOARD=brd4180b
|
||||
...
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: <path-to-openthread>/build/efr32mg21
|
||||
+ [[ -n ot-rcp ot-cli-ftd ot-cli-mtd ot-ncp-ftd ot-ncp-mtd sleepy-demo-ftd sleepy-demo-mtd ]]
|
||||
+ ninja ot-rcp ot-cli-ftd ot-cli-mtd ot-ncp-ftd ot-ncp-mtd sleepy-demo-ftd sleepy-demo-mtd
|
||||
[940/940] Linking CXX executable examples/apps/ncp/ot-ncp-ftd
|
||||
+ cd <path-to-openthread>
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/build/efr32mg21/examples`.
|
||||
|
||||
```bash
|
||||
# For linux
|
||||
$ find build/efr32mg21/examples -type f -executable
|
||||
build/efr32mg21/examples/apps/cli/ot-cli-mtd
|
||||
build/efr32mg21/examples/apps/cli/ot-cli-ftd
|
||||
build/efr32mg21/examples/apps/ncp/ot-ncp-ftd
|
||||
build/efr32mg21/examples/apps/ncp/ot-ncp-mtd
|
||||
build/efr32mg21/examples/apps/ncp/ot-rcp
|
||||
build/efr32mg21/examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/sleepy-demo-ftd
|
||||
build/efr32mg21/examples/platforms/efr32/sleepy-demo/sleepy-demo-mtd/sleepy-demo-mtd
|
||||
|
||||
# For BSD/Darwin/mac systems
|
||||
$ find build/efr32mg21/examples -type f -perm +111
|
||||
build/efr32mg21/examples/apps/cli/ot-cli-mtd
|
||||
build/efr32mg21/examples/apps/cli/ot-cli-ftd
|
||||
build/efr32mg21/examples/apps/ncp/ot-ncp-ftd
|
||||
build/efr32mg21/examples/apps/ncp/ot-ncp-mtd
|
||||
build/efr32mg21/examples/apps/ncp/ot-rcp
|
||||
build/efr32mg21/examples/platforms/efr32/sleepy-demo/sleepy-demo-ftd/sleepy-demo-ftd
|
||||
build/efr32mg21/examples/platforms/efr32/sleepy-demo/sleepy-demo-mtd/sleepy-demo-mtd
|
||||
```
|
||||
|
||||
**autotools (soon to be depracated)**
|
||||
|
||||
```bash
|
||||
$ make -f examples/Makefile-efr32mg21 BOARD=BRD4180A
|
||||
```
|
||||
|
||||
After a successful build, the `elf` files are found in `<path-to-openthread>/output/efr32mg21/bin`.
|
||||
|
||||
## Flash Binaries
|
||||
|
||||
Simplicity Commander provides a graphical interface for J-Link Commander.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>/output/efr32mg21/bin
|
||||
$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex
|
||||
$ <path-to-simplicity-studio>/developer/adapter_packs/commander/commander
|
||||
```
|
||||
|
||||
In the J-Link Device drop-down list select the serial number of the device to flash. Click the Adapter Connect button. Ensure the Debug Interface drop-down list is set to SWD and click the Target Connect button. Click on the Flash icon on the left side of the window to switch to the flash page. In the Flash MCU pane enter the path of the ot-cli-ftd.s37 file or choose the file with the Browse... button. Click the Flash button located under the Browse... button.
|
||||
|
||||
## Run the example with EFR32MG21 boards
|
||||
|
||||
1. Flash two EFR32 boards with the `CLI example` firmware (as shown above).
|
||||
2. Open terminal to first device `/dev/ttyACM0` (serial port settings: 115200 8-N-1). Type `help` for a list of commands.
|
||||
|
||||
```bash
|
||||
> help
|
||||
help
|
||||
channel
|
||||
childtimeout
|
||||
contextreusedelay
|
||||
extaddr
|
||||
extpanid
|
||||
ipaddr
|
||||
keysequence
|
||||
leaderweight
|
||||
masterkey
|
||||
mode
|
||||
netdata register
|
||||
networkidtimeout
|
||||
networkname
|
||||
panid
|
||||
ping
|
||||
prefix
|
||||
releaserouterid
|
||||
rloc16
|
||||
route
|
||||
routerupgradethreshold
|
||||
scan
|
||||
start
|
||||
state
|
||||
stop
|
||||
```
|
||||
|
||||
3. Start a Thread network as Leader.
|
||||
|
||||
```bash
|
||||
> panid 0xface
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
leader
|
||||
Done
|
||||
```
|
||||
|
||||
4. Open terminal to second device `/dev/ttyACM1` (serial port settings: 115200 8-N-1) and attach it to the Thread network as a Router.
|
||||
|
||||
```bash
|
||||
> panid 0xface
|
||||
Done
|
||||
> routerselectionjitter 1
|
||||
Done
|
||||
> ifconfig up
|
||||
Done
|
||||
> thread start
|
||||
Done
|
||||
|
||||
wait a couple of seconds...
|
||||
|
||||
> state
|
||||
router
|
||||
Done
|
||||
```
|
||||
|
||||
5. List all IPv6 addresses of Leader.
|
||||
|
||||
```bash
|
||||
> ipaddr
|
||||
fdde:ad00:beef:0:0:ff:fe00:fc00
|
||||
fdde:ad00:beef:0:0:ff:fe00:800
|
||||
fdde:ad00:beef:0:5b:3bcd:deff:7786
|
||||
fe80:0:0:0:6447:6e10:cf7:ee29
|
||||
Done
|
||||
```
|
||||
|
||||
6. Send an ICMPv6 ping to Leader's Mesh-EID IPv6 address.
|
||||
|
||||
```bash
|
||||
> ping fdde:ad00:beef:0:5b:3bcd:deff:7786
|
||||
8 bytes from fdde:ad00:beef:0:5b:3bcd:deff:7786: icmp_seq=1 hlim=64 time=24ms
|
||||
```
|
||||
|
||||
The above example demonstrates basic OpenThread capabilities. Enable more features/roles (e.g. commissioner, joiner, DHCPv6 Server/Client, etc.) by assigning compile-options before compiling.
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
$ make -f examples/Makefile-efr32mg21 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1
|
||||
```
|
||||
|
||||
For a list of all available commands, visit [OpenThread CLI Reference README.md][cli].
|
||||
|
||||
[cli]: https://github.com/openthread/openthread/blob/main/src/cli/README.md
|
||||
|
||||
## Verification
|
||||
|
||||
The following toolchain has been used for testing and verification:
|
||||
|
||||
- gcc version 7.3.1
|
||||
|
||||
The EFR32 example has been verified with following Flex SDK/RAIL Library version:
|
||||
|
||||
- Flex SDK v3.1.x
|
||||
The OpenThread on EFR32 example has moved to https://github.com/openthread/ot-efr32
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM)
|
||||
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
|
||||
set(CMAKE_RANLIB arm-none-eabi-ranlib)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set(COMMON_C_FLAGS "-mcpu=cortex-m33 -mthumb -fmessage-length=0 -ffunction-sections -fdata-sections -mfpu=fpv5-sp-d16 -mfloat-abi=hard")
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
|
||||
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
|
||||
set(CMAKE_ASM_FLAGS_DEBUG "-g")
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
set(CMAKE_ASM_FLAGS_RELEASE "")
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
#endif
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,268 +0,0 @@
|
||||
#ifndef HAL_CONFIG_H
|
||||
#define HAL_CONFIG_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (2U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortD)
|
||||
|
||||
#define BSP_BUTTON1_PIN (3U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortD)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_EM23CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_EM4CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_RTCCCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE (129)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define BSP_CLK_LFXO_CTUNE (79U)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[FEM]
|
||||
// [FEM]$
|
||||
|
||||
// $[GPIO]
|
||||
#define PORTIO_GPIO_SWV_PIN (3U)
|
||||
#define PORTIO_GPIO_SWV_PORT (gpioPortA)
|
||||
|
||||
#define BSP_TRACE_SWO_PIN (3U)
|
||||
#define BSP_TRACE_SWO_PORT (gpioPortA)
|
||||
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IADC0]
|
||||
// [IADC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (0U)
|
||||
#define BSP_LED0_PORT (gpioPortB)
|
||||
|
||||
#define BSP_LED1_PIN (1U)
|
||||
#define BSP_LED1_PORT (gpioPortB)
|
||||
|
||||
#define BSP_LED_COUNT (2U)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
#define HAL_LED_COUNT (2U)
|
||||
#define HAL_LED_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define BSP_LED_POLARITY (1)
|
||||
// [LED]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[MODEM]
|
||||
// [MODEM]$
|
||||
|
||||
// $[PA]
|
||||
#define HAL_PA_ENABLE (1)
|
||||
|
||||
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
|
||||
#define HAL_PA_POWER (252U)
|
||||
#define HAL_PA_RAMP (10UL)
|
||||
#define BSP_PA_VOLTAGE (3300U)
|
||||
#define HAL_PA_SELECTION (HAL_PA_SELECTION_2P4_HP)
|
||||
// [PA]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DFRAME_PIN (5U)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortC)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (4U)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortC)
|
||||
|
||||
#define HAL_PTI_ENABLE (1)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (5U)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortC)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (4U)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortC)
|
||||
|
||||
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
|
||||
#define HAL_PTI_BAUD_RATE (1600000UL)
|
||||
// [PTI]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define HAL_SERIAL_USART0_ENABLE (0)
|
||||
#define HAL_SERIAL_LEUART0_ENABLE (0)
|
||||
#define HAL_SERIAL_USART1_ENABLE (0)
|
||||
#define HAL_SERIAL_USART2_ENABLE (0)
|
||||
#define HAL_SERIAL_USART3_ENABLE (0)
|
||||
#define HAL_SERIAL_RXWAKE_ENABLE (0)
|
||||
|
||||
#define BSP_SERIAL_APP_TX_PIN (5U)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (6U)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_SERIAL_APP_CTS_PIN (4U)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (1U)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortC)
|
||||
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128UL)
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200UL)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16UL)
|
||||
#define HAL_SERIAL_APP_RXSTART (16UL)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPINCP]
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[TIMER2]
|
||||
// [TIMER2]$
|
||||
|
||||
// $[TIMER3]
|
||||
// [TIMER3]$
|
||||
|
||||
// $[UARTNCP]
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (4U)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (1U)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortC)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (6U)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (5U)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_USART0_TX_PIN (5U)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
|
||||
#define HAL_USART0_ENABLE (1)
|
||||
|
||||
#define BSP_USART0_RX_PIN (6U)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (4U)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (1U)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortC)
|
||||
|
||||
#define HAL_USART0_BAUD_RATE (115200UL)
|
||||
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
#define HAL_USART0_RXSTOP (16UL)
|
||||
#define HAL_USART0_RXSTART (16UL)
|
||||
#define HAL_USART0_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_USART0_RX_QUEUE_SIZE (128UL)
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
// [USART2]$
|
||||
|
||||
// $[VCOM]
|
||||
#define HAL_VCOM_ENABLE (1)
|
||||
|
||||
#define BSP_VCOM_ENABLE_PIN (4U)
|
||||
#define BSP_VCOM_ENABLE_PORT (gpioPortD)
|
||||
|
||||
// [VCOM]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
#define HAL_WDOG_ENABLE (0)
|
||||
|
||||
// [WDOG]$
|
||||
|
||||
#if defined(_SILICON_LABS_MODULE)
|
||||
#include "sl_module.h"
|
||||
#endif
|
||||
|
||||
#endif /* HAL_CONFIG_H */
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes dev board compile-time configuration constants for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_CONFIG_H__
|
||||
#define __BOARD_CONFIG_H__
|
||||
|
||||
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 /// Dev board suppports OQPSK modulation in 2.4GHz band.
|
||||
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 0 /// Dev board doesn't support OQPSK modulation in 915MHz band.
|
||||
|
||||
#ifndef RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT
|
||||
#define RADIO_CONFIG_DEBUG_COUNTERS_SUPPORT 0 /// Set to 1 to enable debug counters in radio.c
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_DMP_SUPPORT
|
||||
#define RADIO_CONFIG_DMP_SUPPORT 0 /// Set to 1 to enable Dynamic Multi-Protocol support in radio.c
|
||||
#endif
|
||||
|
||||
#endif // __BOARD_CONFIG_H__
|
||||
@@ -1,279 +0,0 @@
|
||||
#ifndef HAL_CONFIG_H
|
||||
#define HAL_CONFIG_H
|
||||
|
||||
#include "em_device.h"
|
||||
#include "hal-config-types.h"
|
||||
|
||||
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
|
||||
// Content outside these regions will be preserved.
|
||||
|
||||
// $[ACMP0]
|
||||
// [ACMP0]$
|
||||
|
||||
// $[ACMP1]
|
||||
// [ACMP1]$
|
||||
|
||||
// $[ANTDIV]
|
||||
// [ANTDIV]$
|
||||
|
||||
// $[BTL_BUTTON]
|
||||
// [BTL_BUTTON]$
|
||||
|
||||
// $[BUTTON]
|
||||
#define BSP_BUTTON_PRESENT (1)
|
||||
|
||||
#define BSP_BUTTON0_PIN (0U)
|
||||
#define BSP_BUTTON0_PORT (gpioPortB)
|
||||
|
||||
#define BSP_BUTTON1_PIN (1U)
|
||||
#define BSP_BUTTON1_PORT (gpioPortB)
|
||||
|
||||
#define BSP_BUTTON_COUNT (2U)
|
||||
#define BSP_BUTTON_INIT \
|
||||
{ \
|
||||
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
|
||||
}
|
||||
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
|
||||
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
|
||||
#define HAL_BUTTON_COUNT (2U)
|
||||
#define HAL_BUTTON_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
// [BUTTON]$
|
||||
|
||||
// $[CMU]
|
||||
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
|
||||
#define HAL_CLK_PLL_CONFIGURATION (HAL_CLK_PLL_CONFIGURATION_40MHZ)
|
||||
#define HAL_CLK_EM01CLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFRCODPLL)
|
||||
#define HAL_CLK_EM23CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_EM4CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_RTCCCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define HAL_CLK_WDOGCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
|
||||
#define BSP_CLK_HFXO_PRESENT (1)
|
||||
#define BSP_CLK_HFXO_FREQ (38400000UL)
|
||||
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
|
||||
#define BSP_CLK_HFXO_CTUNE (129)
|
||||
#define BSP_CLK_LFXO_PRESENT (1)
|
||||
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
|
||||
#define BSP_CLK_LFXO_FREQ (32768U)
|
||||
#define BSP_CLK_LFXO_CTUNE (37U)
|
||||
#define HAL_CLK_LFXO_PRECISION (100UL)
|
||||
// [CMU]$
|
||||
|
||||
// $[COEX]
|
||||
// [COEX]$
|
||||
|
||||
// $[EMU]
|
||||
// [EMU]$
|
||||
|
||||
// $[EXTFLASH]
|
||||
// [EXTFLASH]$
|
||||
|
||||
// $[EZRADIOPRO]
|
||||
// [EZRADIOPRO]$
|
||||
|
||||
// $[FEM]
|
||||
// [FEM]$
|
||||
|
||||
// $[GPIO]
|
||||
#define PORTIO_GPIO_SWV_PIN (3U)
|
||||
#define PORTIO_GPIO_SWV_PORT (gpioPortA)
|
||||
|
||||
#define BSP_TRACE_SWO_PIN (3U)
|
||||
#define BSP_TRACE_SWO_PORT (gpioPortA)
|
||||
|
||||
// [GPIO]$
|
||||
|
||||
// $[I2C0]
|
||||
// [I2C0]$
|
||||
|
||||
// $[I2C1]
|
||||
// [I2C1]$
|
||||
|
||||
// $[I2CSENSOR]
|
||||
// [I2CSENSOR]$
|
||||
|
||||
// $[IADC0]
|
||||
// [IADC0]$
|
||||
|
||||
// $[IOEXP]
|
||||
// [IOEXP]$
|
||||
|
||||
// $[LED]
|
||||
#define BSP_LED_PRESENT (1)
|
||||
|
||||
#define BSP_LED0_PIN (2U)
|
||||
#define BSP_LED0_PORT (gpioPortD)
|
||||
|
||||
#define BSP_LED1_PIN (3U)
|
||||
#define BSP_LED1_PORT (gpioPortD)
|
||||
|
||||
#define BSP_LED_COUNT (2U)
|
||||
#define BSP_LED_INIT \
|
||||
{ \
|
||||
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
|
||||
}
|
||||
#define HAL_LED_COUNT (2U)
|
||||
#define HAL_LED_ENABLE \
|
||||
{ \
|
||||
0, 1 \
|
||||
}
|
||||
#define BSP_LED_POLARITY (1)
|
||||
// [LED]$
|
||||
|
||||
// $[LETIMER0]
|
||||
// [LETIMER0]$
|
||||
|
||||
// $[LFXO]
|
||||
// [LFXO]$
|
||||
|
||||
// $[MODEM]
|
||||
// [MODEM]$
|
||||
|
||||
// $[PA]
|
||||
#define HAL_PA_ENABLE (1)
|
||||
|
||||
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
|
||||
#define HAL_PA_POWER (252U)
|
||||
#define HAL_PA_RAMP (10UL)
|
||||
#define BSP_PA_VOLTAGE (3300U)
|
||||
#define HAL_PA_SELECTION (HAL_PA_SELECTION_2P4_HP)
|
||||
// [PA]$
|
||||
|
||||
// $[PORTIO]
|
||||
// [PORTIO]$
|
||||
|
||||
// $[PRS]
|
||||
// [PRS]$
|
||||
|
||||
// $[PTI]
|
||||
#define PORTIO_PTI_DFRAME_PIN (5U)
|
||||
#define PORTIO_PTI_DFRAME_PORT (gpioPortC)
|
||||
|
||||
#define PORTIO_PTI_DOUT_PIN (4U)
|
||||
#define PORTIO_PTI_DOUT_PORT (gpioPortC)
|
||||
|
||||
#define HAL_PTI_ENABLE (1)
|
||||
|
||||
#define BSP_PTI_DFRAME_PIN (5U)
|
||||
#define BSP_PTI_DFRAME_PORT (gpioPortC)
|
||||
|
||||
#define BSP_PTI_DOUT_PIN (4U)
|
||||
#define BSP_PTI_DOUT_PORT (gpioPortC)
|
||||
|
||||
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
|
||||
#define HAL_PTI_BAUD_RATE (1600000UL)
|
||||
// [PTI]$
|
||||
|
||||
// $[SERIAL]
|
||||
#define HAL_SERIAL_RXWAKE_ENABLE (0)
|
||||
#define HAL_SERIAL_IDLE_WAKE_ENABLE (1)
|
||||
#define HAL_SERIAL_USART0_ENABLE (0)
|
||||
#define HAL_SERIAL_USART1_ENABLE (0)
|
||||
#define HAL_SERIAL_USART2_ENABLE (0)
|
||||
|
||||
#define BSP_SERIAL_APP_TX_PIN (5U)
|
||||
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_SERIAL_APP_RX_PIN (6U)
|
||||
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_SERIAL_APP_CTS_PIN (4U)
|
||||
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
|
||||
|
||||
#define BSP_SERIAL_APP_RTS_PIN (1U)
|
||||
#define BSP_SERIAL_APP_RTS_PORT (gpioPortC)
|
||||
|
||||
#define HAL_SERIAL_APP_BAUD_RATE (115200UL)
|
||||
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
#define HAL_SERIAL_APP_RXSTOP (16UL)
|
||||
#define HAL_SERIAL_APP_RXSTART (16UL)
|
||||
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128UL)
|
||||
// [SERIAL]$
|
||||
|
||||
// $[SPIDISPLAY]
|
||||
// [SPIDISPLAY]$
|
||||
|
||||
// $[SPINCP]
|
||||
// [SPINCP]$
|
||||
|
||||
// $[TIMER0]
|
||||
// [TIMER0]$
|
||||
|
||||
// $[TIMER1]
|
||||
// [TIMER1]$
|
||||
|
||||
// $[TIMER2]
|
||||
// [TIMER2]$
|
||||
|
||||
// $[TIMER3]
|
||||
// [TIMER3]$
|
||||
|
||||
// $[UARTNCP]
|
||||
// [UARTNCP]$
|
||||
|
||||
// $[USART0]
|
||||
#define PORTIO_USART0_CTS_PIN (4U)
|
||||
#define PORTIO_USART0_CTS_PORT (gpioPortA)
|
||||
|
||||
#define PORTIO_USART0_RTS_PIN (1U)
|
||||
#define PORTIO_USART0_RTS_PORT (gpioPortC)
|
||||
|
||||
#define PORTIO_USART0_RX_PIN (6U)
|
||||
#define PORTIO_USART0_RX_PORT (gpioPortA)
|
||||
|
||||
#define PORTIO_USART0_TX_PIN (5U)
|
||||
#define PORTIO_USART0_TX_PORT (gpioPortA)
|
||||
|
||||
#define HAL_USART0_ENABLE (1)
|
||||
|
||||
#define BSP_USART0_TX_PIN (5U)
|
||||
#define BSP_USART0_TX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_USART0_RX_PIN (6U)
|
||||
#define BSP_USART0_RX_PORT (gpioPortA)
|
||||
|
||||
#define BSP_USART0_CTS_PIN (4U)
|
||||
#define BSP_USART0_CTS_PORT (gpioPortA)
|
||||
|
||||
#define BSP_USART0_RTS_PIN (1U)
|
||||
#define BSP_USART0_RTS_PORT (gpioPortC)
|
||||
|
||||
#define HAL_USART0_BAUD_RATE (115200UL)
|
||||
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
|
||||
#define HAL_USART0_RXSTOP (16UL)
|
||||
#define HAL_USART0_RXSTART (16UL)
|
||||
#define HAL_USART0_TX_QUEUE_SIZE (128UL)
|
||||
#define HAL_USART0_RX_QUEUE_SIZE (128UL)
|
||||
// [USART0]$
|
||||
|
||||
// $[USART1]
|
||||
// [USART1]$
|
||||
|
||||
// $[USART2]
|
||||
// [USART2]$
|
||||
|
||||
// $[VCOM]
|
||||
#define HAL_VCOM_ENABLE (1)
|
||||
|
||||
#define BSP_VCOM_ENABLE_PIN (4U)
|
||||
#define BSP_VCOM_ENABLE_PORT (gpioPortD)
|
||||
|
||||
// [VCOM]$
|
||||
|
||||
// $[VUART]
|
||||
// [VUART]$
|
||||
|
||||
// $[WDOG]
|
||||
#define HAL_WDOG_ENABLE (0)
|
||||
|
||||
// [WDOG]$
|
||||
|
||||
#if defined(_SILICON_LABS_MODULE)
|
||||
#include "sl_module.h"
|
||||
#endif
|
||||
|
||||
#endif /* HAL_CONFIG_H */
|
||||
@@ -1,68 +0,0 @@
|
||||
// This is an autogenerated config file, any changes to this file will be overwritten
|
||||
|
||||
#ifndef MBEDTLS_CONFIG_AUTOGEN_H
|
||||
#define MBEDTLS_CONFIG_AUTOGEN_H
|
||||
|
||||
#define MBEDTLS_ECP_MAX_BITS 256
|
||||
|
||||
#define MBEDTLS_MPI_MAX_SIZE 32
|
||||
|
||||
#define MBEDTLS_AES_C
|
||||
#define MBEDTLS_CIPHER_MODE_CTR
|
||||
#define MBEDTLS_CIPHER_MODE_CBC
|
||||
#define MBEDTLS_CIPHER_MODE_CFB
|
||||
#define MBEDTLS_ASN1_PARSE_C
|
||||
#define MBEDTLS_ASN1_WRITE_C
|
||||
#define MBEDTLS_BASE64_C
|
||||
#define MBEDTLS_CCM_C
|
||||
#define MBEDTLS_CIPHER_C
|
||||
#define MBEDTLS_CMAC_C
|
||||
#define MBEDTLS_SSL_PROTO_DTLS
|
||||
#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
|
||||
#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
|
||||
#define MBEDTLS_SSL_COOKIE_C
|
||||
#define MBEDTLS_ECP_C
|
||||
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
#define MBEDTLS_ECDH_C
|
||||
#define MBEDTLS_ECDH_LEGACY_CONTEXT
|
||||
#define MBEDTLS_ECDSA_C
|
||||
#define MBEDTLS_ENTROPY_HARDWARE_ALT
|
||||
#define MBEDTLS_MD_C
|
||||
#define MBEDTLS_ECJPAKE_C
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
||||
#define MBEDTLS_BIGNUM_C
|
||||
#define MBEDTLS_PEM_PARSE_C
|
||||
#define MBEDTLS_ENTROPY_C
|
||||
#define MBEDTLS_ENTROPY_FORCE_SHA256
|
||||
#define MBEDTLS_ENTROPY_MAX_SOURCES 2
|
||||
#define MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
#define MBEDTLS_CTR_DRBG_C
|
||||
#define MBEDTLS_SHA256_C
|
||||
#define MBEDTLS_SSL_TLS_C
|
||||
#define MBEDTLS_SSL_CLI_C
|
||||
#define MBEDTLS_SSL_PROTO_TLS1_2
|
||||
#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
|
||||
#define MBEDTLS_SSL_SRV_C
|
||||
#define MBEDTLS_X509_USE_C
|
||||
#define MBEDTLS_X509_CRT_PARSE_C
|
||||
#define MBEDTLS_X509_CRL_PARSE_C
|
||||
#define MBEDTLS_X509_CSR_PARSE_C
|
||||
#define MBEDTLS_OID_C
|
||||
#define MBEDTLS_PK_C
|
||||
#define MBEDTLS_PK_PARSE_C
|
||||
#define MBEDTLS_PSA_CRYPTO_DRIVERS
|
||||
#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
|
||||
|
||||
#include "config-device-acceleration.h"
|
||||
|
||||
#if !defined(TEST_SUITE_MEMORY_BUFFER_ALLOC)
|
||||
#include "sl_malloc.h"
|
||||
|
||||
#define MBEDTLS_PLATFORM_FREE_MACRO sl_free
|
||||
#define MBEDTLS_PLATFORM_CALLOC_MACRO sl_calloc
|
||||
#endif
|
||||
|
||||
#define MBEDTLS_PLATFORM_MEMORY
|
||||
#define MBEDTLS_PLATFORM_C
|
||||
|
||||
#endif
|
||||
@@ -1,92 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# ==============================================================================
|
||||
# Verify board is supported for platform
|
||||
# ==============================================================================
|
||||
if(BOARD_LOWERCASE STREQUAL "brd4180a")
|
||||
set(MCU "EFR32MG21A020F1024IM32")
|
||||
elseif(BOARD_LOWERCASE STREQUAL "brd4180b")
|
||||
set(MCU "EFR32MG21A020F1024IM32")
|
||||
else()
|
||||
message(FATAL_ERROR "
|
||||
BOARD=${BOARD} not supported.
|
||||
|
||||
Please provide a value for BOARD variable e.g BOARD=brd4180a.
|
||||
Currently supported:
|
||||
- brd4180a
|
||||
- brd4180b
|
||||
")
|
||||
endif()
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES "${MCU}")
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
|
||||
# ==============================================================================
|
||||
# Platform library
|
||||
# ==============================================================================
|
||||
set(OT_PLATFORM_LIB "openthread-efr32mg21")
|
||||
set(OT_PLATFORM_LIB ${OT_PLATFORM_LIB} PARENT_SCOPE)
|
||||
|
||||
set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/efr32mg21/efr32mg21.ld")
|
||||
|
||||
add_library(openthread-efr32mg21
|
||||
${EFR32_COMMON_SOURCES}
|
||||
$<TARGET_OBJECTS:openthread-platform-utils>
|
||||
)
|
||||
|
||||
target_link_libraries(openthread-efr32mg21
|
||||
PUBLIC
|
||||
${EFR32_COMMON_3RD_LIBS}
|
||||
silabs-libnvm3_CM33_gcc
|
||||
silabs-efr32mg21-sdk
|
||||
-T${LD_FILE}
|
||||
-Wl,--gc-sections
|
||||
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
|
||||
PRIVATE
|
||||
ot-config
|
||||
)
|
||||
|
||||
target_compile_definitions(openthread-efr32mg21
|
||||
PUBLIC
|
||||
${OT_PLATFORM_DEFINES}
|
||||
)
|
||||
|
||||
target_compile_options(openthread-efr32mg21
|
||||
PRIVATE
|
||||
${EFR32_CFLAGS}
|
||||
)
|
||||
|
||||
target_include_directories(openthread-efr32mg21
|
||||
PUBLIC
|
||||
${EFR32_INCLUDES}
|
||||
PRIVATE
|
||||
${SILABS_EFR32MG2X_INCLUDES}
|
||||
${OT_PUBLIC_INCLUDES}
|
||||
)
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread linker script for the
|
||||
* Silicon Labs efr32mg21 platform.
|
||||
*
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1024K
|
||||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 96K
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapBase
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __Vectors_End
|
||||
* __Vectors_Size
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
__Vectors_End = .;
|
||||
__Vectors_Size = __Vectors_End - __Vectors;
|
||||
__end__ = .;
|
||||
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG (__data2_end__ - __data2_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
LONG (__bss2_start__)
|
||||
LONG (__bss2_end__ - __bss2_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
__etext = .;
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
. = ALIGN (4);
|
||||
PROVIDE (__ram_func_section_start = .);
|
||||
*(.ram)
|
||||
PROVIDE (__ram_func_section_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM
|
||||
|
||||
.heap (COPY):
|
||||
{
|
||||
__HeapBase = .;
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
_end = __end__;
|
||||
KEEP(*(.heap*))
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy (COPY):
|
||||
{
|
||||
KEEP(*(.stack*))
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/*******************************************************************/
|
||||
/* Define flash block for nvm3 */
|
||||
.nvm (DSECT) : {
|
||||
KEEP(*(.simee*))
|
||||
} > FLASH
|
||||
|
||||
linker_nvm_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
||||
linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm);
|
||||
linker_nvm_size = SIZEOF(.nvm);
|
||||
__nvm3Base = linker_nvm_begin;
|
||||
/*******************************************************************/
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
|
||||
/* Check if FLASH usage exceeds FLASH size */
|
||||
/*ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")*/
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if(OT_FTD)
|
||||
add_subdirectory(sleepy-demo-ftd)
|
||||
endif()
|
||||
|
||||
if(OT_MTD)
|
||||
add_subdirectory(sleepy-demo-mtd)
|
||||
endif()
|
||||
@@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
|
||||
# Always package (e.g. for 'make dist') these subdirectories.
|
||||
|
||||
DIST_SUBDIRS = \
|
||||
sleepy-demo-mtd \
|
||||
sleepy-demo-ftd \
|
||||
$(NULL)
|
||||
|
||||
# Always build (e.g. for 'make all') these subdirectories.
|
||||
|
||||
SUBDIRS = \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_EXECUTABLE
|
||||
SUBDIRS += \
|
||||
sleepy-demo-mtd \
|
||||
sleepy-demo-ftd \
|
||||
$(NULL)
|
||||
endif
|
||||
@@ -1,75 +0,0 @@
|
||||
# EFR32 Sleepy Demo Example
|
||||
|
||||
The EFR32 Sleepy applications demonstrates Sleepy End Device behavior using the EFR32's low power EM2 mode. The steps below will take you through the process of building and running the demo
|
||||
|
||||
For setting up the build environment refer to [examples/platforms/efr32/README.md](../README.md).
|
||||
|
||||
## 1. Build
|
||||
|
||||
In this `README`, all example commands will be targeting the `efr32mg12` platform. The same commands should work for the other `efr32` platforms
|
||||
|
||||
```bash
|
||||
$ cd <path-to-openthread>
|
||||
$ ./bootstrap
|
||||
$ make -f examples/Makefile-efr32mg12 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1 BOARD=BRD4161A
|
||||
```
|
||||
|
||||
Convert the resulting executables into S-Record format and append a s37 suffix.
|
||||
|
||||
```bash
|
||||
$ cd output/efr32mg12/bin
|
||||
$ arm-none-eabi-objcopy -O srec sleepy-demo-mtd sleepy-demo-mtd.s37
|
||||
$ arm-none-eabi-objcopy -O srec sleepy-demo-ftd sleepy-demo-ftd.s37
|
||||
```
|
||||
|
||||
In Silicon Labs Simplicity Studio flash one device with the sleepy-demo-mtd.s37 image and the other device with the sleepy-demo-ftd.s37 image.
|
||||
|
||||
For instructions on flashing firmware, see [examples/platforms/efr32/README.md](../README.md#flash-binaries)
|
||||
|
||||
## 2. Starting nodes
|
||||
|
||||
For demonstration purposes the network settings are hardcoded within the source files. The devices start Thread and form a network within a few seconds of powering on. In a real-life application the devices should implement and go through a commissioning process to create a network and add devices.
|
||||
|
||||
When the sleepy-demo-ftd device is started in the CLI the user shall see:
|
||||
|
||||
```
|
||||
sleepy-demo-ftd started
|
||||
sleepy-demo-ftd changed to leader
|
||||
```
|
||||
|
||||
When the sleepy-demo-mtd device starts it joins the pre-configured Thread network before disabling Rx-On-Idle to become a Sleepy-End-Device.
|
||||
|
||||
Use the command "child table" in the FTD console and observe the R flag of the child is 0.
|
||||
|
||||
```
|
||||
> child table
|
||||
| ID | RLOC16 | Timeout | Age | LQ In | C_VN |R|S|D|N| Extended MAC |
|
||||
+-----+--------+------------+------------+-------+------+-+-+-+-+------------------+
|
||||
| 1 | 0x8401 | 240 | 3 | 3 | 3 |0|1|0|0| 8e8582dbd78c243c |
|
||||
|
||||
Done
|
||||
```
|
||||
|
||||
## 3. Buttons on the MTD
|
||||
|
||||
Pressing button 0 on the MTD toggles between operating as a Minimal End Device (MED) and a Sleepy End Device (SED) with the RX off when idle.
|
||||
|
||||
Pressing button 1 on the MTD sends a multicast UDP message containing the string "mtd button". The FTD listens on the multicast address and will toggle LED 0 and display a message in the CLI showing "Message Received: mtd button".
|
||||
|
||||
## 4. Buttons on the FTD
|
||||
|
||||
Pressing either button 0 or 1 on the FTD will send a UDP message to the FTD containing the string "ftd button". The MTD must first send a multicast message by pressing the MTD's button 1 so that the FTD knows the address of the MTD to send messages to.
|
||||
|
||||
This will toggle the state of LED0 on the MTD. If the MTD is operating as a sleepy end device then the MTD polls the parent every 5 seconds for messages and will update the LED state on the next poll.
|
||||
|
||||
## 5. Monitoring power consumption of the MTD
|
||||
|
||||
Open the Energy Profiler within Silicon Labs Simplicity Studio. Within the Quick Access menu select Start Energy Capture... and select the MTD device. When operating as a Sleepy End Device with no LEDs on the current should be under 20 microamps with occasional spikes during waking and polling the parent. With the LED on the MTD has a current consumption of approximately 1mA.
|
||||
|
||||
When operating as a Minimal End Device with the Rx on Idle observe that the current is in the order of 10ma.
|
||||
|
||||
With further configuration of GPIOs and peripherals it is possible to reduce the sleepy current consumption further.
|
||||
|
||||
## 6. Notes on sleeping, sleepy callback and interrupts
|
||||
|
||||
To allow the EFR32 to enter sleepy mode the application must register a callback with efr32SetSleepCallback. The return value of callback is used to indicate that the application has no further work to do and that it is safe to go into a low power mode. The callback is called with interrupts disabled so should do the minimum required to check if it can sleep.
|
||||
@@ -1,53 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
add_executable(sleepy-demo-ftd
|
||||
${PROJECT_SOURCE_DIR}/examples/apps/cli/cli_uart.cpp
|
||||
main.c
|
||||
)
|
||||
|
||||
target_include_directories(sleepy-demo-ftd PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_link_libraries(sleepy-demo-ftd PRIVATE
|
||||
openthread-cli-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-ftd
|
||||
${OT_PLATFORM_LIB}
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
|
||||
target_compile_options(sleepy-demo-ftd
|
||||
PRIVATE
|
||||
${EFR32_CFLAGS}
|
||||
)
|
||||
|
||||
install(TARGETS sleepy-demo-ftd
|
||||
DESTINATION bin)
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/Makefile.platform.am
|
||||
|
||||
override CFLAGS := $(filter-out -Wconversion,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wconversion,$(CXXFLAGS))
|
||||
|
||||
bin_PROGRAMS = \
|
||||
$(NULL)
|
||||
|
||||
CPPFLAGS_COMMON += \
|
||||
-DPLATFORM_HEADER=\"platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
|
||||
-Wno-sign-compare \
|
||||
-I$(top_srcdir)/examples/apps/cli \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/$(BOARD_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
$(SILABS_GSDK_CPPFLAGS) \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
$(NULL)
|
||||
|
||||
LDADD_COMMON += \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS_COMMON += \
|
||||
$(NULL)
|
||||
|
||||
LIBTOOLFLAGS_COMMON += \
|
||||
$(NULL)
|
||||
|
||||
SOURCES_COMMON += \
|
||||
../../../../apps/cli/cli_uart.cpp \
|
||||
main.c \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_EXECUTABLE
|
||||
bin_PROGRAMS += \
|
||||
sleepy-demo-ftd \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
|
||||
# NOTE: The order of the -I flags should always be in order from part-specific to general.
|
||||
# This will make sure the correct header files are used for a part.
|
||||
sleepy_demo_ftd_CPPFLAGS = $(NULL)
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
sleepy_demo_ftd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG1_CPPFLAGS)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG12
|
||||
sleepy_demo_ftd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG12_CPPFLAGS)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG13
|
||||
sleepy_demo_ftd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG13_CPPFLAGS)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG21
|
||||
sleepy_demo_ftd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG21_CPPFLAGS)
|
||||
endif
|
||||
|
||||
sleepy_demo_ftd_CPPFLAGS += $(CPPFLAGS_COMMON)
|
||||
|
||||
|
||||
|
||||
sleepy_demo_ftd_LDADD = \
|
||||
$(top_builddir)/src/cli/libopenthread-cli-ftd.a \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
sleepy_demo_ftd_LDFLAGS = \
|
||||
$(LDFLAGS_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
sleepy_demo_ftd_LIBTOOLFLAGS = \
|
||||
$(LIBTOOLFLAGS_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
sleepy_demo_ftd_SOURCES = \
|
||||
$(SOURCES_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_LINKER_MAP
|
||||
sleepy_demo_ftd_LDFLAGS += -Wl,-Map=sleepy-demo-ftd.map
|
||||
endif
|
||||
|
||||
if OPENTHREAD_BUILD_COVERAGE
|
||||
CPPFLAGS_COMMON += \
|
||||
-DOPENTHREAD_ENABLE_COVERAGE \
|
||||
$(NULL)
|
||||
|
||||
CLEANFILES = $(wildcard *.gcda *.gcno)
|
||||
endif # OPENTHREAD_BUILD_COVERAGE
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -1,330 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "bsp.h"
|
||||
#include "em_cmu.h"
|
||||
#include "em_emu.h"
|
||||
#include "gpiointerrupt.h"
|
||||
#include "hal-config.h"
|
||||
#include "hal_common.h"
|
||||
#include "openthread-system.h"
|
||||
#include <assert.h>
|
||||
#include <common/logging.hpp>
|
||||
#include <openthread-core-config.h>
|
||||
#include <string.h>
|
||||
#include <openthread/cli.h>
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/dataset_ftd.h>
|
||||
#include <openthread/diag.h>
|
||||
#include <openthread/instance.h>
|
||||
#include <openthread/message.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <openthread/thread.h>
|
||||
#include <openthread/udp.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
|
||||
// Constants
|
||||
#define MULTICAST_ADDR "ff03::1"
|
||||
#define MULTICAST_PORT 123
|
||||
#define RECV_PORT 234
|
||||
#define MTD_MESSAGE "mtd button"
|
||||
#define FTD_MESSAGE "ftd button"
|
||||
|
||||
// Types
|
||||
typedef struct ButtonArray
|
||||
{
|
||||
GPIO_Port_TypeDef port;
|
||||
unsigned int pin;
|
||||
} ButtonArray_t;
|
||||
|
||||
// Prototypes
|
||||
void setNetworkConfiguration(otInstance *aInstance);
|
||||
void handleNetifStateChanged(uint32_t aFlags, void *aContext);
|
||||
void gpioInit(void (*gpioCallback)(uint8_t pin));
|
||||
void buttonCallback(uint8_t pin);
|
||||
void initUdp(void);
|
||||
void applicationTick(void);
|
||||
void sFtdReceiveCallback(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
|
||||
/**
|
||||
* This function initializes the CLI app.
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
*
|
||||
*/
|
||||
extern void otAppCliInit(otInstance *aInstance);
|
||||
|
||||
// Variables
|
||||
static otInstance * instance;
|
||||
static otUdpSocket sFtdSocket;
|
||||
static bool sLedOn = false;
|
||||
static bool sHaveSwitchAddress = false;
|
||||
static otIp6Address sSwitchAddress;
|
||||
static bool sFtdButtonPressed = false;
|
||||
static const ButtonArray_t sButtonArray[BSP_BUTTON_COUNT] = BSP_BUTTON_INIT;
|
||||
|
||||
void otTaskletsSignalPending(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
otSysInit(argc, argv);
|
||||
gpioInit(buttonCallback);
|
||||
|
||||
instance = otInstanceInitSingle();
|
||||
assert(instance);
|
||||
|
||||
otAppCliInit(instance);
|
||||
otCliOutputFormat("sleepy-demo-ftd started\r\n");
|
||||
|
||||
setNetworkConfiguration(instance);
|
||||
otSetStateChangedCallback(instance, handleNetifStateChanged, instance);
|
||||
initUdp();
|
||||
|
||||
otIp6SetEnabled(instance, true);
|
||||
otThreadSetEnabled(instance, true);
|
||||
|
||||
while (!otSysPseudoResetWasRequested())
|
||||
{
|
||||
otTaskletsProcess(instance);
|
||||
otSysProcessDrivers(instance);
|
||||
applicationTick();
|
||||
}
|
||||
|
||||
otInstanceFinalize(instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Provide, if required an "otPlatLog()" function
|
||||
*/
|
||||
#if OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_APP
|
||||
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, aFormat);
|
||||
otCliPlatLogv(aLogLevel, aLogRegion, aFormat, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Override default network settings, such as panid, so the devices can join a network
|
||||
*/
|
||||
void setNetworkConfiguration(otInstance *aInstance)
|
||||
{
|
||||
static char aNetworkName[] = "SleepyEFR32";
|
||||
otOperationalDataset aDataset;
|
||||
|
||||
memset(&aDataset, 0, sizeof(otOperationalDataset));
|
||||
|
||||
/*
|
||||
* Fields that can be configured in otOperationDataset to override defaults:
|
||||
* Network Name, Mesh Local Prefix, Extended PAN ID, PAN ID, Delay Timer,
|
||||
* Channel, Channel Mask Page 0, Network Master Key, PSKc, Security Policy
|
||||
*/
|
||||
aDataset.mActiveTimestamp = 1;
|
||||
aDataset.mComponents.mIsActiveTimestampPresent = true;
|
||||
|
||||
/* Set Channel to 15 */
|
||||
aDataset.mChannel = 15;
|
||||
aDataset.mComponents.mIsChannelPresent = true;
|
||||
|
||||
/* Set Pan ID to 2222 */
|
||||
aDataset.mPanId = (otPanId)0x2222;
|
||||
aDataset.mComponents.mIsPanIdPresent = true;
|
||||
|
||||
/* Set Extended Pan ID to C0DE1AB5C0DE1AB5 */
|
||||
uint8_t extPanId[OT_EXT_PAN_ID_SIZE] = {0xC0, 0xDE, 0x1A, 0xB5, 0xC0, 0xDE, 0x1A, 0xB5};
|
||||
memcpy(aDataset.mExtendedPanId.m8, extPanId, sizeof(aDataset.mExtendedPanId));
|
||||
aDataset.mComponents.mIsExtendedPanIdPresent = true;
|
||||
|
||||
/* Set master key to 1234C0DE1AB51234C0DE1AB51234C0DE */
|
||||
uint8_t key[OT_MASTER_KEY_SIZE] = {0x12, 0x34, 0xC0, 0xDE, 0x1A, 0xB5, 0x12, 0x34,
|
||||
0xC0, 0xDE, 0x1A, 0xB5, 0x12, 0x34, 0xC0, 0xDE};
|
||||
memcpy(aDataset.mMasterKey.m8, key, sizeof(aDataset.mMasterKey));
|
||||
aDataset.mComponents.mIsMasterKeyPresent = true;
|
||||
|
||||
/* Set Network Name to SleepyEFR32 */
|
||||
size_t length = strlen(aNetworkName);
|
||||
assert(length <= OT_NETWORK_NAME_MAX_SIZE);
|
||||
memcpy(aDataset.mNetworkName.m8, aNetworkName, length);
|
||||
aDataset.mComponents.mIsNetworkNamePresent = true;
|
||||
|
||||
otDatasetSetActive(aInstance, &aDataset);
|
||||
}
|
||||
|
||||
void handleNetifStateChanged(uint32_t aFlags, void *aContext)
|
||||
{
|
||||
if ((aFlags & OT_CHANGED_THREAD_ROLE) != 0)
|
||||
{
|
||||
otDeviceRole changedRole = otThreadGetDeviceRole(aContext);
|
||||
|
||||
switch (changedRole)
|
||||
{
|
||||
case OT_DEVICE_ROLE_LEADER:
|
||||
otCliOutputFormat("sleepy-demo-ftd changed to leader\r\n");
|
||||
break;
|
||||
case OT_DEVICE_ROLE_ROUTER:
|
||||
otCliOutputFormat("sleepy-demo-ftd changed to router\r\n");
|
||||
break;
|
||||
|
||||
case OT_DEVICE_ROLE_CHILD:
|
||||
break;
|
||||
|
||||
case OT_DEVICE_ROLE_DETACHED:
|
||||
case OT_DEVICE_ROLE_DISABLED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void gpioInit(void (*callback)(uint8_t pin))
|
||||
{
|
||||
// set up button GPIOs to input with pullups
|
||||
for (int i = 0; i < BSP_BUTTON_COUNT; i++)
|
||||
{
|
||||
GPIO_PinModeSet(sButtonArray[i].port, sButtonArray[i].pin, gpioModeInputPull, 1);
|
||||
}
|
||||
// set up interrupt based callback function on falling edge
|
||||
GPIOINT_Init();
|
||||
GPIOINT_CallbackRegister(sButtonArray[0].pin, callback);
|
||||
GPIOINT_CallbackRegister(sButtonArray[1].pin, callback);
|
||||
GPIO_IntConfig(sButtonArray[0].port, sButtonArray[0].pin, false, true, true);
|
||||
GPIO_IntConfig(sButtonArray[1].port, sButtonArray[1].pin, false, true, true);
|
||||
|
||||
BSP_LedsInit();
|
||||
BSP_LedClear(0);
|
||||
BSP_LedClear(1);
|
||||
}
|
||||
|
||||
void initUdp(void)
|
||||
{
|
||||
otError error;
|
||||
otSockAddr sockaddr;
|
||||
|
||||
memset(&sockaddr, 0, sizeof(sockaddr));
|
||||
|
||||
sockaddr.mPort = MULTICAST_PORT;
|
||||
|
||||
error = otUdpOpen(instance, &sFtdSocket, sFtdReceiveCallback, NULL);
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otCliOutputFormat("FTD failed to open udp multicast\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
error = otUdpBind(instance, &sFtdSocket, &sockaddr);
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otUdpClose(instance, &sFtdSocket);
|
||||
otCliOutputFormat("FTD failed to bind udp multicast\r\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void buttonCallback(uint8_t pin)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(pin);
|
||||
sFtdButtonPressed = true;
|
||||
}
|
||||
|
||||
void applicationTick(void)
|
||||
{
|
||||
otError error = 0;
|
||||
otMessageInfo messageInfo;
|
||||
otMessage * message = NULL;
|
||||
char * payload = FTD_MESSAGE;
|
||||
|
||||
if (sFtdButtonPressed == true)
|
||||
{
|
||||
sFtdButtonPressed = false;
|
||||
|
||||
if (sHaveSwitchAddress)
|
||||
{
|
||||
memset(&messageInfo, 0, sizeof(messageInfo));
|
||||
memcpy(&messageInfo.mPeerAddr, &sSwitchAddress, sizeof messageInfo.mPeerAddr);
|
||||
messageInfo.mPeerPort = RECV_PORT;
|
||||
|
||||
message = otUdpNewMessage(instance, NULL);
|
||||
|
||||
if (message != NULL)
|
||||
{
|
||||
error = otMessageAppend(message, payload, (uint16_t)strlen(payload));
|
||||
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
error = otUdpSend(instance, &sFtdSocket, message, &messageInfo);
|
||||
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (message != NULL)
|
||||
{
|
||||
otMessageFree(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sFtdReceiveCallback(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aContext);
|
||||
OT_UNUSED_VARIABLE(aMessage);
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
uint8_t buf[1500];
|
||||
int length;
|
||||
|
||||
sLedOn = !sLedOn;
|
||||
|
||||
if (sLedOn)
|
||||
{
|
||||
BSP_LedSet(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
BSP_LedClear(0);
|
||||
}
|
||||
|
||||
length = otMessageRead(aMessage, otMessageGetOffset(aMessage), buf, sizeof(buf) - 1);
|
||||
buf[length] = '\0';
|
||||
otCliOutputFormat("Message Received: %s\r\n", buf);
|
||||
|
||||
sHaveSwitchAddress = true;
|
||||
memcpy(&sSwitchAddress, &aMessageInfo->mPeerAddr, sizeof sSwitchAddress);
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
add_executable(sleepy-demo-mtd
|
||||
${PROJECT_SOURCE_DIR}/examples/apps/cli/cli_uart.cpp
|
||||
main.c
|
||||
)
|
||||
|
||||
target_include_directories(sleepy-demo-mtd PRIVATE ${COMMON_INCLUDES})
|
||||
|
||||
target_link_libraries(sleepy-demo-mtd PRIVATE
|
||||
openthread-cli-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
openthread-mtd
|
||||
${OT_PLATFORM_LIB}
|
||||
${OT_MBEDTLS}
|
||||
ot-config
|
||||
)
|
||||
|
||||
install(TARGETS sleepy-demo-mtd
|
||||
DESTINATION bin)
|
||||
@@ -1,135 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/Makefile.platform.am
|
||||
|
||||
override CFLAGS := $(filter-out -Wconversion,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wconversion,$(CXXFLAGS))
|
||||
|
||||
bin_PROGRAMS = \
|
||||
$(NULL)
|
||||
|
||||
CPPFLAGS_COMMON += \
|
||||
-DPLATFORM_HEADER=\"platform/base/hal/micro/cortexm3/compiler/gcc.h\" \
|
||||
-Wno-sign-compare \
|
||||
-I$(top_srcdir)/examples/apps/cli \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE)/$(BOARD_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/$(PLATFORM_LOWERCASE) \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
$(SILABS_GSDK_CPPFLAGS) \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
$(NULL)
|
||||
|
||||
LDADD_COMMON += \
|
||||
$(NULL)
|
||||
|
||||
LDFLAGS_COMMON += \
|
||||
$(NULL)
|
||||
|
||||
LIBTOOLFLAGS_COMMON += \
|
||||
$(NULL)
|
||||
|
||||
SOURCES_COMMON += \
|
||||
../../../../apps/cli/cli_uart.cpp \
|
||||
main.c \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_EXECUTABLE
|
||||
bin_PROGRAMS += \
|
||||
sleepy-demo-mtd \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
|
||||
# NOTE: The order of the -I flags should always be in order from part-specific to general.
|
||||
# This will make sure the correct header files are used for a part.
|
||||
sleepy_demo_mtd_CPPFLAGS = $(NULL)
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
sleepy_demo_mtd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG1_CPPFLAGS)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG12
|
||||
sleepy_demo_mtd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG12_CPPFLAGS)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG13
|
||||
sleepy_demo_mtd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG13_CPPFLAGS)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG21
|
||||
sleepy_demo_mtd_CPPFLAGS += \
|
||||
$(SILABS_EFR32MG21_CPPFLAGS)
|
||||
endif
|
||||
|
||||
sleepy_demo_mtd_CPPFLAGS += $(CPPFLAGS_COMMON)
|
||||
|
||||
|
||||
sleepy_demo_mtd_LDADD = \
|
||||
$(top_builddir)/src/cli/libopenthread-cli-mtd.a \
|
||||
$(top_builddir)/src/core/libopenthread-mtd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(top_builddir)/src/core/libopenthread-mtd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
sleepy_demo_mtd_LDFLAGS = \
|
||||
$(LDFLAGS_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
sleepy_demo_mtd_LIBTOOLFLAGS = \
|
||||
$(LIBTOOLFLAGS_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
sleepy_demo_mtd_SOURCES = \
|
||||
$(SOURCES_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_LINKER_MAP
|
||||
sleepy_demo_mtd_LDFLAGS += -Wl,-Map=sleepy-demo-mtd.map
|
||||
endif
|
||||
|
||||
if OPENTHREAD_BUILD_COVERAGE
|
||||
CPPFLAGS_COMMON += \
|
||||
-DOPENTHREAD_ENABLE_COVERAGE \
|
||||
$(NULL)
|
||||
|
||||
CLEANFILES = $(wildcard *.gcda *.gcno)
|
||||
endif # OPENTHREAD_BUILD_COVERAGE
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
@@ -1,382 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp.h"
|
||||
#include "em_cmu.h"
|
||||
#include "em_emu.h"
|
||||
#include "gpiointerrupt.h"
|
||||
#include "hal-config.h"
|
||||
#include "hal_common.h"
|
||||
#include "openthread-system.h"
|
||||
#include "platform-efr32.h"
|
||||
#include <common/logging.hpp>
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/cli.h>
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/dataset_ftd.h>
|
||||
#include <openthread/diag.h>
|
||||
#include <openthread/instance.h>
|
||||
#include <openthread/link.h>
|
||||
#include <openthread/message.h>
|
||||
#include <openthread/tasklet.h>
|
||||
#include <openthread/thread.h>
|
||||
#include <openthread/udp.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
|
||||
// Constants
|
||||
#define MULTICAST_ADDR "ff03::1"
|
||||
#define MULTICAST_PORT 123
|
||||
#define RECV_PORT 234
|
||||
#define SLEEPY_POLL_PERIOD_MS 5000
|
||||
#define MTD_MESSAGE "mtd button"
|
||||
#define FTD_MESSAGE "ftd button"
|
||||
|
||||
// Types
|
||||
typedef struct ButtonArray
|
||||
{
|
||||
GPIO_Port_TypeDef port;
|
||||
unsigned int pin;
|
||||
} ButtonArray_t;
|
||||
|
||||
// Prototypes
|
||||
bool sleepCb(void);
|
||||
void setNetworkConfiguration(otInstance *aInstance);
|
||||
void handleNetifStateChanged(uint32_t aFlags, void *aContext);
|
||||
void gpioInit(void (*gpioCallback)(uint8_t pin));
|
||||
void buttonCallback(uint8_t pin);
|
||||
void initUdp(void);
|
||||
void applicationTick(void);
|
||||
void mtdReceiveCallback(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
|
||||
/**
|
||||
* This function initializes the CLI app.
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
*
|
||||
*/
|
||||
extern void otAppCliInit(otInstance *aInstance);
|
||||
|
||||
// Variables
|
||||
static otInstance * instance;
|
||||
static otUdpSocket sMtdSocket;
|
||||
static otSockAddr sMulticastSockAddr;
|
||||
static const ButtonArray_t sButtonArray[BSP_BUTTON_COUNT] = BSP_BUTTON_INIT;
|
||||
static bool sButtonPressed = false;
|
||||
static bool sRxOnIdleButtonPressed = false;
|
||||
static bool sLedOn = false;
|
||||
static bool sAllowDeepSleep = false;
|
||||
static bool sTaskletsPendingSem = true;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
otLinkModeConfig config;
|
||||
|
||||
otSysInit(argc, argv);
|
||||
gpioInit(buttonCallback);
|
||||
|
||||
instance = otInstanceInitSingle();
|
||||
assert(instance);
|
||||
|
||||
otAppCliInit(instance);
|
||||
|
||||
otLinkSetPollPeriod(instance, SLEEPY_POLL_PERIOD_MS);
|
||||
setNetworkConfiguration(instance);
|
||||
otSetStateChangedCallback(instance, handleNetifStateChanged, instance);
|
||||
|
||||
config.mRxOnWhenIdle = true;
|
||||
config.mDeviceType = 0;
|
||||
config.mNetworkData = 0;
|
||||
otThreadSetLinkMode(instance, config);
|
||||
|
||||
initUdp();
|
||||
otIp6SetEnabled(instance, true);
|
||||
otThreadSetEnabled(instance, true);
|
||||
efr32SetSleepCallback(sleepCb);
|
||||
|
||||
while (!otSysPseudoResetWasRequested())
|
||||
{
|
||||
otTaskletsProcess(instance);
|
||||
otSysProcessDrivers(instance);
|
||||
|
||||
applicationTick();
|
||||
|
||||
// Put the EFR32 into deep sleep if callback sleepCb permits.
|
||||
efr32Sleep();
|
||||
}
|
||||
|
||||
otInstanceFinalize(instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback from efr32Sleep to indicate if it is ok to go into sleep mode.
|
||||
* This runs with interrupts disabled.
|
||||
*/
|
||||
bool sleepCb(void)
|
||||
{
|
||||
bool allow;
|
||||
allow = (sAllowDeepSleep && !sTaskletsPendingSem);
|
||||
sTaskletsPendingSem = false;
|
||||
return allow;
|
||||
}
|
||||
|
||||
void otTaskletsSignalPending(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
sTaskletsPendingSem = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Override default network settings, such as panid, so the devices can join a network
|
||||
*/
|
||||
void setNetworkConfiguration(otInstance *aInstance)
|
||||
{
|
||||
static char aNetworkName[] = "SleepyEFR32";
|
||||
otOperationalDataset aDataset;
|
||||
|
||||
memset(&aDataset, 0, sizeof(otOperationalDataset));
|
||||
|
||||
/*
|
||||
* Fields that can be configured in otOperationDataset to override defaults:
|
||||
* Network Name, Mesh Local Prefix, Extended PAN ID, PAN ID, Delay Timer,
|
||||
* Channel, Channel Mask Page 0, Network Master Key, PSKc, Security Policy
|
||||
*/
|
||||
aDataset.mActiveTimestamp = 1;
|
||||
aDataset.mComponents.mIsActiveTimestampPresent = true;
|
||||
|
||||
/* Set Channel to 15 */
|
||||
aDataset.mChannel = 15;
|
||||
aDataset.mComponents.mIsChannelPresent = true;
|
||||
|
||||
/* Set Pan ID to 2222 */
|
||||
aDataset.mPanId = (otPanId)0x2222;
|
||||
aDataset.mComponents.mIsPanIdPresent = true;
|
||||
|
||||
/* Set Extended Pan ID to C0DE1AB5C0DE1AB5 */
|
||||
uint8_t extPanId[OT_EXT_PAN_ID_SIZE] = {0xC0, 0xDE, 0x1A, 0xB5, 0xC0, 0xDE, 0x1A, 0xB5};
|
||||
memcpy(aDataset.mExtendedPanId.m8, extPanId, sizeof(aDataset.mExtendedPanId));
|
||||
aDataset.mComponents.mIsExtendedPanIdPresent = true;
|
||||
|
||||
/* Set master key to 1234C0DE1AB51234C0DE1AB51234C0DE */
|
||||
uint8_t key[OT_MASTER_KEY_SIZE] = {0x12, 0x34, 0xC0, 0xDE, 0x1A, 0xB5, 0x12, 0x34,
|
||||
0xC0, 0xDE, 0x1A, 0xB5, 0x12, 0x34, 0xC0, 0xDE};
|
||||
memcpy(aDataset.mMasterKey.m8, key, sizeof(aDataset.mMasterKey));
|
||||
aDataset.mComponents.mIsMasterKeyPresent = true;
|
||||
|
||||
/* Set Network Name to SleepyEFR32 */
|
||||
size_t length = strlen(aNetworkName);
|
||||
assert(length <= OT_NETWORK_NAME_MAX_SIZE);
|
||||
memcpy(aDataset.mNetworkName.m8, aNetworkName, length);
|
||||
aDataset.mComponents.mIsNetworkNamePresent = true;
|
||||
|
||||
otDatasetSetActive(aInstance, &aDataset);
|
||||
}
|
||||
|
||||
void handleNetifStateChanged(uint32_t aFlags, void *aContext)
|
||||
{
|
||||
otLinkModeConfig config;
|
||||
|
||||
if ((aFlags & OT_CHANGED_THREAD_ROLE) != 0)
|
||||
{
|
||||
otDeviceRole changedRole = otThreadGetDeviceRole(aContext);
|
||||
|
||||
switch (changedRole)
|
||||
{
|
||||
case OT_DEVICE_ROLE_LEADER:
|
||||
case OT_DEVICE_ROLE_ROUTER:
|
||||
break;
|
||||
|
||||
case OT_DEVICE_ROLE_CHILD:
|
||||
config.mRxOnWhenIdle = 0;
|
||||
config.mDeviceType = 0;
|
||||
config.mNetworkData = 0;
|
||||
otThreadSetLinkMode(instance, config);
|
||||
sAllowDeepSleep = false;
|
||||
break;
|
||||
|
||||
case OT_DEVICE_ROLE_DETACHED:
|
||||
case OT_DEVICE_ROLE_DISABLED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Provide, if required an "otPlatLog()" function
|
||||
*/
|
||||
#if OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_APP
|
||||
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, aFormat);
|
||||
otCliPlatLogv(aLogLevel, aLogRegion, aFormat, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
void gpioInit(void (*callback)(uint8_t pin))
|
||||
{
|
||||
// set up button GPIOs to input with pullups
|
||||
for (int i = 0; i < BSP_BUTTON_COUNT; i++)
|
||||
{
|
||||
GPIO_PinModeSet(sButtonArray[i].port, sButtonArray[i].pin, gpioModeInputPull, 1);
|
||||
}
|
||||
// set up interrupt based callback function on falling edge
|
||||
GPIOINT_Init();
|
||||
GPIOINT_CallbackRegister(sButtonArray[0].pin, callback);
|
||||
GPIOINT_CallbackRegister(sButtonArray[1].pin, callback);
|
||||
GPIO_IntConfig(sButtonArray[0].port, sButtonArray[0].pin, false, true, true);
|
||||
GPIO_IntConfig(sButtonArray[1].port, sButtonArray[1].pin, false, true, true);
|
||||
|
||||
BSP_LedsInit();
|
||||
BSP_LedClear(0);
|
||||
BSP_LedClear(1);
|
||||
}
|
||||
|
||||
void initUdp(void)
|
||||
{
|
||||
otError error;
|
||||
otSockAddr sockaddr;
|
||||
|
||||
memset(&sMulticastSockAddr, 0, sizeof sMulticastSockAddr);
|
||||
otIp6AddressFromString(MULTICAST_ADDR, &sMulticastSockAddr.mAddress);
|
||||
sMulticastSockAddr.mPort = MULTICAST_PORT;
|
||||
|
||||
memset(&sockaddr, 0, sizeof(sockaddr));
|
||||
sockaddr.mPort = RECV_PORT;
|
||||
|
||||
error = otUdpOpen(instance, &sMtdSocket, mtdReceiveCallback, NULL);
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
error = otUdpBind(instance, &sMtdSocket, &sockaddr);
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otUdpClose(instance, &sMtdSocket);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void buttonCallback(uint8_t pin)
|
||||
{
|
||||
if ((pin & 0x01) == 0x01)
|
||||
{
|
||||
sButtonPressed = true;
|
||||
}
|
||||
else if ((pin & 0x01) == 0x00)
|
||||
{
|
||||
sRxOnIdleButtonPressed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void applicationTick(void)
|
||||
{
|
||||
otError error = 0;
|
||||
otMessageInfo messageInfo;
|
||||
otMessage * message = NULL;
|
||||
char * payload = MTD_MESSAGE;
|
||||
otLinkModeConfig config;
|
||||
|
||||
if (sRxOnIdleButtonPressed == true)
|
||||
{
|
||||
sRxOnIdleButtonPressed = false;
|
||||
sAllowDeepSleep = !sAllowDeepSleep;
|
||||
config.mRxOnWhenIdle = !sAllowDeepSleep;
|
||||
config.mDeviceType = 0;
|
||||
config.mNetworkData = 0;
|
||||
otThreadSetLinkMode(instance, config);
|
||||
}
|
||||
|
||||
if (sButtonPressed == true)
|
||||
{
|
||||
sButtonPressed = false;
|
||||
|
||||
memset(&messageInfo, 0, sizeof(messageInfo));
|
||||
memcpy(&messageInfo.mPeerAddr, &sMulticastSockAddr.mAddress, sizeof messageInfo.mPeerAddr);
|
||||
messageInfo.mPeerPort = sMulticastSockAddr.mPort;
|
||||
|
||||
message = otUdpNewMessage(instance, NULL);
|
||||
|
||||
if (message != NULL)
|
||||
{
|
||||
error = otMessageAppend(message, payload, (uint16_t)strlen(payload));
|
||||
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
error = otUdpSend(instance, &sMtdSocket, message, &messageInfo);
|
||||
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (message != NULL)
|
||||
{
|
||||
otMessageFree(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mtdReceiveCallback(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aContext);
|
||||
OT_UNUSED_VARIABLE(aMessage);
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
uint8_t buf[1500];
|
||||
int length;
|
||||
|
||||
length = otMessageRead(aMessage, otMessageGetOffset(aMessage), buf, sizeof(buf) - 1);
|
||||
buf[length] = '\0';
|
||||
|
||||
if (strcmp((char *)buf, FTD_MESSAGE) == 0)
|
||||
{
|
||||
sLedOn = !sLedOn;
|
||||
|
||||
if (sLedOn)
|
||||
{
|
||||
BSP_LedSet(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
BSP_LedClear(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for the alarm.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "openthread-system.h"
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/platform/alarm-micro.h>
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/diag.h>
|
||||
#include "common/logging.hpp"
|
||||
|
||||
#include "platform-efr32.h"
|
||||
#include "utils/code_utils.h"
|
||||
|
||||
#include "em_core.h"
|
||||
#include "rail.h"
|
||||
#include "sl_sleeptimer.h"
|
||||
|
||||
#define XTAL_ACCURACY 200
|
||||
|
||||
static sl_sleeptimer_timer_handle_t sl_handle;
|
||||
static uint32_t sAlarm = 0;
|
||||
static bool sIsRunning = false;
|
||||
|
||||
static void AlarmCallback(sl_sleeptimer_timer_handle_t *aHandle, void *aData)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aHandle);
|
||||
OT_UNUSED_VARIABLE(aData);
|
||||
otSysEventSignalPending();
|
||||
}
|
||||
|
||||
void efr32AlarmInit(void)
|
||||
{
|
||||
memset(&sl_handle, 0, sizeof sl_handle);
|
||||
}
|
||||
|
||||
uint32_t otPlatAlarmMilliGetNow(void)
|
||||
{
|
||||
uint64_t ticks;
|
||||
uint64_t now;
|
||||
sl_status_t status;
|
||||
|
||||
ticks = sl_sleeptimer_get_tick_count64();
|
||||
status = sl_sleeptimer_tick64_to_ms(ticks, &now);
|
||||
assert(status == SL_STATUS_OK);
|
||||
return (uint32_t)now;
|
||||
}
|
||||
|
||||
uint32_t otPlatTimeGetXtalAccuracy(void)
|
||||
{
|
||||
return XTAL_ACCURACY;
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sl_status_t status;
|
||||
int32_t remaining;
|
||||
uint32_t ticks;
|
||||
|
||||
sl_sleeptimer_stop_timer(&sl_handle);
|
||||
|
||||
sAlarm = aT0 + aDt;
|
||||
remaining = (int32_t)(sAlarm - otPlatAlarmMilliGetNow());
|
||||
sIsRunning = true;
|
||||
|
||||
if (remaining <= 0)
|
||||
{
|
||||
otSysEventSignalPending();
|
||||
}
|
||||
else
|
||||
{
|
||||
status = sl_sleeptimer_ms32_to_tick(remaining, &ticks);
|
||||
assert(status == SL_STATUS_OK);
|
||||
|
||||
status = sl_sleeptimer_start_timer(&sl_handle, ticks, AlarmCallback, NULL, 0,
|
||||
SL_SLEEPTIMER_NO_HIGH_PRECISION_HF_CLOCKS_REQUIRED_FLAG);
|
||||
assert(status == SL_STATUS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sl_sleeptimer_stop_timer(&sl_handle);
|
||||
sIsRunning = false;
|
||||
}
|
||||
|
||||
void efr32AlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
int32_t remaining;
|
||||
|
||||
if (sIsRunning)
|
||||
{
|
||||
remaining = (int32_t)(sAlarm - otPlatAlarmMilliGetNow());
|
||||
|
||||
if (remaining <= 0)
|
||||
{
|
||||
sIsRunning = false;
|
||||
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagAlarmFired(aInstance);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatAlarmMilliFired(aInstance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t otPlatAlarmMicroGetNow(void)
|
||||
{
|
||||
// TODO microsecond support
|
||||
return otPlatAlarmMilliGetNow();
|
||||
}
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
// TODO microsecond support
|
||||
otPlatAlarmMilliStartAt(aInstance, aT0, aDt);
|
||||
}
|
||||
|
||||
void otPlatAlarmMicroStop(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sl_sleeptimer_stop_timer(&sl_handle);
|
||||
sIsRunning = false;
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for the diagnostics.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#include "platform-efr32.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
*
|
||||
*/
|
||||
static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
{
|
||||
sDiagMode = aMode;
|
||||
}
|
||||
|
||||
bool otPlatDiagModeGet()
|
||||
{
|
||||
return sDiagMode;
|
||||
}
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // #if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for random number generator.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openthread/platform/entropy.h>
|
||||
#include "mbedtls/entropy_poll.h"
|
||||
#include "utils/code_utils.h"
|
||||
|
||||
otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
size_t outputLen = 0;
|
||||
|
||||
otEXPECT_ACTION(aOutput, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
for (size_t partialLen = 0; outputLen < aOutputLength; outputLen += partialLen)
|
||||
{
|
||||
const uint16_t remaining = aOutputLength - outputLen;
|
||||
partialLen = 0;
|
||||
|
||||
// Non-zero return values for mbedtls_hardware_poll() signify an error has occurred
|
||||
otEXPECT_ACTION(0 == mbedtls_hardware_poll(NULL, &aOutput[outputLen], remaining, &partialLen),
|
||||
error = OT_ERROR_FAILED);
|
||||
}
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hal-config.h"
|
||||
|
||||
#if (HAL_FEM_ENABLE)
|
||||
#include "util/plugin/plugin-common/fem-control/fem-control.c"
|
||||
#endif
|
||||
@@ -1,364 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for the non-volatile storage.
|
||||
*/
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/config.h>
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE // Use OT NV system
|
||||
|
||||
#include "em_msc.h"
|
||||
#include <string.h>
|
||||
#include <openthread/instance.h>
|
||||
|
||||
#define FLASH_PAGE_NUM 2
|
||||
#define FLASH_DATA_END_ADDR (FLASH_BASE + FLASH_SIZE)
|
||||
#define FLASH_DATA_START_ADDR (FLASH_DATA_END_ADDR - (FLASH_PAGE_SIZE * FLASH_PAGE_NUM))
|
||||
#define FLASH_SWAP_PAGE_NUM (FLASH_PAGE_NUM / 2)
|
||||
#define FLASH_SWAP_SIZE (FLASH_PAGE_SIZE * FLASH_SWAP_PAGE_NUM)
|
||||
|
||||
static inline uint32_t mapAddress(uint8_t aSwapIndex, uint32_t aOffset)
|
||||
{
|
||||
uint32_t address;
|
||||
|
||||
address = FLASH_DATA_START_ADDR + aOffset;
|
||||
|
||||
if (aSwapIndex)
|
||||
{
|
||||
address += FLASH_SWAP_SIZE;
|
||||
}
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
void otPlatFlashInit(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
uint32_t otPlatFlashGetSwapSize(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return FLASH_SWAP_SIZE;
|
||||
}
|
||||
|
||||
void otPlatFlashErase(otInstance *aInstance, uint8_t aSwapIndex)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint32_t address = mapAddress(aSwapIndex, 0);
|
||||
|
||||
for (uint32_t n = 0; n < FLASH_SWAP_PAGE_NUM; n++, address += FLASH_PAGE_SIZE)
|
||||
{
|
||||
MSC_ErasePage((uint32_t *)address);
|
||||
}
|
||||
}
|
||||
|
||||
void otPlatFlashWrite(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, const void *aData, uint32_t aSize)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
MSC_WriteWord((uint32_t *)mapAddress(aSwapIndex, aOffset), aData, aSize);
|
||||
}
|
||||
|
||||
void otPlatFlashRead(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, void *aData, uint32_t aSize)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
memcpy(aData, (const uint8_t *)mapAddress(aSwapIndex, aOffset), aSize);
|
||||
}
|
||||
|
||||
#else // Defaults to Silabs nvm3 system
|
||||
|
||||
#include "nvm3.h"
|
||||
#include "nvm3_default.h"
|
||||
#include <string.h>
|
||||
#include <openthread/platform/settings.h>
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/logging.hpp"
|
||||
|
||||
#define NVM3KEY_DOMAIN_OPENTHREAD 0x20000U
|
||||
#define NUM_INDEXED_SETTINGS \
|
||||
OPENTHREAD_CONFIG_MLE_MAX_CHILDREN // Indexed key types are only supported for kKeyChildInfo (=='child table').
|
||||
#define ENUM_NVM3_KEY_LIST_SIZE 4 // List size used when enumerating nvm3 keys.
|
||||
|
||||
static otError addSetting(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
|
||||
static nvm3_ObjectKey_t makeNvm3ObjKey(uint16_t otSettingsKey, int index);
|
||||
static otError mapNvm3Error(Ecode_t nvm3Res);
|
||||
|
||||
void otPlatSettingsInit(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (mapNvm3Error(nvm3_open(nvm3_defaultHandle, nvm3_defaultInit)) != OT_ERROR_NONE)
|
||||
{
|
||||
otLogDebgPlat("Error initializing nvm3 instance");
|
||||
}
|
||||
}
|
||||
|
||||
void otPlatSettingsDeinit(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
nvm3_close(nvm3_defaultHandle);
|
||||
}
|
||||
|
||||
otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
|
||||
{
|
||||
// Searches through all matching nvm3 keys to find the one with the required
|
||||
// 'index', then reads the nvm3 data into the destination buffer.
|
||||
// (Repeatedly enumerates a list of matching keys from the nvm3 until the
|
||||
// required index is found).
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError err;
|
||||
uint16_t valueLength = 0;
|
||||
|
||||
nvm3_ObjectKey_t nvm3Key = makeNvm3ObjKey(aKey, 0); // The base nvm3 key value.
|
||||
bool idxFound = false;
|
||||
int idx = 0;
|
||||
err = OT_ERROR_NOT_FOUND;
|
||||
while ((idx <= NUM_INDEXED_SETTINGS) && (!idxFound))
|
||||
{
|
||||
// Get the next nvm3 key list.
|
||||
nvm3_ObjectKey_t keys[ENUM_NVM3_KEY_LIST_SIZE]; // List holds the next set of nvm3 keys.
|
||||
size_t objCnt = nvm3_enumObjects(nvm3_defaultHandle, keys, ENUM_NVM3_KEY_LIST_SIZE, nvm3Key,
|
||||
makeNvm3ObjKey(aKey, NUM_INDEXED_SETTINGS));
|
||||
for (size_t i = 0; i < objCnt; ++i)
|
||||
{
|
||||
nvm3Key = keys[i];
|
||||
if (idx == aIndex)
|
||||
{
|
||||
uint32_t objType;
|
||||
size_t objLen;
|
||||
err = mapNvm3Error(nvm3_getObjectInfo(nvm3_defaultHandle, nvm3Key, &objType, &objLen));
|
||||
if (err == OT_ERROR_NONE)
|
||||
{
|
||||
valueLength = objLen;
|
||||
|
||||
// Only perform read if an input buffer was passed in.
|
||||
if ((aValue != NULL) && (aValueLength != NULL))
|
||||
{
|
||||
// Read all nvm3 obj bytes into a tmp buffer, then copy the required
|
||||
// number of bytes to the read destination buffer.
|
||||
uint8_t *buf = malloc(valueLength);
|
||||
err = mapNvm3Error(nvm3_readData(nvm3_defaultHandle, nvm3Key, buf, valueLength));
|
||||
if (err == OT_ERROR_NONE)
|
||||
{
|
||||
memcpy(aValue, buf, (valueLength < *aValueLength) ? valueLength : *aValueLength);
|
||||
}
|
||||
free(buf);
|
||||
SuccessOrExit(err);
|
||||
}
|
||||
}
|
||||
idxFound = true;
|
||||
break;
|
||||
}
|
||||
++idx;
|
||||
}
|
||||
if (objCnt < ENUM_NVM3_KEY_LIST_SIZE)
|
||||
{
|
||||
// Stop searching (there are no more matching nvm3 objects).
|
||||
break;
|
||||
}
|
||||
++nvm3Key; // Inc starting value for next nvm3 key list enumeration.
|
||||
}
|
||||
|
||||
exit:
|
||||
if (aValueLength != NULL)
|
||||
{
|
||||
*aValueLength = valueLength; // always return actual nvm3 object length.
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError err;
|
||||
|
||||
// Delete all nvm3 objects matching the input key (i.e. the 'setting indexes' of the key).
|
||||
err = otPlatSettingsDelete(aInstance, aKey, -1);
|
||||
if ((err == OT_ERROR_NONE) || (err == OT_ERROR_NOT_FOUND))
|
||||
{
|
||||
// Add new setting object (i.e. 'index0' of the key).
|
||||
err = addSetting(aKey, aValue, aValueLength);
|
||||
SuccessOrExit(err);
|
||||
}
|
||||
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return addSetting(aKey, aValue, aValueLength);
|
||||
}
|
||||
|
||||
otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
|
||||
{
|
||||
// Searches through all matching nvm3 keys to find the one with the required
|
||||
// 'index' (or index = -1 to delete all), then deletes the nvm3 object.
|
||||
// (Repeatedly enumerates a list of matching keys from the nvm3 until the
|
||||
// required index is found).
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError err;
|
||||
nvm3_ObjectKey_t nvm3Key = makeNvm3ObjKey(aKey, 0); // The base nvm3 key value.
|
||||
bool idxFound = false;
|
||||
int idx = 0;
|
||||
err = OT_ERROR_NOT_FOUND;
|
||||
while ((idx <= NUM_INDEXED_SETTINGS) && (!idxFound))
|
||||
{
|
||||
// Get the next nvm3 key list.
|
||||
nvm3_ObjectKey_t keys[ENUM_NVM3_KEY_LIST_SIZE]; // List holds the next set of nvm3 keys.
|
||||
size_t objCnt = nvm3_enumObjects(nvm3_defaultHandle, keys, ENUM_NVM3_KEY_LIST_SIZE, nvm3Key,
|
||||
makeNvm3ObjKey(aKey, NUM_INDEXED_SETTINGS));
|
||||
for (size_t i = 0; i < objCnt; ++i)
|
||||
{
|
||||
nvm3Key = keys[i];
|
||||
if ((idx == aIndex) || (aIndex == -1))
|
||||
{
|
||||
uint32_t objType;
|
||||
size_t objLen;
|
||||
err = mapNvm3Error(nvm3_getObjectInfo(nvm3_defaultHandle, nvm3Key, &objType, &objLen));
|
||||
if (err == OT_ERROR_NONE)
|
||||
{
|
||||
// Delete the nvm3 object.
|
||||
err = mapNvm3Error(nvm3_deleteObject(nvm3_defaultHandle, nvm3Key));
|
||||
SuccessOrExit(err);
|
||||
}
|
||||
if (aIndex != -1)
|
||||
{
|
||||
idxFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
++idx;
|
||||
}
|
||||
if (objCnt < ENUM_NVM3_KEY_LIST_SIZE)
|
||||
{
|
||||
// Stop searching (there are no more matching nvm3 objects).
|
||||
break;
|
||||
}
|
||||
++nvm3Key; // Inc starting value for next nvm3 key list enumeration.
|
||||
}
|
||||
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
void otPlatSettingsWipe(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// Delete nvm3 objects for all OT Settings keys (and any of their associated 'indexes').
|
||||
// Note- any OT User nvm3 objects in the OT nvm3 area are NOT be erased.
|
||||
for (uint16_t aKey = 0; aKey < 8; ++aKey)
|
||||
{
|
||||
otPlatSettingsDelete(NULL, aKey, -1);
|
||||
}
|
||||
}
|
||||
|
||||
// Local functions..
|
||||
|
||||
static otError addSetting(uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
{
|
||||
// Helper function- writes input buffer data to a NEW nvm3 object.
|
||||
// nvm3 object is created at the first available Key + index.
|
||||
|
||||
otError err;
|
||||
|
||||
if ((aValueLength == 0) || (aValue == NULL))
|
||||
{
|
||||
err = OT_ERROR_INVALID_ARGS;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int idx = 0; idx <= NUM_INDEXED_SETTINGS; ++idx)
|
||||
{
|
||||
nvm3_ObjectKey_t nvm3Key;
|
||||
nvm3Key = makeNvm3ObjKey(aKey, idx);
|
||||
|
||||
uint32_t objType;
|
||||
size_t objLen;
|
||||
err = mapNvm3Error(nvm3_getObjectInfo(nvm3_defaultHandle, nvm3Key, &objType, &objLen));
|
||||
if (err == OT_ERROR_NOT_FOUND)
|
||||
{
|
||||
// Use this index for the new nvm3 object.
|
||||
// Write the binary data to nvm3 (Creates nvm3 object if required).
|
||||
err = mapNvm3Error(nvm3_writeData(nvm3_defaultHandle, nvm3Key, aValue, aValueLength));
|
||||
break;
|
||||
}
|
||||
else if (err != OT_ERROR_NONE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static nvm3_ObjectKey_t makeNvm3ObjKey(uint16_t otSettingsKey, int index)
|
||||
{
|
||||
return (NVM3KEY_DOMAIN_OPENTHREAD | (otSettingsKey << 8) | (index & 0xFF));
|
||||
}
|
||||
|
||||
static otError mapNvm3Error(Ecode_t nvm3Res)
|
||||
{
|
||||
otError err;
|
||||
|
||||
switch (nvm3Res)
|
||||
{
|
||||
case ECODE_NVM3_OK:
|
||||
err = OT_ERROR_NONE;
|
||||
break;
|
||||
|
||||
case ECODE_NVM3_ERR_KEY_NOT_FOUND:
|
||||
err = OT_ERROR_NOT_FOUND;
|
||||
break;
|
||||
|
||||
default:
|
||||
err = OT_ERROR_FAILED;
|
||||
break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||
@@ -1,194 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file holds required 802.15.4 definitions
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __IEEE802154IEEE802154_H__
|
||||
#define __IEEE802154IEEE802154_H__
|
||||
|
||||
#define IEEE802154_MIN_LENGTH \
|
||||
4 // Technically, a version 2 packet / ACK
|
||||
// can be 4 bytes with seq# suppression
|
||||
#define IEEE802154_MAX_LENGTH 127
|
||||
#define IEEE802154_ACK_LENGTH 5
|
||||
|
||||
// FCF + DSN + dest PANID + dest addr + src PANID + src addr (without security header)
|
||||
#define IEEE802154_MAX_MHR_LENGTH (2 + 1 + 2 + 8 + 2 + 8)
|
||||
|
||||
#define IEEE802154_DSN_OFFSET 2
|
||||
#define IEEE802154_FCF_OFFSET 0
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// 802.15.4 Frame Control Field definitions for Beacon, Ack, Data, Command
|
||||
|
||||
#define IEEE802154_FRAME_TYPE_MASK ((uint16_t)0x0007U) // Bits 0..2
|
||||
#define IEEE802154_FRAME_TYPE_BEACON ((uint16_t)0x0000U) // Beacon
|
||||
#define IEEE802154_FRAME_TYPE_DATA ((uint16_t)0x0001U) // Data
|
||||
#define IEEE802154_FRAME_TYPE_ACK ((uint16_t)0x0002U) // ACK
|
||||
#define IEEE802154_FRAME_TYPE_COMMAND ((uint16_t)0x0003U) // Command
|
||||
#define IEEE802154_FRAME_TYPE_CONTROL IEEE802154_FRAME_TYPE_COMMAND // (synonym)
|
||||
#define IEEE802154_FRAME_TYPE_RESERVED_MASK ((uint16_t)0x0004U) // Versions 0/1
|
||||
// 802.15.4E-2012 introduced MultiPurpose with different Frame Control Field
|
||||
// layout described in the MultiPurpose section below.
|
||||
#define IEEE802154_FRAME_TYPE_MULTIPURPOSE ((uint16_t)0x0005U) // MultiPurpose
|
||||
|
||||
#define IEEE802154_FRAME_FLAG_SECURITY_ENABLED ((uint16_t)0x0008U) // Bit 3
|
||||
#define IEEE802154_FRAME_FLAG_FRAME_PENDING ((uint16_t)0x0010U) // Bit 4
|
||||
#define IEEE802154_FRAME_FLAG_ACK_REQUIRED ((uint16_t)0x0020U) // Bit 5
|
||||
#define IEEE802154_FRAME_FLAG_INTRA_PAN ((uint16_t)0x0040U) // Bit 6
|
||||
// 802.15.4-2006 renamed the Intra-Pan flag PanId-Compression
|
||||
#define IEEE802154_FRAME_FLAG_PANID_COMPRESSION IEEE802154_FRAME_FLAG_INTRA_PAN
|
||||
#define IEEE802154_FRAME_FLAG_RESERVED ((uint16_t)0x0080U) // Bit 7 reserved
|
||||
// Use the reserved flag internally to check whether frame pending bit was set in outgoing ACK
|
||||
#define IEEE802154_FRAME_PENDING_SET_IN_OUTGOING_ACK IEEE802154_FRAME_FLAG_RESERVED
|
||||
// 802.15.4E-2012 introduced these flags for Frame Version 2 frames
|
||||
// which are reserved bit positions in earlier Frame Version frames:
|
||||
#define IEEE802154_FRAME_FLAG_SEQ_SUPPRESSION ((uint16_t)0x0100U) // Bit 8
|
||||
#define IEEE802154_FRAME_FLAG_IE_LIST_PRESENT ((uint16_t)0x0200U) // Bit 9
|
||||
|
||||
#define IEEE802154_FRAME_DESTINATION_MODE_MASK ((uint16_t)0x0C00U) // Bits 10..11
|
||||
#define IEEE802154_FRAME_DESTINATION_MODE_NONE ((uint16_t)0x0000U) // Mode 0
|
||||
#define IEEE802154_FRAME_DESTINATION_MODE_RESERVED ((uint16_t)0x0400U) // Mode 1
|
||||
#define IEEE802154_FRAME_DESTINATION_MODE_SHORT ((uint16_t)0x0800U) // Mode 2
|
||||
#define IEEE802154_FRAME_DESTINATION_MODE_LONG ((uint16_t)0x0C00U) // Mode 3
|
||||
// 802.15.4e-2012 only (not adopted into 802.15.4-2015)
|
||||
#define IEEE802154_FRAME_DESTINATION_MODE_BYTE IEEE802154_FRAME_DESTINATION_MODE_RESERVED
|
||||
|
||||
#define IEEE802154_FRAME_VERSION_MASK ((uint16_t)0x3000U) // Bits 12..13
|
||||
#define IEEE802154_FRAME_VERSION_2003 ((uint16_t)0x0000U) // Version 0
|
||||
#define IEEE802154_FRAME_VERSION_2006 ((uint16_t)0x1000U) // Version 1
|
||||
// In 802.15.4-2015, Version 2 is just called "IEEE STD 802.15.4"
|
||||
// which can be rather confusing. It was introduced in 802.15.4E-2012.
|
||||
#define IEEE802154_FRAME_VERSION_2012 ((uint16_t)0x2000U) // Version 2
|
||||
#define IEEE802154_FRAME_VERSION_2015 ((uint16_t)0x2000U) // Version 2
|
||||
#define IEEE802154_FRAME_VERSION_RESERVED ((uint16_t)0x3000U) // Version 3
|
||||
|
||||
#define IEEE802154_FRAME_SOURCE_MODE_MASK ((uint16_t)0xC000U) // Bits 14..15
|
||||
#define IEEE802154_FRAME_SOURCE_MODE_NONE ((uint16_t)0x0000U) // Mode 0
|
||||
#define IEEE802154_FRAME_SOURCE_MODE_RESERVED ((uint16_t)0x4000U) // Mode 1
|
||||
#define IEEE802154_FRAME_SOURCE_MODE_SHORT ((uint16_t)0x8000U) // Mode 2
|
||||
#define IEEE802154_FRAME_SOURCE_MODE_LONG ((uint16_t)0xC000U) // Mode 3
|
||||
// 802.15.4e-2012 only (not adopted into 802.15.4-2015)
|
||||
#define IEEE802154_FRAME_SOURCE_MODE_BYTE IEEE802154_FRAME_SOURCE_MODE_RESERVED
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// 802.15.4E-2012 Frame Control Field definitions for MultiPurpose
|
||||
|
||||
#define IEEE802154_MP_FRAME_TYPE_MASK IEEE802154_FRAME_TYPE_MASK // Bits 0..2
|
||||
#define IEEE802154_MP_FRAME_TYPE_MULTIPURPOSE IEEE802154_FRAME_TYPE_MULTIPURPOSE
|
||||
|
||||
#define IEEE802154_MP_FRAME_FLAG_LONG_FCF ((uint16_t)0x0008U) // Bit 3
|
||||
|
||||
#define IEEE802154_MP_FRAME_DESTINATION_MODE_MASK ((uint16_t)0x0030U) // Bits 4..5
|
||||
#define IEEE802154_MP_FRAME_DESTINATION_MODE_NONE ((uint16_t)0x0000U) // Mode 0
|
||||
#define IEEE802154_MP_FRAME_DESTINATION_MODE_RESERVED ((uint16_t)0x0010U) // Mode 1
|
||||
#define IEEE802154_MP_FRAME_DESTINATION_MODE_SHORT ((uint16_t)0x0020U) // Mode 2
|
||||
#define IEEE802154_MP_FRAME_DESTINATION_MODE_LONG ((uint16_t)0x0030U) // Mode 3
|
||||
// 802.15.4e-2012 only (not adopted into 802.15.4-2015)
|
||||
#define IEEE802154_MP_FRAME_DESTINATION_MODE_BYTE IEEE802154_MP_FRAME_DESTINATION_MODE_RESERVED
|
||||
|
||||
#define IEEE802154_MP_FRAME_SOURCE_MODE_MASK ((uint16_t)0x00C0U) // Bits 6..7
|
||||
#define IEEE802154_MP_FRAME_SOURCE_MODE_NONE ((uint16_t)0x0000U) // Mode 0
|
||||
#define IEEE802154_MP_FRAME_SOURCE_MODE_RESERVED ((uint16_t)0x0040U) // Mode 1
|
||||
#define IEEE802154_MP_FRAME_SOURCE_MODE_SHORT ((uint16_t)0x0080U) // Mode 2
|
||||
#define IEEE802154_MP_FRAME_SOURCE_MODE_LONG ((uint16_t)0x00C0U) // Mode 3
|
||||
// 802.15.4e-2012 only (not adopted into 802.15.4-2015)
|
||||
#define IEEE802154_MP_FRAME_SOURCE_MODE_BYTE IEEE802154_MP_FRAME_SOURCE_MODE_RESERVED
|
||||
|
||||
#define IEEE802154_MP_FRAME_FLAG_PANID_PRESENT ((uint16_t)0x0100U) // Bit 8
|
||||
#define IEEE802154_MP_FRAME_FLAG_SECURITY_ENABLED ((uint16_t)0x0200U) // Bit 9
|
||||
#define IEEE802154_MP_FRAME_FLAG_SEQ_SUPPRESSION ((uint16_t)0x0400U) // Bit 10
|
||||
#define IEEE802154_MP_FRAME_FLAG_FRAME_PENDING ((uint16_t)0x0800U) // Bit 11
|
||||
|
||||
#define IEEE802154_MP_FRAME_VERSION_MASK IEEE802154_FRAME_VERSION_MASK // Bits 12..13
|
||||
#define IEEE802154_MP_FRAME_VERSION_2012 ((uint16_t)0x0000U) // Zeroed out
|
||||
#define IEEE802154_MP_FRAME_VERSION_2015 ((uint16_t)0x0000U) // Zeroed out
|
||||
// All other MultiPurpose Frame Versions are reserved
|
||||
|
||||
#define IEEE802154_MP_FRAME_FLAG_ACK_REQUIRED ((uint16_t)0x4000U) // Bit 14
|
||||
#define IEEE802154_MP_FRAME_FLAG_IE_LIST_PRESENT ((uint16_t)0x8000U) // Bit 15
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Information Elements fields
|
||||
|
||||
#define IEEE802154_KEYID_MODE_0 ((uint8_t)0x0000U)
|
||||
#define IEEE802154_KEYID_MODE_0_SIZE 0
|
||||
|
||||
#define IEEE802154_KEYID_MODE_1 ((uint8_t)0x0008U)
|
||||
#define IEEE802154_KEYID_MODE_1_SIZE 0
|
||||
|
||||
#define IEEE802154_KEYID_MODE_2 ((uint8_t)0x0010U)
|
||||
#define IEEE802154_KEYID_MODE_2_SIZE 4
|
||||
|
||||
#define IEEE802154_KEYID_MODE_3 ((uint8_t)0x0018U)
|
||||
#define IEEE802154_KEYID_MODE_3_SIZE 8
|
||||
|
||||
#define IEEE802154_KEYID_MODE_MASK ((uint8_t)0x0018U)
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Information Elements fields
|
||||
|
||||
// There are Header IEs and Payload IEs. Header IEs are authenticated
|
||||
// if MAC Security is enabled. Payload IEs are both authenticated and
|
||||
// encrypted if MAC security is enabled.
|
||||
|
||||
// Header and Payload IEs have slightly different formats and different
|
||||
// contents based on the 802.15.4 spec.
|
||||
|
||||
// Both are actually a list of IEs that continues until a termination
|
||||
// IE is seen.
|
||||
|
||||
#define IEEE802154_FRAME_HEADER_INFO_ELEMENT_LENGTH_MASK 0x007F // bits 0-6
|
||||
#define IEEE802154_FRAME_HEADER_INFO_ELEMENT_ID_MASK 0x7F80 // bits 7-14
|
||||
#define IEEE802154_FRAME_HEADER_INFO_ELEMENT_TYPE_MASK 0x8000 // bit 15
|
||||
|
||||
#define IEEE802154_FRAME_HEADER_INFO_ELEMENT_ID_SHIFT 7
|
||||
|
||||
#define IEEE802154_FRAME_PAYLOAD_INFO_ELEMENT_LENGTH_MASK 0x07FF // bits 0 -10
|
||||
#define IEEE802154_FRAME_PAYLOAD_INFO_ELEMENT_GROUP_ID_MASK 0x7800 // bits 11-14
|
||||
#define IEEE802154_FRAME_PAYLOAD_INFO_ELEMENT_TYPE_MASK 0x8000 // bit 15
|
||||
|
||||
#define IEEE802154_FRAME_PAYLOAD_INFO_ELEMENT_ID_SHIFT 11
|
||||
|
||||
// This "type" field indicates header vs. payload IE. However there is
|
||||
// also a Header IE List terminator which would imply the IE list
|
||||
// that follows is only payload IEs.
|
||||
#define IEEE802154_FRAME_INFO_ELEMENT_TYPE_MASK 0x8000
|
||||
|
||||
// Header Termination ID 1 is used when there are Payload IEs that follow.
|
||||
// Header Termination ID 2 is used when there are no Payload IEs and the
|
||||
// next field is the MAC payload.
|
||||
#define IEEE802154_FRAME_HEADER_TERMINATION_ID_1 0x7E
|
||||
#define IEEE802154_FRAME_HEADER_TERMINATION_ID_2 0x7F
|
||||
#define IEEE802154_FRAME_PAYLOAD_TERMINATION_ID 0x0F
|
||||
|
||||
#endif //__IEEE802154IEEE802154_H__
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file logging.c
|
||||
* Platform abstraction for the logging
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
|
||||
#include <utils/logging_rtt.h>
|
||||
|
||||
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED)
|
||||
void efr32LogInit(void)
|
||||
{
|
||||
utilsLogRttInit();
|
||||
}
|
||||
|
||||
void efr32LogDeinit(void)
|
||||
{
|
||||
utilsLogRttDeinit();
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, aFormat);
|
||||
|
||||
utilsLogRttOutput(aLogLevel, aLogRegion, aFormat, ap);
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
@@ -1,91 +0,0 @@
|
||||
#ifndef MBEDTLS_CONFIG_H
|
||||
#define MBEDTLS_CONFIG_H
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
// <h> TLS/DTLS configuration
|
||||
|
||||
// <o MBEDTLS_SSL_CIPHERSUITES> Complete list of ciphersuites to use, in order of preference.
|
||||
// <i> Default: MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
|
||||
// <i> Complete list of ciphersuites to use, in order of preference.
|
||||
// <i> The value of this configuration should be updated for the application needs.
|
||||
#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
|
||||
|
||||
// <o MBEDTLS_SSL_MAX_CONTENT_LEN> Maximum TLS/DTLS fragment length in bytes.
|
||||
// <i> Default: 768
|
||||
// <i> The size configured here determines the size of each of the two
|
||||
// <i> internal I/O buffers used in mbedTLS when sending and receiving data.
|
||||
#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE
|
||||
#define MBEDTLS_SSL_MAX_CONTENT_LEN 900 /**< Maximum fragment length in bytes */
|
||||
#else
|
||||
#define MBEDTLS_SSL_MAX_CONTENT_LEN 768 /**< Maximum fragment length in bytes */
|
||||
#endif
|
||||
|
||||
// <q SL_MBEDTLS_SSL_MAX_FRAGMENT_LENGTH> Enable support for RFC 6066 max_fragment_length extension in SSL.
|
||||
// <i> Default: 1
|
||||
// <i> Enable support for RFC 6066 max_fragment_length extension in SSL.
|
||||
#define SL_MBEDTLS_SSL_MAX_FRAGMENT_LENGTH 1
|
||||
|
||||
// <q SL_MBEDTLS_SSL_EXPORT_KEYS> Enable support for exporting key block and master secret.
|
||||
// <i> Default: 1
|
||||
// <i> Enable support for exporting key block and master secret.
|
||||
// <i> This is required for certain users of TLS, e.g. EAP-TLS.
|
||||
#define SL_MBEDTLS_SSL_EXPORT_KEYS 1
|
||||
|
||||
// <q SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED> Enable the PSK based ciphersuite modes in SSL / TLS.
|
||||
// <i> Default: 0
|
||||
// <i> Enable the PSK based ciphersuite modes in SSL / TLS.
|
||||
#define SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED 1
|
||||
|
||||
// <q SL_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED> Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
|
||||
// <i> Default: 0
|
||||
// <i> Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS.
|
||||
#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED 0
|
||||
|
||||
// <q SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED> Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
|
||||
// <i> Default: 0
|
||||
// <i> Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
|
||||
#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED 1
|
||||
|
||||
// <q SL_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED> Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
|
||||
// <i> Default: 0
|
||||
// <i> Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
|
||||
#define SL_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED 0
|
||||
|
||||
// <q SL_MBEDTLS_HARDWARE_ACCELERATION_ENABLED> Enable hardware acceleration of crypto operations.
|
||||
// <i> Default: 1
|
||||
// <i> Enable hardware acceleration of crypto operations.
|
||||
#define SL_MBEDTLS_HARDWARE_ACCELERATION_ENABLED 1
|
||||
|
||||
// </h>
|
||||
// <<< end of configuration section >>>
|
||||
|
||||
// Convert CMSIS Markup config defines to mbedTLS specific config defines
|
||||
#if SL_MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
||||
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
||||
#endif
|
||||
#if SL_MBEDTLS_SSL_EXPORT_KEYS
|
||||
#define MBEDTLS_SSL_EXPORT_KEYS
|
||||
#endif
|
||||
#if SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
|
||||
#endif
|
||||
#if SL_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||
#endif
|
||||
#if SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||
#endif
|
||||
#if SL_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||
#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||
#endif
|
||||
#if !SL_MBEDTLS_HARDWARE_ACCELERATION_ENABLED
|
||||
#define NO_CRYPTO_ACCELERATION
|
||||
#endif
|
||||
|
||||
// Include the autogenerated mbedtls configuration file
|
||||
#include "mbedtls_config_autogen.h"
|
||||
|
||||
// Custom defines can be placed here before check_config.h is included.
|
||||
#include "mbedtls/check_config.h"
|
||||
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "openthread-core-efr32-config.h"
|
||||
#include "platform-efr32.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
#include <openthread/platform/memory.h>
|
||||
|
||||
#include "sl_malloc.h"
|
||||
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
return sl_calloc(aNum, aSize);
|
||||
}
|
||||
|
||||
void otPlatFree(void *aPtr)
|
||||
{
|
||||
sl_free(aPtr);
|
||||
}
|
||||
#endif
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for miscellaneous behaviors.
|
||||
*/
|
||||
|
||||
#include <openthread/platform/misc.h>
|
||||
|
||||
#include "em_rmu.h"
|
||||
#include "platform-efr32.h"
|
||||
|
||||
static uint32_t sResetCause;
|
||||
|
||||
void efr32MiscInit(void)
|
||||
{
|
||||
// Read the cause of last reset.
|
||||
sResetCause = RMU_ResetCauseGet();
|
||||
|
||||
// Clear the register, as the causes cumulate over resets.
|
||||
RMU_ResetCauseClear();
|
||||
}
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otPlatResetReason reason = OT_PLAT_RESET_REASON_UNKNOWN;
|
||||
|
||||
#if defined(_EMU_RSTCAUSE_MASK)
|
||||
if (sResetCause & EMU_RSTCAUSE_POR)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_POWER_ON;
|
||||
}
|
||||
else if (sResetCause & EMU_RSTCAUSE_SYSREQ)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_SOFTWARE;
|
||||
}
|
||||
else if ((sResetCause & EMU_RSTCAUSE_WDOG0) || (sResetCause & EMU_RSTCAUSE_WDOG1))
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_WATCHDOG;
|
||||
}
|
||||
else if (sResetCause & EMU_RSTCAUSE_PIN)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_EXTERNAL;
|
||||
}
|
||||
else if (sResetCause & EMU_RSTCAUSE_LOCKUP)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_FAULT;
|
||||
}
|
||||
else if ((sResetCause & EMU_RSTCAUSE_AVDDBOD) || (sResetCause & EMU_RSTCAUSE_DECBOD) ||
|
||||
(sResetCause & EMU_RSTCAUSE_DVDDBOD) || (sResetCause & EMU_RSTCAUSE_DVDDLEBOD) ||
|
||||
(sResetCause & EMU_RSTCAUSE_EM4))
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_OTHER;
|
||||
}
|
||||
#endif
|
||||
#if defined(_RMU_RSTCAUSE_MASK)
|
||||
if (sResetCause & RMU_RSTCAUSE_PORST)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_POWER_ON;
|
||||
}
|
||||
else if (sResetCause & RMU_RSTCAUSE_SYSREQRST)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_SOFTWARE;
|
||||
}
|
||||
else if (sResetCause & RMU_RSTCAUSE_WDOGRST)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_WATCHDOG;
|
||||
}
|
||||
else if (sResetCause & RMU_RSTCAUSE_EXTRST)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_EXTERNAL;
|
||||
}
|
||||
else if (sResetCause & RMU_RSTCAUSE_LOCKUPRST)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_FAULT;
|
||||
}
|
||||
else if ((sResetCause & RMU_RSTCAUSE_AVDDBOD) || (sResetCause & RMU_RSTCAUSE_DECBOD) ||
|
||||
(sResetCause & RMU_RSTCAUSE_DVDDBOD) || (sResetCause & RMU_RSTCAUSE_EM4RST))
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_OTHER;
|
||||
}
|
||||
#endif
|
||||
return reason;
|
||||
}
|
||||
|
||||
void otPlatWakeHost(void)
|
||||
{
|
||||
// TODO: implement an operation to wake the host from sleep state.
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef OPENTHREAD_CORE_EFR32_CONFIG_CHECK_H_
|
||||
#define OPENTHREAD_CORE_EFR32_CONFIG_CHECK_H_
|
||||
|
||||
#include "board_config.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
#error "Platform doesn't support configuration option: OPENTHREAD_CONFIG_TIME_SYNC_ENABLE"
|
||||
#endif
|
||||
|
||||
#ifndef RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
|
||||
#if OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT
|
||||
#error "Platform not configured to support configuration option: OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* OPENTHREAD_CORE_EFR32_CONFIG_CHECK_H_ */
|
||||
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes efr32 compile-time configuration constants
|
||||
* for OpenThread.
|
||||
*/
|
||||
|
||||
#include "board_config.h"
|
||||
|
||||
// IMPORTANT: Do not remove this include. Apps will build without error, but
|
||||
// they will not boot up properly
|
||||
#include "em_msc.h"
|
||||
|
||||
#ifndef OPENTHREAD_CORE_EFR32_CONFIG_H_
|
||||
#define OPENTHREAD_CORE_EFR32_CONFIG_H_
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
|
||||
*
|
||||
* The efr32 platform provides an otPlatLog() function.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT /* allow command line override */
|
||||
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @def OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT
|
||||
*
|
||||
* Define to 1 if you want to enable physical layer to support OQPSK modulation in 915MHz band.
|
||||
*
|
||||
*/
|
||||
#if RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
|
||||
#define OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT 1
|
||||
#else
|
||||
#define OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @def OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT
|
||||
*
|
||||
* Define to 1 if you want to enable physical layer to support OQPSK modulation in 2.4GHz band.
|
||||
*
|
||||
*/
|
||||
#if RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT
|
||||
#define OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT 1
|
||||
#else
|
||||
#define OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_INFO
|
||||
*
|
||||
* The platform-specific string to insert into the OpenThread version string.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_INFO "EFR32"
|
||||
|
||||
/*
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE
|
||||
*
|
||||
* Define to 1 if you want to enable software retransmission logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE
|
||||
*
|
||||
* Define to 1 if you want to enable software CSMA-CA backoff logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
||||
*
|
||||
* Define to 1 if you want to enable software transmission security logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE \
|
||||
(OPENTHREAD_RADIO && (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2))
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software transmission target time logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE \
|
||||
(OPENTHREAD_RADIO && (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2))
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE
|
||||
*
|
||||
* Define to 1 if you want to enable software energy scanning logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 0
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
*
|
||||
* Define to 1 if you want to support microsecond timer in platform.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE \
|
||||
(OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE && (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2))
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||
*
|
||||
* Define to 1 to enable otPlatFlash* APIs to support non-volatile storage.
|
||||
*
|
||||
* When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 0
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
|
||||
*
|
||||
* Define to 1 to enable NCP HDLC support.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MIN_SLEEP_DURATION_MS
|
||||
*
|
||||
* Minimum duration in ms below which the platform will not
|
||||
* enter a deep sleep (EM2) mode.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MIN_SLEEP_DURATION_MS 5
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
*
|
||||
* Enable the external heap.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_EFR32_UART_TX_FLUSH_TIMEOUT_MS
|
||||
*
|
||||
* Maximum time to wait for a flush to complete in otPlatUartFlush().
|
||||
*
|
||||
* Value is in milliseconds
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_EFR32_UART_TX_FLUSH_TIMEOUT_MS 500
|
||||
|
||||
#endif // OPENTHREAD_CORE_EFR32_CONFIG_H_
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file defines the frequency band configuration structure for efr32.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PLATFORM_BAND_H_
|
||||
#define PLATFORM_BAND_H_
|
||||
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#include "rail.h"
|
||||
#include "rail_config.h"
|
||||
#include "rail_ieee802154.h"
|
||||
|
||||
#define RAIL_TX_FIFO_SIZE (OT_RADIO_FRAME_MAX_SIZE + 1)
|
||||
|
||||
#define RADIO_SCHEDULER_BACKGROUND_RX_PRIORITY 255
|
||||
#define RADIO_SCHEDULER_CHANNEL_SCAN_PRIORITY 255
|
||||
#define RADIO_SCHEDULER_CHANNEL_SLIP_TIME 500000UL
|
||||
#define RADIO_SCHEDULER_TX_PRIORITY 100
|
||||
#define RADIO_SCHEDULER_TX_SLIP_TIME 500000UL
|
||||
|
||||
#define RADIO_TIMING_CSMA_OVERHEAD_US 500
|
||||
#define RADIO_TIMING_DEFAULT_BYTETIME_US 32 // only used if RAIL_GetBitRate returns 0
|
||||
#define RADIO_TIMING_DEFAULT_SYMBOLTIME_US 16 // only used if RAIL_GetSymbolRate returns 0
|
||||
|
||||
typedef struct efr32RadioCounters
|
||||
{
|
||||
uint64_t mRailPlatTxTriggered;
|
||||
uint64_t mRailPlatRadioReceiveDoneCbCount;
|
||||
uint64_t mRailPlatRadioEnergyScanDoneCbCount;
|
||||
uint64_t mRailPlatRadioTxDoneCbCount;
|
||||
uint64_t mRailTxStarted;
|
||||
uint64_t mRailTxStartFailed;
|
||||
uint64_t mRailEventConfigScheduled;
|
||||
uint64_t mRailEventConfigUnScheduled;
|
||||
uint64_t mRailEventPacketSent;
|
||||
uint64_t mRailEventChannelBusy;
|
||||
uint64_t mRailEventEnergyScanCompleted;
|
||||
uint64_t mRailEventCalNeeded;
|
||||
uint64_t mRailEventPacketReceived;
|
||||
uint64_t mRailEventNoAck;
|
||||
uint64_t mRailEventTxAbort;
|
||||
uint64_t mRailEventSchedulerStatusError;
|
||||
uint64_t mRailEventsSchedulerStatusTransmitBusy;
|
||||
uint32_t mRailEventsSchedulerStatusLastStatus;
|
||||
} efr32RadioCounters;
|
||||
|
||||
typedef struct efr32CommonConfig
|
||||
{
|
||||
RAIL_Config_t mRailConfig;
|
||||
#if RADIO_CONFIG_DMP_SUPPORT
|
||||
RAILSched_Config_t mRailSchedState;
|
||||
#endif
|
||||
uint8_t
|
||||
mRailTxFifo[RAIL_TX_FIFO_SIZE]; // must be 2 power between 64 and 4096, and bigger than OT_RADIO_FRAME_MAX_SIZE
|
||||
} efr32CommonConfig;
|
||||
|
||||
typedef struct efr32BandConfig
|
||||
{
|
||||
const RAIL_ChannelConfig_t *mChannelConfig;
|
||||
uint8_t mChannelMin;
|
||||
uint8_t mChannelMax;
|
||||
} efr32BandConfig;
|
||||
|
||||
#endif // PLATFORM_BAND_H_
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes the platform-specific initializers.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PLATFORM_EFR32_H_
|
||||
#define PLATFORM_EFR32_H_
|
||||
|
||||
#include <openthread/instance.h>
|
||||
|
||||
#include "em_device.h"
|
||||
#include "em_system.h"
|
||||
|
||||
#include "rail.h"
|
||||
|
||||
// Global OpenThread instance structure
|
||||
extern otInstance *sInstance;
|
||||
|
||||
// Global reference to rail handle
|
||||
extern RAIL_Handle_t gRailHandle;
|
||||
|
||||
/**
|
||||
* This function initializes the alarm service used by OpenThread.
|
||||
*
|
||||
*/
|
||||
void efr32AlarmInit(void);
|
||||
|
||||
/**
|
||||
* This function performs alarm driver processing.
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
*
|
||||
*/
|
||||
void efr32AlarmProcess(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function initializes the radio service used by OpenThead.
|
||||
*
|
||||
*/
|
||||
void efr32RadioInit(void);
|
||||
|
||||
/**
|
||||
* This function deinitializes the radio service used by OpenThead.
|
||||
*
|
||||
*/
|
||||
void efr32RadioDeinit(void);
|
||||
|
||||
/**
|
||||
* This function performs radio driver processing.
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
*
|
||||
*/
|
||||
void efr32RadioProcess(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function performs UART driver processing.
|
||||
*
|
||||
*/
|
||||
void efr32UartProcess(void);
|
||||
|
||||
/**
|
||||
* Initialization of Misc module.
|
||||
*
|
||||
*/
|
||||
void efr32MiscInit(void);
|
||||
|
||||
/**
|
||||
* Initialization of Logger driver.
|
||||
*
|
||||
*/
|
||||
void efr32LogInit(void);
|
||||
|
||||
/**
|
||||
* Deinitialization of Logger driver.
|
||||
*
|
||||
*/
|
||||
void efr32LogDeinit(void);
|
||||
|
||||
/**
|
||||
* Registers the sleep callback handler. The callback is used to check that
|
||||
* the application has no work pending and that it is safe to put the EFR32
|
||||
* into a low energy sleep mode.
|
||||
*
|
||||
* The callback should return true if it is ok to enter sleep mode. Note
|
||||
* that the callback itself is run with interrupts disabled and so should
|
||||
* be kept as short as possible. Anny interrupt including those from timers
|
||||
* will wake the EFR32 out of sleep mode.
|
||||
*
|
||||
* @param[in] aCallback Callback function.
|
||||
*
|
||||
*/
|
||||
void efr32SetSleepCallback(bool (*aCallback)(void));
|
||||
|
||||
/**
|
||||
* Put the EFR32 into a low power mode. Before sleeping it will call a callback
|
||||
* in the application registered with efr32SetSleepCallback to ensure that there
|
||||
* is no outstanding work in the application to do.
|
||||
*/
|
||||
void efr32Sleep(void);
|
||||
|
||||
#endif // PLATFORM_EFR32_H_
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
#ifndef __RAIL_CONFIG_H__
|
||||
#define __RAIL_CONFIG_H__
|
||||
|
||||
#include "board_config.h"
|
||||
#include "rail_types.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define RADIO_CONFIG_XTAL_FREQUENCY 38400000UL
|
||||
|
||||
#if RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
|
||||
extern const RAIL_ChannelConfig_t *channelConfigs[];
|
||||
#endif
|
||||
|
||||
#endif // __RAIL_CONFIG_H__
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements gcc-specific startup code for the efr32.
|
||||
*/
|
||||
|
||||
__extension__ typedef int __guard __attribute__((mode(__DI__)));
|
||||
|
||||
int __cxa_guard_acquire(__guard *g)
|
||||
{
|
||||
return !*(char *)(g);
|
||||
}
|
||||
|
||||
void __cxa_guard_release(__guard *g)
|
||||
{
|
||||
*(char *)g = 1;
|
||||
}
|
||||
|
||||
void __cxa_guard_abort(__guard *g)
|
||||
{
|
||||
(void)g;
|
||||
}
|
||||
|
||||
void __cxa_pure_virtual(void)
|
||||
{
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
@@ -1,264 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
* This file includes the platform-specific initializers.
|
||||
*/
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "openthread-system.h"
|
||||
|
||||
#include "common/logging.hpp"
|
||||
|
||||
#include "bsp.h"
|
||||
#include "bsp_init.h"
|
||||
#include "dmadrv.h"
|
||||
#include "ecode.h"
|
||||
#include "em_chip.h"
|
||||
#include "em_cmu.h"
|
||||
#include "em_core.h"
|
||||
#include "em_device.h"
|
||||
#include "em_emu.h"
|
||||
#include "em_system.h"
|
||||
#include "hal-config.h"
|
||||
#include "hal_common.h"
|
||||
#include "platform-efr32.h"
|
||||
#include "rail.h"
|
||||
#include "sl_device_init_nvic.h"
|
||||
#include "sl_mpu.h"
|
||||
#include "sl_sleeptimer.h"
|
||||
|
||||
#if (HAL_FEM_ENABLE)
|
||||
#include "fem-control.h"
|
||||
#endif
|
||||
|
||||
#define USE_EFR32_LOG (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED)
|
||||
|
||||
void initAntenna(void);
|
||||
|
||||
static void boardDisableSpiFlash(void)
|
||||
{
|
||||
#if defined(BSP_EXTFLASH_USART) && !defined(HAL_DISABLE_EXTFLASH)
|
||||
#include "mx25flash_spi.h"
|
||||
MX25_init();
|
||||
MX25_DP();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void boardLowPowerInit(void)
|
||||
{
|
||||
boardDisableSpiFlash();
|
||||
}
|
||||
|
||||
static void halInitChipSpecific(void)
|
||||
{
|
||||
#if defined(BSP_DK) && !defined(RAIL_IC_SIM_BUILD)
|
||||
BSP_Init(BSP_INIT_DK_SPI);
|
||||
#endif
|
||||
BSP_initDevice();
|
||||
|
||||
#if !defined(RAIL_IC_SIM_BUILD)
|
||||
BSP_initBoard();
|
||||
#endif
|
||||
|
||||
#if HAL_PTI_ENABLE
|
||||
RAIL_PtiConfig_t railPtiConfig = {
|
||||
#if HAL_PTI_MODE == HAL_PTI_MODE_SPI
|
||||
.mode = RAIL_PTI_MODE_SPI,
|
||||
#elif HAL_PTI_MODE == HAL_PTI_MODE_UART
|
||||
.mode = RAIL_PTI_MODE_UART,
|
||||
#elif HAL_PTI_MODE == HAL_PTI_MODE_UART_ONEWIRE
|
||||
.mode = RAIL_PTI_MODE_UART_ONEWIRE,
|
||||
#else
|
||||
.mode = RAIL_PTI_MODE_DISABLED,
|
||||
#endif
|
||||
.baud = HAL_PTI_BAUD_RATE,
|
||||
#ifdef BSP_PTI_DOUT_LOC
|
||||
.doutLoc = BSP_PTI_DOUT_LOC,
|
||||
#endif
|
||||
.doutPort = (uint8_t)BSP_PTI_DOUT_PORT,
|
||||
.doutPin = BSP_PTI_DOUT_PIN,
|
||||
#if HAL_PTI_MODE == HAL_PTI_MODE_SPI
|
||||
#ifdef BSP_PTI_DCLK_LOC
|
||||
.dclkLoc = BSP_PTI_DCLK_LOC,
|
||||
#endif
|
||||
.dclkPort = (uint8_t)BSP_PTI_DCLK_PORT,
|
||||
.dclkPin = BSP_PTI_DCLK_PIN,
|
||||
#endif
|
||||
#if HAL_PTI_MODE != HAL_PTI_MODE_UART_ONEWIRE
|
||||
#ifdef BSP_PTI_DFRAME_LOC
|
||||
.dframeLoc = BSP_PTI_DFRAME_LOC,
|
||||
#endif
|
||||
.dframePort = (uint8_t)BSP_PTI_DFRAME_PORT,
|
||||
.dframePin = BSP_PTI_DFRAME_PIN
|
||||
#endif
|
||||
};
|
||||
|
||||
RAIL_ConfigPti(RAIL_EFR32_HANDLE, &railPtiConfig);
|
||||
#endif // HAL_PTI_ENABLE
|
||||
|
||||
#if !defined(RAIL_IC_SIM_BUILD)
|
||||
initAntenna();
|
||||
|
||||
// Disable any unused peripherals to ensure we enter a low power mode
|
||||
boardLowPowerInit();
|
||||
#endif
|
||||
|
||||
#if RAIL_DMA_CHANNEL == DMA_CHANNEL_DMADRV
|
||||
Ecode_t dmaError = DMADRV_Init();
|
||||
if ((dmaError == ECODE_EMDRV_DMADRV_ALREADY_INITIALIZED) || (dmaError == ECODE_EMDRV_DMADRV_OK))
|
||||
{
|
||||
unsigned int channel;
|
||||
dmaError = DMADRV_AllocateChannel(&channel, NULL);
|
||||
if (dmaError == ECODE_EMDRV_DMADRV_OK)
|
||||
{
|
||||
RAIL_UseDma(channel);
|
||||
}
|
||||
}
|
||||
#elif defined(RAIL_DMA_CHANNEL) && (RAIL_DMA_CHANNEL != DMA_CHANNEL_INVALID)
|
||||
LDMA_Init_t ldmaInit = LDMA_INIT_DEFAULT;
|
||||
LDMA_Init(&ldmaInit);
|
||||
RAIL_UseDma(RAIL_DMA_CHANNEL);
|
||||
#endif
|
||||
}
|
||||
|
||||
otInstance *sInstance;
|
||||
static bool (*sCanSleepCallback)(void);
|
||||
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
sl_status_t status;
|
||||
|
||||
__disable_irq();
|
||||
|
||||
CHIP_Init();
|
||||
sl_device_init_nvic();
|
||||
halInitChipSpecific();
|
||||
BSP_Init(BSP_INIT_BCC);
|
||||
|
||||
// Enable LE peripheral clock. Needed for RTCC initialization in sl_sleeptimer_init()
|
||||
#if !defined(_SILICON_LABS_32B_SERIES_2)
|
||||
CMU_ClockEnable(cmuClock_HFLE, true);
|
||||
CMU_OscillatorEnable(cmuOsc_LFRCO, true, true);
|
||||
#endif // !defined(_SILICON_LABS_32B_SERIES_2)
|
||||
|
||||
status = sl_sleeptimer_init();
|
||||
assert(status == SL_STATUS_OK);
|
||||
|
||||
#if (HAL_FEM_ENABLE)
|
||||
initFem();
|
||||
wakeupFem();
|
||||
#endif
|
||||
|
||||
__enable_irq();
|
||||
|
||||
#if USE_EFR32_LOG
|
||||
efr32LogInit();
|
||||
#endif
|
||||
efr32RadioInit();
|
||||
efr32AlarmInit();
|
||||
efr32MiscInit();
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void otSysDeinit(void)
|
||||
{
|
||||
efr32RadioDeinit();
|
||||
|
||||
#if USE_EFR32_LOG
|
||||
efr32LogDeinit();
|
||||
#endif
|
||||
}
|
||||
|
||||
void efr32SetSleepCallback(bool (*aCallback)(void))
|
||||
{
|
||||
sCanSleepCallback = aCallback;
|
||||
}
|
||||
|
||||
void efr32Sleep(void)
|
||||
{
|
||||
bool canDeepSleep = false;
|
||||
int wakeupProcessTime = 1000;
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
|
||||
if (RAIL_Sleep(wakeupProcessTime, &canDeepSleep) == RAIL_STATUS_NO_ERROR)
|
||||
{
|
||||
if (canDeepSleep)
|
||||
{
|
||||
CORE_ENTER_ATOMIC();
|
||||
if (sCanSleepCallback != NULL && sCanSleepCallback())
|
||||
{
|
||||
EMU_EnterEM2(true);
|
||||
}
|
||||
CORE_EXIT_ATOMIC();
|
||||
// TODO OT will handle an interrupt here and it mustn't call any RAIL APIs
|
||||
|
||||
while (RAIL_Wake(0) != RAIL_STATUS_NO_ERROR)
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CORE_ENTER_ATOMIC();
|
||||
if (sCanSleepCallback != NULL && sCanSleepCallback())
|
||||
{
|
||||
EMU_EnterEM1();
|
||||
}
|
||||
CORE_EXIT_ATOMIC();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void otSysProcessDrivers(otInstance *aInstance)
|
||||
{
|
||||
sInstance = aInstance;
|
||||
|
||||
// should sleep and wait for interrupts here
|
||||
|
||||
efr32UartProcess();
|
||||
efr32RadioProcess(aInstance);
|
||||
efr32AlarmProcess(aInstance);
|
||||
}
|
||||
|
||||
__WEAK void otSysEventSignalPending(void)
|
||||
{
|
||||
// Intentionally empty
|
||||
}
|
||||
@@ -1,313 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for UART communication.
|
||||
*
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "openthread-system.h"
|
||||
#include <openthread-core-config.h>
|
||||
|
||||
#include "utils/code_utils.h"
|
||||
#include "utils/uart.h"
|
||||
|
||||
#include "ecode.h"
|
||||
#include "em_core.h"
|
||||
#include "sl_sleeptimer.h"
|
||||
#include "sl_status.h"
|
||||
#include "uartdrv.h"
|
||||
|
||||
#include "hal-config.h"
|
||||
#include "platform-efr32.h"
|
||||
#include "sl_uartdrv_usart_vcom_config.h"
|
||||
|
||||
#define HELPER1(x) USART##x##_RX_IRQn
|
||||
#define HELPER2(x) HELPER1(x)
|
||||
#define USART_IRQ HELPER2(SL_UARTDRV_USART_VCOM_PERIPHERAL_NO)
|
||||
|
||||
#define HELPER3(x) USART##x##_RX_IRQHandler
|
||||
#define HELPER4(x) HELPER3(x)
|
||||
#define USART_IRQHandler HELPER4(SL_UARTDRV_USART_VCOM_PERIPHERAL_NO)
|
||||
|
||||
enum
|
||||
{
|
||||
kReceiveFifoSize = 128,
|
||||
};
|
||||
|
||||
DEFINE_BUF_QUEUE(EMDRV_UARTDRV_MAX_CONCURRENT_RX_BUFS, sUartRxQueue);
|
||||
DEFINE_BUF_QUEUE(EMDRV_UARTDRV_MAX_CONCURRENT_TX_BUFS, sUartTxQueue);
|
||||
|
||||
static const UARTDRV_InitUart_t USART_INIT = {
|
||||
.port = USART0, /* USART port */
|
||||
.baudRate = HAL_SERIAL_APP_BAUD_RATE, /* Baud rate */
|
||||
#if defined(_USART_ROUTELOC0_MASK)
|
||||
.portLocationTx = BSP_SERIAL_APP_TX_LOC, /* USART Tx pin location number */
|
||||
.portLocationRx = BSP_SERIAL_APP_RX_LOC, /* USART Rx pin location number */
|
||||
#elif defined(_USART_ROUTE_MASK)
|
||||
#error This configuration is not supported
|
||||
// .portLocation = NULL;
|
||||
#elif defined(_GPIO_USART_ROUTEEN_MASK)
|
||||
.txPort = BSP_SERIAL_APP_TX_PORT, /* USART Tx port number */
|
||||
.rxPort = BSP_SERIAL_APP_RX_PORT, /* USART Rx port number */
|
||||
.txPin = BSP_SERIAL_APP_TX_PIN, /* USART Tx pin number */
|
||||
.rxPin = BSP_SERIAL_APP_RX_PIN, /* USART Rx pin number */
|
||||
.uartNum = 0, /* UART instance number */
|
||||
#endif
|
||||
.stopBits = (USART_Stopbits_TypeDef)USART_FRAME_STOPBITS_ONE, /* Stop bits */
|
||||
.parity = (USART_Parity_TypeDef)USART_FRAME_PARITY_NONE, /* Parity */
|
||||
.oversampling = (USART_OVS_TypeDef)USART_CTRL_OVS_X16, /* Oversampling mode*/
|
||||
#if defined(USART_CTRL_MVDIS)
|
||||
.mvdis = false, /* Majority vote disable */
|
||||
#endif // USART_CTRL_MVDIS
|
||||
.fcType = HAL_SERIAL_APP_FLOW_CONTROL, /* Flow control */
|
||||
.ctsPort = BSP_SERIAL_APP_CTS_PORT, /* CTS port number */
|
||||
.ctsPin = BSP_SERIAL_APP_CTS_PIN, /* CTS pin number */
|
||||
.rtsPort = BSP_SERIAL_APP_RTS_PORT, /* RTS port number */
|
||||
.rtsPin = BSP_SERIAL_APP_RTS_PIN, /* RTS pin number */
|
||||
.rxQueue = (UARTDRV_Buffer_FifoQueue_t *)&sUartRxQueue, /* RX operation queue */
|
||||
.txQueue = (UARTDRV_Buffer_FifoQueue_t *)&sUartTxQueue, /* TX operation queue */
|
||||
#if defined(_USART_ROUTELOC1_MASK)
|
||||
.portLocationCts = BSP_SERIAL_APP_CTS_LOC, /* CTS location */
|
||||
.portLocationRts = BSP_SERIAL_APP_RTS_LOC /* RTS location */
|
||||
#endif // _USART_ROUTELOC1_MASK
|
||||
};
|
||||
|
||||
static UARTDRV_HandleData_t sUartHandleData;
|
||||
static UARTDRV_Handle_t sUartHandle = &sUartHandleData;
|
||||
|
||||
// In order to reduce the probability of data loss due to disabled interrupts, we use
|
||||
// two duplicate receive buffers so we can always have one "active" receive request.
|
||||
#define RECEIVE_BUFFER_SIZE 128
|
||||
static uint8_t sReceiveBuffer1[RECEIVE_BUFFER_SIZE];
|
||||
static uint8_t sReceiveBuffer2[RECEIVE_BUFFER_SIZE];
|
||||
static uint8_t lastCount = 0;
|
||||
static volatile bool sCheckForTxComplete = false;
|
||||
|
||||
typedef struct ReceiveFifo_t
|
||||
{
|
||||
// The data buffer
|
||||
uint8_t mBuffer[kReceiveFifoSize];
|
||||
// The offset of the first item written to the list.
|
||||
volatile uint16_t mHead;
|
||||
// The offset of the next item to be written to the list.
|
||||
volatile uint16_t mTail;
|
||||
} ReceiveFifo_t;
|
||||
|
||||
static ReceiveFifo_t sReceiveFifo;
|
||||
|
||||
static void processReceive(void);
|
||||
static void processTransmit(void);
|
||||
|
||||
static void receiveDone(UARTDRV_Handle_t aHandle, Ecode_t aStatus, uint8_t *aData, UARTDRV_Count_t aCount)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aStatus);
|
||||
|
||||
// We can only write if incrementing mTail doesn't equal mHead
|
||||
if (sReceiveFifo.mHead != (sReceiveFifo.mTail + aCount - lastCount) % kReceiveFifoSize)
|
||||
{
|
||||
memcpy(sReceiveFifo.mBuffer + sReceiveFifo.mTail, aData + lastCount, aCount - lastCount);
|
||||
sReceiveFifo.mTail = (sReceiveFifo.mTail + aCount - lastCount) % kReceiveFifoSize;
|
||||
lastCount = 0;
|
||||
}
|
||||
|
||||
UARTDRV_Receive(aHandle, aData, aCount, receiveDone);
|
||||
otSysEventSignalPending();
|
||||
}
|
||||
|
||||
static void transmitDone(UARTDRV_Handle_t aHandle, Ecode_t aStatus, uint8_t *aData, UARTDRV_Count_t aCount)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aHandle);
|
||||
OT_UNUSED_VARIABLE(aStatus);
|
||||
OT_UNUSED_VARIABLE(aData);
|
||||
OT_UNUSED_VARIABLE(aCount);
|
||||
|
||||
// This value will be used later in processTransmit() to call otPlatUartSendDone()
|
||||
sCheckForTxComplete = true;
|
||||
|
||||
otSysEventSignalPending();
|
||||
}
|
||||
|
||||
static void processReceive(void)
|
||||
{
|
||||
uint8_t * aData;
|
||||
UARTDRV_Count_t aCount, remaining;
|
||||
CORE_ATOMIC_SECTION(UARTDRV_GetReceiveStatus(sUartHandle, &aData, &aCount, &remaining);
|
||||
|
||||
if (aCount > lastCount) {
|
||||
memcpy(sReceiveFifo.mBuffer + sReceiveFifo.mTail, aData + lastCount, aCount - lastCount);
|
||||
sReceiveFifo.mTail = (sReceiveFifo.mTail + aCount - lastCount) % kReceiveFifoSize;
|
||||
lastCount = aCount;
|
||||
})
|
||||
|
||||
// Copy tail to prevent multiple reads
|
||||
uint16_t tail = sReceiveFifo.mTail;
|
||||
|
||||
// If the data wraps around, process the first part
|
||||
if (sReceiveFifo.mHead > tail)
|
||||
{
|
||||
otPlatUartReceived(sReceiveFifo.mBuffer + sReceiveFifo.mHead, kReceiveFifoSize - sReceiveFifo.mHead);
|
||||
|
||||
// Reset the buffer mHead back to zero.
|
||||
sReceiveFifo.mHead = 0;
|
||||
}
|
||||
|
||||
// For any data remaining, process it
|
||||
if (sReceiveFifo.mHead != tail)
|
||||
{
|
||||
otPlatUartReceived(sReceiveFifo.mBuffer + sReceiveFifo.mHead, tail - sReceiveFifo.mHead);
|
||||
|
||||
// Set mHead to the local tail we have cached
|
||||
sReceiveFifo.mHead = tail;
|
||||
}
|
||||
}
|
||||
|
||||
static void flushTimeoutAlarmCallback(sl_sleeptimer_timer_handle_t *aHandle, void *aData)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aHandle);
|
||||
OT_UNUSED_VARIABLE(aData);
|
||||
bool *flushTimedOut = (bool *)aData;
|
||||
*flushTimedOut = true;
|
||||
}
|
||||
|
||||
otError otPlatUartFlush(void)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
sl_status_t status = SL_STATUS_OK;
|
||||
volatile bool flushTimedOut = false;
|
||||
sl_sleeptimer_timer_handle_t flushTimer;
|
||||
|
||||
// Start flush timeout timer
|
||||
status = sl_sleeptimer_start_timer_ms(&flushTimer, OPENTHREAD_CONFIG_EFR32_UART_TX_FLUSH_TIMEOUT_MS,
|
||||
flushTimeoutAlarmCallback, NULL, 0,
|
||||
SL_SLEEPTIMER_NO_HIGH_PRECISION_HF_CLOCKS_REQUIRED_FLAG);
|
||||
otEXPECT_ACTION(status == SL_STATUS_OK, error = OT_ERROR_FAILED);
|
||||
|
||||
// Block until DMA has finished transmitting every buffer in sUartTxQueue and becomes idle
|
||||
uint8_t transmitQueueDepth = 0;
|
||||
bool uartFullyFlushed = false;
|
||||
bool uartIdle = false;
|
||||
|
||||
do
|
||||
{
|
||||
// Check both peripheral status and queue depth
|
||||
transmitQueueDepth = UARTDRV_GetTransmitDepth(sUartHandle);
|
||||
uartIdle = UARTDRV_GetPeripheralStatus(sUartHandle) & (UARTDRV_STATUS_TXIDLE | UARTDRV_STATUS_TXC);
|
||||
uartFullyFlushed = uartIdle && (transmitQueueDepth == 0);
|
||||
} while (!uartFullyFlushed && !flushTimedOut);
|
||||
|
||||
sl_sleeptimer_stop_timer(&flushTimer);
|
||||
|
||||
if (flushTimedOut)
|
||||
{
|
||||
// Abort all transmits
|
||||
UARTDRV_Abort(sUartHandle, uartdrvAbortTransmit);
|
||||
}
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
static void processTransmit(void)
|
||||
{
|
||||
// NOTE: This check needs to be done in here and cannot be done in transmitDone because the transmit may not be
|
||||
// fully complete when the transmitDone callback is called.
|
||||
if (!sCheckForTxComplete)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool queueEmpty = UARTDRV_GetPeripheralStatus(sUartHandle) & (UARTDRV_STATUS_TXIDLE | UARTDRV_STATUS_TXC);
|
||||
uint8_t transmitQueueDepth = UARTDRV_GetTransmitDepth(sUartHandle);
|
||||
|
||||
if (transmitQueueDepth == 0 && queueEmpty)
|
||||
{
|
||||
sCheckForTxComplete = false;
|
||||
otPlatUartSendDone();
|
||||
}
|
||||
}
|
||||
|
||||
void USART_IRQHandler(void)
|
||||
{
|
||||
otSysEventSignalPending();
|
||||
}
|
||||
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
UARTDRV_InitUart_t uartInit = USART_INIT;
|
||||
|
||||
sReceiveFifo.mHead = 0;
|
||||
sReceiveFifo.mTail = 0;
|
||||
|
||||
UARTDRV_Init(sUartHandle, &uartInit);
|
||||
|
||||
// When one receive request is completed, the other buffer is used for a separate receive request, issued
|
||||
// immediately.
|
||||
UARTDRV_Receive(sUartHandle, sReceiveBuffer1, RECEIVE_BUFFER_SIZE, receiveDone);
|
||||
UARTDRV_Receive(sUartHandle, sReceiveBuffer2, RECEIVE_BUFFER_SIZE, receiveDone);
|
||||
|
||||
// Enable USART0 interrupt to wake OT task when data arrives
|
||||
NVIC_ClearPendingIRQ(USART_IRQ);
|
||||
NVIC_EnableIRQ(USART_IRQ);
|
||||
USART_IntEnable(SL_UARTDRV_USART_VCOM_PERIPHERAL, USART_IF_RXDATAV);
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
Ecode_t status = ECODE_EMDRV_UARTDRV_OK;
|
||||
|
||||
// Ensure that no ongoing transmits have started finishing.
|
||||
// This prevents queued buffers from being modified before they are transmitted
|
||||
if (sCheckForTxComplete)
|
||||
{
|
||||
otPlatUartFlush();
|
||||
}
|
||||
|
||||
status = UARTDRV_Transmit(sUartHandle, (uint8_t *)aBuf, aBufLength, transmitDone);
|
||||
otEXPECT_ACTION(status == ECODE_EMDRV_UARTDRV_OK, error = OT_ERROR_FAILED);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
void efr32UartProcess(void)
|
||||
{
|
||||
processReceive();
|
||||
processTransmit();
|
||||
}
|
||||
+1
-60
@@ -46,17 +46,6 @@
|
||||
#
|
||||
# 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}
|
||||
@@ -79,7 +68,7 @@ set -euxo pipefail
|
||||
OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET:-}
|
||||
|
||||
readonly OT_SRCDIR="$(pwd)"
|
||||
readonly OT_PLATFORMS=(cc2538 efr32mg1 efr32mg12 efr32mg13 efr32mg21 nrf52811 nrf52833 nrf52840 simulation posix)
|
||||
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_POSIX_SIM_COMMON_OPTIONS=(
|
||||
"-DOT_BORDER_AGENT=ON"
|
||||
@@ -143,29 +132,6 @@ 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\""
|
||||
@@ -232,31 +198,6 @@ main()
|
||||
cc2538)
|
||||
options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=MinSizeRel")
|
||||
;;
|
||||
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
|
||||
|
||||
Vendored
-3
@@ -33,7 +33,4 @@ endif()
|
||||
if(OT_PLATFORM MATCHES "^nrf*")
|
||||
add_subdirectory(jlink)
|
||||
add_subdirectory(NordicSemiconductor)
|
||||
elseif(OT_PLATFORM MATCHES "^efr*")
|
||||
add_subdirectory(jlink)
|
||||
add_subdirectory(silabs)
|
||||
endif()
|
||||
|
||||
Vendored
-29
@@ -32,7 +32,6 @@ EXTRA_DIST = \
|
||||
nlbuild-autotools \
|
||||
openthread-test-driver \
|
||||
NordicSemiconductor \
|
||||
silabs \
|
||||
$(NULL)
|
||||
|
||||
# Always package (e.g. for 'make dist') these subdirectories.
|
||||
@@ -44,34 +43,6 @@ DIST_SUBDIRS = \
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
if OPENTHREAD_PLATFORM_EFR32MG1
|
||||
SUBDIRS += \
|
||||
silabs \
|
||||
jlink \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_EFR32MG12
|
||||
SUBDIRS += \
|
||||
silabs \
|
||||
jlink \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_EFR32MG13
|
||||
SUBDIRS += \
|
||||
silabs \
|
||||
jlink \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_EFR32MG21
|
||||
SUBDIRS += \
|
||||
silabs \
|
||||
jlink \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_PLATFORM_NRF52811
|
||||
SUBDIRS += \
|
||||
NordicSemiconductor \
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
gecko_sdk_suite
|
||||
Vendored
-109
@@ -1,109 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/utility.cmake)
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/includes.cmake)
|
||||
|
||||
# Append SILABS_GSDK_INCLUDES to OT_PUBLIC_INCLUDES
|
||||
list(APPEND OT_PUBLIC_INCLUDES ${SILABS_GSDK_INCLUDES})
|
||||
set(OT_PUBLIC_INCLUDES ${OT_PUBLIC_INCLUDES} PARENT_SCOPE)
|
||||
|
||||
set(COMMON_FLAGS
|
||||
-Wno-unused-parameter
|
||||
-Wno-missing-field-initializers
|
||||
)
|
||||
|
||||
set(SILABS_GSDK_COMMON_SOURCES
|
||||
rail_config/rail_config.c
|
||||
${SILABS_GSDK_DIR}/hardware/kit/common/bsp/bsp_bcc.c
|
||||
${SILABS_GSDK_DIR}/hardware/kit/common/bsp/bsp_init.c
|
||||
${SILABS_GSDK_DIR}/hardware/kit/common/bsp/bsp_stk.c
|
||||
${SILABS_GSDK_DIR}/hardware/kit/common/bsp/bsp_stk_leds.c
|
||||
${SILABS_GSDK_DIR}/platform/emdrv/dmadrv/src/dmadrv.c
|
||||
${SILABS_GSDK_DIR}/platform/emdrv/gpiointerrupt/src/gpiointerrupt.c
|
||||
${SILABS_GSDK_DIR}/platform/emdrv/nvm3/src/nvm3_default_common_linker.c
|
||||
${SILABS_GSDK_DIR}/platform/emdrv/nvm3/src/nvm3_hal_flash.c
|
||||
${SILABS_GSDK_DIR}/platform/emdrv/nvm3/src/nvm3_lock.c
|
||||
${SILABS_GSDK_DIR}/platform/emdrv/uartdrv/src/uartdrv.c
|
||||
${SILABS_GSDK_DIR}/platform/emdrv/ustimer/src/ustimer.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_cmu.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_core.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_emu.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_gpio.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_ldma.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_msc.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_rmu.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_rtcc.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_system.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_timer.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_usart.c
|
||||
${SILABS_GSDK_DIR}/platform/radio/rail_lib/hal/efr32/hal_efr.c
|
||||
${SILABS_GSDK_DIR}/platform/radio/rail_lib/hal/hal_common.c
|
||||
${SILABS_GSDK_DIR}/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c
|
||||
${SILABS_GSDK_DIR}/platform/service/mpu/src/sl_mpu.c
|
||||
${SILABS_GSDK_DIR}/platform/service/device_init/src/sl_device_init_nvic.c
|
||||
${SILABS_GSDK_DIR}/platform/service/sleeptimer/src/sl_sleeptimer.c
|
||||
${SILABS_GSDK_DIR}/platform/service/sleeptimer/src/sl_sleeptimer_hal_rtcc.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_alt/source/sl_entropy.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_alt/source/sl_mbedtls.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_sha.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_init.c
|
||||
)
|
||||
|
||||
# ==============================================================================
|
||||
# Build RAIL lib name
|
||||
# ==============================================================================
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/imported_libs.cmake)
|
||||
|
||||
# replace 'mg' with 'xg'
|
||||
string(REPLACE "mg" "xg" librail_platform_name ${OT_PLATFORM})
|
||||
|
||||
if(DMP)
|
||||
set(rail_dmp_string "multiprotocol_")
|
||||
else()
|
||||
set(rail_dmp_string "")
|
||||
endif()
|
||||
|
||||
set(silabs-librail "silabs-librail_${rail_dmp_string}${librail_platform_name}_gcc_release")
|
||||
|
||||
# ==============================================================================
|
||||
# Platform GSDK lib
|
||||
# ==============================================================================
|
||||
set(platform_sdk_cmake "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${OT_PLATFORM}.cmake")
|
||||
if(NOT EXISTS ${platform_sdk_cmake})
|
||||
message(FATAL_ERROR "Platform unknown: ${OT_PLATFORM}")
|
||||
endif()
|
||||
include(${platform_sdk_cmake})
|
||||
|
||||
# ==============================================================================
|
||||
# mbedtls
|
||||
# ==============================================================================
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/mbedtls.cmake)
|
||||
|
||||
list(APPEND OT_PLATFORM_DEFINES "MBEDTLS_CONFIG_FILE=\"mbedtls_config.h\"")
|
||||
set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE)
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
Copyright 2018 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
Vendored
-354
@@ -1,354 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2020, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
|
||||
include $(top_srcdir)/examples/platforms/efr32/efr32_platform_defs.am
|
||||
|
||||
# ==============================================================================
|
||||
# Which libraries to build
|
||||
# ==============================================================================
|
||||
lib_LIBRARIES = $(NULL)
|
||||
|
||||
if !OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
lib_LIBRARIES += \
|
||||
libsilabs-mbedtls.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG1
|
||||
lib_LIBRARIES += \
|
||||
libsilabs-efr32mg1-sdk.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG12
|
||||
lib_LIBRARIES += \
|
||||
libsilabs-efr32mg12-sdk.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG13
|
||||
lib_LIBRARIES += \
|
||||
libsilabs-efr32mg13-sdk.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_EFR32MG21
|
||||
lib_LIBRARIES += \
|
||||
libsilabs-efr32mg21-sdk.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# ==============================================================================
|
||||
# Compiler flags
|
||||
# ==============================================================================
|
||||
|
||||
# Do not enable -Wshadow for Silicon Labs SDK sources
|
||||
override CFLAGS := $(filter-out -Wshadow,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wshadow,$(CXXFLAGS))
|
||||
|
||||
# Do not enable -Wcast-align for Silicon Labs SDK sources
|
||||
override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS))
|
||||
override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS))
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Silabs Gecko SDK mbedtls
|
||||
# ==============================================================================
|
||||
|
||||
SILABS_MBEDTLS_DIR = $(SDK_SRC_DIR)/util/third_party/crypto/mbedtls
|
||||
|
||||
SILABS_MBEDTLS_CPPFLAGS = \
|
||||
$(MBEDTLS_CPPFLAGS) \
|
||||
-I$(SILABS_MBEDTLS_DIR)/include \
|
||||
-I$(SILABS_MBEDTLS_DIR)/include/mbedtls \
|
||||
-I$(SILABS_MBEDTLS_DIR)/library \
|
||||
-I$(SDK_SRC_DIR)/util/third_party/crypto/sl_component/sl_alt/include \
|
||||
-I$(SDK_SRC_DIR)/util/third_party/crypto/sl_component/sl_mbedtls_support/config \
|
||||
-I$(SDK_SRC_DIR)/util/third_party/crypto/sl_component/sl_mbedtls_support/inc \
|
||||
-I$(SDK_SRC_DIR)/util/third_party/crypto/sl_component/sl_psa_driver/inc \
|
||||
-I$(SDK_SRC_DIR)/util/silicon_labs/silabs_core/memory_manager \
|
||||
-I$(SDK_SRC_DIR)/platform/CMSIS/Include \
|
||||
-I$(SDK_SRC_DIR)/platform/common/inc/ \
|
||||
-I$(SDK_SRC_DIR)/platform/emlib/inc \
|
||||
-I$(SDK_SRC_DIR)/platform/radio/rail_lib/common \
|
||||
$(NULL)
|
||||
|
||||
SILABS_MBEDTLS_SOURCES = \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/aes.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/asn1parse.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/asn1write.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/base64.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/bignum.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ccm.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/cipher_wrap.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/cipher.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/cmac.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ctr_drbg.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/des.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ecdh.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ecdsa.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ecjpake.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ecp_curves.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ecp.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/entropy.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/error.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/md.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/oid.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/pem.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/pk_wrap.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/pk.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/pkparse.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/platform_util.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/platform.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/rsa_internal.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/rsa.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/sha256.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_cache.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_ciphersuites.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_cli.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_cookie.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_msg.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_srv.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_ticket.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/ssl_tls.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/threading.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/x509_create.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/x509_crl.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/x509_crt.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/x509_csr.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/x509.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/x509write_crt.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/mbedtls/library/x509write_csr.c \
|
||||
gecko_sdk_suite/v3.1/util/silicon_labs/silabs_core/memory_manager/sl_malloc.c \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_mbedtls_a_CPPFLAGS = \
|
||||
$(SILABS_MBEDTLS_CPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_mbedtls_a_SOURCES = \
|
||||
$(SILABS_MBEDTLS_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Gecko SDK
|
||||
# ==============================================================================
|
||||
|
||||
COMMONCPPFLAGS = \
|
||||
-I$(srcdir) \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/examples/platforms/efr32/src \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/third_party/silabs/rail_config \
|
||||
$(SILABS_GSDK_CPPFLAGS) \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
$(NULL)
|
||||
|
||||
SILABS_COMMON_SOURCES = \
|
||||
rail_config/rail_config.c \
|
||||
gecko_sdk_suite/v3.1/hardware/kit/common/bsp/bsp_bcc.c \
|
||||
gecko_sdk_suite/v3.1/hardware/kit/common/bsp/bsp_init.c \
|
||||
gecko_sdk_suite/v3.1/hardware/kit/common/bsp/bsp_stk.c \
|
||||
gecko_sdk_suite/v3.1/hardware/kit/common/bsp/bsp_stk_leds.c \
|
||||
gecko_sdk_suite/v3.1/platform/emdrv/dmadrv/src/dmadrv.c \
|
||||
gecko_sdk_suite/v3.1/platform/emdrv/gpiointerrupt/src/gpiointerrupt.c \
|
||||
gecko_sdk_suite/v3.1/platform/emdrv/nvm3/src/nvm3_default_common_linker.c \
|
||||
gecko_sdk_suite/v3.1/platform/emdrv/nvm3/src/nvm3_hal_flash.c \
|
||||
gecko_sdk_suite/v3.1/platform/emdrv/nvm3/src/nvm3_lock.c \
|
||||
gecko_sdk_suite/v3.1/platform/emdrv/uartdrv/src/uartdrv.c \
|
||||
gecko_sdk_suite/v3.1/platform/emdrv/ustimer/src/ustimer.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_cmu.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_core.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_emu.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_gpio.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_ldma.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_msc.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_rmu.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_rtcc.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_system.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_timer.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_usart.c \
|
||||
gecko_sdk_suite/v3.1/platform/radio/rail_lib/hal/efr32/hal_efr.c \
|
||||
gecko_sdk_suite/v3.1/platform/radio/rail_lib/hal/hal_common.c \
|
||||
gecko_sdk_suite/v3.1/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c \
|
||||
gecko_sdk_suite/v3.1/platform/service/mpu/src/sl_mpu.c \
|
||||
gecko_sdk_suite/v3.1/platform/service/device_init/src/sl_device_init_nvic.c \
|
||||
gecko_sdk_suite/v3.1/platform/service/sleeptimer/src/sl_sleeptimer.c \
|
||||
gecko_sdk_suite/v3.1/platform/service/sleeptimer/src/sl_sleeptimer_hal_rtcc.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/source/sl_entropy.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/source/sl_mbedtls.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_sha.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_init.c \
|
||||
$(NULL)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Series-level _SOURCES
|
||||
# ==============================================================================
|
||||
SILABS_EFR32MG1X_SOURCES = \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_adc.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_crypto.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_leuart.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_aes.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_ecp.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/crypto_management.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG2X_SOURCES = \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_burtc.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_prs.c \
|
||||
gecko_sdk_suite/v3.1/platform/emlib/src/em_se.c \
|
||||
gecko_sdk_suite/v3.1/platform/service/sleeptimer/src/sl_sleeptimer_hal_burtc.c \
|
||||
gecko_sdk_suite/v3.1/platform/service/sleeptimer/src/sl_sleeptimer_hal_prortc.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/source/sl_se_management.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_cmac.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ecdsa_ecdh.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_ccm.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_builtin_keys.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_signature.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c \
|
||||
$(NULL)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Platform-level _SOURCES
|
||||
# ==============================================================================
|
||||
|
||||
SILABS_EFR32MG1_SOURCES = \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG1P/Source/system_efr32mg1p.c \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG1P/Source/GCC/startup_efr32mg1p.c \
|
||||
gecko_sdk_suite/v3.1/util/third_party/crypto/sl_component/sl_alt/source/sl_entropy_adc.c \
|
||||
$(SILABS_EFR32MG1X_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG12_SOURCES = \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG12P/Source/system_efr32mg12p.c \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/startup_efr32mg12p.c \
|
||||
$(SILABS_EFR32MG1X_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG13_SOURCES = \
|
||||
gecko_sdk_suite/v3.1/hardware/kit/common/drivers/mx25flash_spi.c \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG13P/Source/system_efr32mg13p.c \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG13P/Source/GCC/startup_efr32mg13p.c \
|
||||
$(SILABS_EFR32MG1X_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
SILABS_EFR32MG21_SOURCES = \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG21/Source/system_efr32mg21.c \
|
||||
gecko_sdk_suite/v3.1/platform/Device/SiliconLabs/EFR32MG21/Source/GCC/startup_efr32mg21.c \
|
||||
$(SILABS_EFR32MG2X_SOURCES)
|
||||
$(NULL)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
|
||||
libsilabs_efr32mg1_sdk_a_CPPFLAGS = \
|
||||
$(SILABS_EFR32MG1_CPPFLAGS) \
|
||||
$(SILABS_MBEDTLS_CPPFLAGS) \
|
||||
$(COMMONCPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_efr32mg1_sdk_a_SOURCES = \
|
||||
$(SILABS_EFR32MG1_SOURCES) \
|
||||
$(SILABS_COMMON_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_efr32mg12_sdk_a_CPPFLAGS = \
|
||||
$(SILABS_EFR32MG12_CPPFLAGS) \
|
||||
$(SILABS_MBEDTLS_CPPFLAGS) \
|
||||
$(COMMONCPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_efr32mg12_sdk_a_SOURCES = \
|
||||
$(SILABS_EFR32MG12_SOURCES) \
|
||||
$(SILABS_COMMON_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_efr32mg13_sdk_a_CPPFLAGS = \
|
||||
$(SILABS_EFR32MG13_CPPFLAGS) \
|
||||
$(SILABS_MBEDTLS_CPPFLAGS) \
|
||||
$(COMMONCPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_efr32mg13_sdk_a_SOURCES = \
|
||||
$(SILABS_EFR32MG13_SOURCES) \
|
||||
$(SILABS_COMMON_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_efr32mg21_sdk_a_CPPFLAGS = \
|
||||
$(SILABS_EFR32MG21_CPPFLAGS) \
|
||||
$(SILABS_MBEDTLS_CPPFLAGS) \
|
||||
$(COMMONCPPFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
libsilabs_efr32mg21_sdk_a_SOURCES = \
|
||||
$(SILABS_EFR32MG21_SOURCES) \
|
||||
$(SILABS_COMMON_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
noinst_HEADERS = \
|
||||
$(NULL)
|
||||
|
||||
|
||||
include $(abs_top_nlbuild_autotools_dir)/automake/post.am
|
||||
Vendored
-19
@@ -1,19 +0,0 @@
|
||||
# silabs
|
||||
|
||||
## URL
|
||||
|
||||
https://www.silabs.com/products/development-tools/software/simplicity-studio
|
||||
|
||||
## Version
|
||||
|
||||
Radio Configurator Version: 3.8.0
|
||||
RAIL Adapter Version: 2.2.5
|
||||
RAIL Compatibility: 2.x
|
||||
|
||||
## License File
|
||||
|
||||
[LICENSE](LICENSE.txt)
|
||||
|
||||
## Description
|
||||
|
||||
The file in rail_config is auto-generated by Hardware Configurator in Simplicity Studio.
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/efr32mg1x.cmake)
|
||||
|
||||
add_library(silabs-efr32mg1-sdk)
|
||||
|
||||
target_compile_definitions(silabs-efr32mg1-sdk
|
||||
PRIVATE
|
||||
${COMMON_FLAG}
|
||||
)
|
||||
|
||||
target_include_directories(silabs-efr32mg1-sdk
|
||||
PUBLIC
|
||||
${SILABS_COMMON_INCLUDES}
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG1P/Include
|
||||
${SILABS_EFR32MG1X_INCLUDES}
|
||||
)
|
||||
|
||||
target_sources(silabs-efr32mg1-sdk
|
||||
PRIVATE
|
||||
${SILABS_GSDK_COMMON_SOURCES}
|
||||
${SILABS_EFR32MG1_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(silabs-efr32mg1-sdk
|
||||
PUBLIC
|
||||
silabs-mbedtls
|
||||
PRIVATE
|
||||
${silabs-librail}
|
||||
ot-config
|
||||
)
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/efr32mg1x.cmake)
|
||||
|
||||
add_library(silabs-efr32mg12-sdk)
|
||||
|
||||
target_compile_definitions(silabs-efr32mg12-sdk
|
||||
PRIVATE
|
||||
${COMMON_FLAG}
|
||||
)
|
||||
|
||||
target_include_directories(silabs-efr32mg12-sdk
|
||||
PUBLIC
|
||||
${SILABS_COMMON_INCLUDES}
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG12P/Include
|
||||
${SILABS_EFR32MG1X_INCLUDES}
|
||||
)
|
||||
|
||||
target_sources(silabs-efr32mg12-sdk
|
||||
PRIVATE
|
||||
${SILABS_GSDK_COMMON_SOURCES}
|
||||
${SILABS_EFR32MG12_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(silabs-efr32mg12-sdk
|
||||
PUBLIC
|
||||
silabs-mbedtls
|
||||
PRIVATE
|
||||
${silabs-librail}
|
||||
ot-config)
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/efr32mg1x.cmake)
|
||||
|
||||
add_library(silabs-efr32mg13-sdk)
|
||||
|
||||
target_compile_definitions(silabs-efr32mg13-sdk
|
||||
PRIVATE
|
||||
${COMMON_FLAG}
|
||||
)
|
||||
|
||||
target_include_directories(silabs-efr32mg13-sdk
|
||||
PUBLIC
|
||||
${SILABS_COMMON_INCLUDES}
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG13P/Include
|
||||
${SILABS_EFR32MG1X_INCLUDES}
|
||||
)
|
||||
|
||||
target_sources(silabs-efr32mg13-sdk
|
||||
PRIVATE
|
||||
${SILABS_GSDK_COMMON_SOURCES}
|
||||
${SILABS_EFR32MG13_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(silabs-efr32mg13-sdk
|
||||
PUBLIC
|
||||
silabs-mbedtls
|
||||
PRIVATE
|
||||
${silabs-librail}
|
||||
ot-config)
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# ==============================================================================
|
||||
# Series-level _SOURCES
|
||||
# ==============================================================================
|
||||
set(SILABS_EFR32MG1X_SOURCES
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_adc.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_crypto.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_leuart.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_aes.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_ecp.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/crypto_management.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c
|
||||
)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Platform-level _SOURCES
|
||||
# ==============================================================================
|
||||
set(SILABS_EFR32MG1_SOURCES
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG1P/Source/system_efr32mg1p.c
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG1P/Source/GCC/startup_efr32mg1p.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_alt/source/sl_entropy_adc.c
|
||||
${SILABS_EFR32MG1X_SOURCES}
|
||||
)
|
||||
|
||||
set(SILABS_EFR32MG12_SOURCES
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG12P/Source/system_efr32mg12p.c
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG12P/Source/GCC/startup_efr32mg12p.c
|
||||
${SILABS_EFR32MG1X_SOURCES}
|
||||
)
|
||||
|
||||
set(SILABS_EFR32MG13_SOURCES
|
||||
${SILABS_GSDK_DIR}/hardware/kit/common/drivers/mx25flash_spi.c
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG13P/Source/system_efr32mg13p.c
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG13P/Source/GCC/startup_efr32mg13p.c
|
||||
${SILABS_EFR32MG1X_SOURCES}
|
||||
)
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
include(${PROJECT_SOURCE_DIR}/third_party/silabs/cmake/efr32mg2x.cmake)
|
||||
|
||||
add_library(silabs-efr32mg21-sdk)
|
||||
|
||||
target_compile_definitions(silabs-efr32mg21-sdk
|
||||
PRIVATE
|
||||
${COMMON_FLAG}
|
||||
)
|
||||
|
||||
target_include_directories(silabs-efr32mg21-sdk
|
||||
PUBLIC
|
||||
${SILABS_COMMON_INCLUDES}
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG21/Include
|
||||
${SILABS_EFR32MG2X_INCLUDES}
|
||||
)
|
||||
|
||||
target_sources(silabs-efr32mg21-sdk
|
||||
PUBLIC
|
||||
${SILABS_EFR32MG21_SOURCES}
|
||||
PRIVATE
|
||||
${SILABS_GSDK_COMMON_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(silabs-efr32mg21-sdk
|
||||
PUBLIC
|
||||
silabs-mbedtls
|
||||
PRIVATE
|
||||
${silabs-librail}
|
||||
ot-config)
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# ==============================================================================
|
||||
# Series-level _SOURCES
|
||||
# ==============================================================================
|
||||
set(SILABS_EFR32MG2X_SOURCES
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_burtc.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_prs.c
|
||||
${SILABS_GSDK_DIR}/platform/emlib/src/em_se.c
|
||||
${SILABS_GSDK_DIR}/platform/service/sleeptimer/src/sl_sleeptimer_hal_burtc.c
|
||||
${SILABS_GSDK_DIR}/platform/service/sleeptimer/src/sl_sleeptimer_hal_prortc.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_alt/source/sl_se_management.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_cmac.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ecdsa_ecdh.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_ccm.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_builtin_keys.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_signature.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c
|
||||
${SILABS_GSDK_DIR}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c
|
||||
)
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# Platform-level _SOURCES
|
||||
# ==============================================================================
|
||||
set(SILABS_EFR32MG21_SOURCES
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG21/Source/system_efr32mg21.c
|
||||
${SILABS_GSDK_DIR}/platform/Device/SiliconLabs/EFR32MG21/Source/GCC/startup_efr32mg21.c
|
||||
${SILABS_EFR32MG2X_SOURCES}
|
||||
)
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# ==============================================================================
|
||||
# RAIL libs
|
||||
# ==============================================================================
|
||||
set(librail_release_dir "${SILABS_GSDK_DIR}/platform/radio/rail_lib/autogen/librail_release")
|
||||
file(GLOB rail_libs ${librail_release_dir}/*.a)
|
||||
|
||||
foreach(lib_file ${rail_libs})
|
||||
|
||||
# Parse lib name, stripping .a extension
|
||||
get_filename_component(lib_name ${lib_file} NAME_WE)
|
||||
set(imported_lib_name "silabs-${lib_name}")
|
||||
|
||||
# Add as an IMPORTED lib
|
||||
add_library(${imported_lib_name} STATIC IMPORTED)
|
||||
set_target_properties(${imported_lib_name}
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION "${lib_file}"
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES silabs-${PLATFORM_LOWERCASE}-sdk
|
||||
)
|
||||
|
||||
endforeach()
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# NVM3 libs
|
||||
# ==============================================================================
|
||||
set(libnvm3_release_dir "${SILABS_GSDK_DIR}/platform/emdrv/nvm3/lib")
|
||||
file(GLOB nvm3_libs ${libnvm3_release_dir}/*.a)
|
||||
|
||||
foreach(lib_file ${nvm3_libs})
|
||||
|
||||
# Parse lib name, stripping .a extension
|
||||
get_filename_component(lib_name ${lib_file} NAME_WE)
|
||||
set(imported_lib_name "silabs-${lib_name}")
|
||||
|
||||
# Add as an IMPORTED lib
|
||||
add_library(${imported_lib_name} STATIC IMPORTED)
|
||||
set_target_properties(${imported_lib_name}
|
||||
PROPERTIES
|
||||
IMPORTED_LOCATION "${lib_file}"
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES silabs-${PLATFORM_LOWERCASE}-sdk
|
||||
)
|
||||
|
||||
endforeach()
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user