Skip to content

Commit b0852d9

Browse files
committed
modules: hal_silabs: Fix extraction of family number
Family number was not correctly extracted from module OPNs. Signed-off-by: Aksel Skauge Mellbye <[email protected]>
1 parent d08ca7f commit b0852d9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/hal_silabs/simplicity_sdk/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
set(SECURITY_DIR ${ZEPHYR_HAL_SILABS_MODULE_DIR}/simplicity_sdk/platform/security)
55
set(MBEDTLS_DIR ${ZEPHYR_MBEDTLS_MODULE_DIR})
66

7-
# Get SoC series number, i.e. translate e.g. efr32bg22 -> 22
8-
string(SUBSTRING ${CONFIG_SOC_SERIES} 4 3 SILABS_DEVICE_FAMILY_NUMBER)
9-
if(SILABS_DEVICE_FAMILY_NUMBER MATCHES "2.*")
7+
# Get SoC series number, i.e. translate efr32bg22 -> 22, mgm240p -> 24, simg301 -> 301
8+
if(CONFIG_SOC_SERIES MATCHES "^ef[rm]32")
109
string(SUBSTRING ${CONFIG_SOC_SERIES} 7 2 SILABS_DEVICE_FAMILY_NUMBER)
10+
elseif(CONFIG_SOC_SERIES MATCHES "^si")
11+
string(SUBSTRING ${CONFIG_SOC_SERIES} 4 3 SILABS_DEVICE_FAMILY_NUMBER)
12+
elseif(CONFIG_SOC_SERIES MATCHES "^.gm")
13+
string(SUBSTRING ${CONFIG_SOC_SERIES} 3 2 SILABS_DEVICE_FAMILY_NUMBER)
14+
else()
15+
message(FATAL_ERROR "unknown part")
1116
endif()
1217

1318
zephyr_include_directories(

0 commit comments

Comments
 (0)