Skip to content

Commit d14cc1e

Browse files
authored
Integrate mbedtls to nrf5 and efr32 platform targets (#425)
* Integrate mbedtls to nrf5 and efr32 platform targets * remove mbedtls from efr32 app makefile
1 parent d82c6dd commit d14cc1e

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

config/efr32/efr32-app.mk

+4-11
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ STD_INC_DIRS += \
156156
$(EFR32_SDK_ROOT)/platform/radio/rail_lib/plugin/pa-conversions \
157157
$(EFR32_SDK_ROOT)/util/third_party/segger/systemview/SEGGER \
158158
$(EFR32_SDK_ROOT)/util/third_party/segger/systemview/Config/ \
159-
$(EFR32_SDK_ROOT)/util/plugin/plugin-common/fem-control \
160-
$(EFR32_SDK_ROOT)/util/third_party/mbedtls/sl_crypto/include
159+
$(EFR32_SDK_ROOT)/util/plugin/plugin-common/fem-control
161160

162161
ifeq ($(EFR32FAMILY), efr32mg12)
163162
STD_INC_DIRS += \
@@ -213,10 +212,6 @@ STD_CFLAGS = \
213212
-fshort-enums \
214213
--specs=nosys.specs
215214

216-
MBEDTLS_FLAGS = \
217-
-DMBEDTLS_CONFIG_FILE='"mbedtls-config.h"' \
218-
-DMBEDTLS_USER_CONFIG_FILE='"efr32-chip-mbedtls-config.h"'
219-
220215
STD_CXXFLAGS = \
221216
-fno-rtti \
222217
-fno-exceptions \
@@ -256,14 +251,12 @@ STD_LIBS = \
256251
ifeq ($(EFR32FAMILY), efr32mg12)
257252
STD_LIBS += \
258253
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG12P/GCC/libbluetooth.a \
259-
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG12P/GCC/libmbedtls.a \
260254
$(EFR32_SDK_ROOT)/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg12_gcc_release.a \
261255
$(EFR32_SDK_ROOT)/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a
262256
else
263257
ifeq ($(EFR32FAMILY), efr32mg21)
264258
STD_LIBS += \
265259
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG21/GCC/libbluetooth.a \
266-
$(EFR32_SDK_ROOT)/protocol/bluetooth/lib/EFR32MG21/GCC/libmbedtls.a \
267260
$(EFR32_SDK_ROOT)/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg21_gcc_release.a \
268261
$(EFR32_SDK_ROOT)/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a
269262
endif
@@ -469,7 +462,7 @@ define CCRule
469462
$(call DepFileName,$1) : ;
470463
$(call ObjFileName,$1): $1 $(call DepFileName,$1) | $(OBJS_DIR) $(DEPS_DIR) $(STD_COMPILE_PREREQUISITES)
471464
@echo "$$(HDR_PREFIX)CC $1"
472-
$(NO_ECHO) $$(CCACHE) $$(CC) -c $$(STD_CFLAGS) $$(CFLAGS) $$(DEBUG_FLAGS) $$(OPT_FLAGS) $$(MBEDTLS_FLAGS) $$(DEFINE_FLAGS) $$(INC_FLAGS) -MT $$@ -MMD -MP -MF $(call DepFileName,$1).tmp -o $$@ $1
465+
$(NO_ECHO) $$(CCACHE) $$(CC) -c $$(STD_CFLAGS) $$(CFLAGS) $$(DEBUG_FLAGS) $$(OPT_FLAGS) $$(DEFINE_FLAGS) $$(INC_FLAGS) -MT $$@ -MMD -MP -MF $(call DepFileName,$1).tmp -o $$@ $1
473466
$(NO_ECHO)mv $(call DepFileName,$1).tmp $(call DepFileName,$1)
474467
$(NL)
475468
endef
@@ -479,7 +472,7 @@ define CXXRule
479472
$(call DepFileName,$1) : ;
480473
$(call ObjFileName,$1): $1 $(call DepFileName,$1) | $(OBJS_DIR) $(DEPS_DIR) $(STD_COMPILE_PREREQUISITES)
481474
@echo "$$(HDR_PREFIX)CXX $1"
482-
$(NO_ECHO) $$(CCACHE) $$(CXX) -c $$(AUTODEP_FLAGS) $$(STD_CFLAGS) $$(STD_CXXFLAGS) $$(CFLAGS) $$(CXXFLAGS) $$(DEBUG_FLAGS) $$(OPT_FLAGS) $$(MBEDTLS_FLAGS) $$(DEFINE_FLAGS) $$(INC_FLAGS) -MT $$@ -MMD -MP -MF $(call DepFileName,$1).tmp -o $$@ $1
475+
$(NO_ECHO) $$(CCACHE) $$(CXX) -c $$(AUTODEP_FLAGS) $$(STD_CFLAGS) $$(STD_CXXFLAGS) $$(CFLAGS) $$(CXXFLAGS) $$(DEBUG_FLAGS) $$(OPT_FLAGS) $$(DEFINE_FLAGS) $$(INC_FLAGS) -MT $$@ -MMD -MP -MF $(call DepFileName,$1).tmp -o $$@ $1
483476
$(NO_ECHO)mv $(call DepFileName,$1).tmp $(call DepFileName,$1)
484477
$(NL)
485478
endef
@@ -488,7 +481,7 @@ endef
488481
define ASRule
489482
$(call ObjFileName,$1): $1 | $(OBJS_DIR) $(STD_COMPILE_PREREQUISITES)
490483
@echo "$$(HDR_PREFIX)AS $1"
491-
$(NO_ECHO)$$(CC) -c -x assembler-with-cpp $$(STD_ASFLAGS) $$(ASFLAGS) $$(DEBUG_FLAGS) $$(OPT_FLAGS) $$(MBEDTLS_FLAGS) $$(DEFINE_FLAGS) $$(INC_FLAGS) -o $$@ $1
484+
$(NO_ECHO)$$(CC) -c -x assembler-with-cpp $$(STD_ASFLAGS) $$(ASFLAGS) $$(DEBUG_FLAGS) $$(OPT_FLAGS) $$(DEFINE_FLAGS) $$(INC_FLAGS) -o $$@ $1
492485
$(NL)
493486
endef
494487

config/efr32/efr32-chip.mk

+5-2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ CHIP_CONFIGURE_OPTIONS = \
114114
--disable-docs \
115115
--disable-java \
116116
--disable-device-manager \
117+
--with-mbedtls=internal
117118

118119
# Enable / disable optimization.
119120
ifeq ($(OPT),1)
@@ -156,7 +157,8 @@ STD_LIBS += \
156157
-lInetLayer \
157158
-lnlfaultinjection \
158159
-lSystemLayer \
159-
-llwip
160+
-llwip \
161+
-lmbedtls
160162

161163
# Add the appropriate CHIP target as a prerequisite to all application
162164
# compilation targets to ensure that CHIP gets built and its header
@@ -170,7 +172,8 @@ STD_LINK_PREREQUISITES += \
170172
$(CHIP_OUTPUT_DIR)/lib/libInetLayer.a \
171173
$(CHIP_OUTPUT_DIR)/lib/libnlfaultinjection.a \
172174
$(CHIP_OUTPUT_DIR)/lib/libSystemLayer.a \
173-
$(CHIP_OUTPUT_DIR)/lib/liblwip.a
175+
$(CHIP_OUTPUT_DIR)/lib/liblwip.a \
176+
$(CHIP_OUTPUT_DIR)/lib/libmbedtls.a
174177

175178

176179
# ==================================================

config/nrf5/nrf5-chip.mk

+6-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ CHIP_CONFIGURE_OPTIONS = \
112112
--disable-tools \
113113
--disable-docs \
114114
--disable-java \
115-
--disable-device-manager
115+
--disable-device-manager \
116+
--with-mbedtls=internal
116117

117118
# Enable / disable optimization.
118119
ifeq ($(OPT),1)
@@ -147,7 +148,8 @@ STD_LIBS += \
147148
-lInetLayer \
148149
-lnlfaultinjection \
149150
-lSystemLayer \
150-
-llwip
151+
-llwip \
152+
-lmbedtls
151153

152154
# Add the appropriate CHIP target as a prerequisite to all application
153155
# compilation targets to ensure that CHIP gets built and its header
@@ -161,7 +163,8 @@ STD_LINK_PREREQUISITES += \
161163
$(CHIP_OUTPUT_DIR)/lib/libInetLayer.a \
162164
$(CHIP_OUTPUT_DIR)/lib/libnlfaultinjection.a \
163165
$(CHIP_OUTPUT_DIR)/lib/libSystemLayer.a \
164-
$(CHIP_OUTPUT_DIR)/lib/liblwip.a
166+
$(CHIP_OUTPUT_DIR)/lib/liblwip.a \
167+
$(CHIP_OUTPUT_DIR)/lib/libmbedtls.a
165168

166169

167170
# ==================================================

0 commit comments

Comments
 (0)