@@ -23,8 +23,16 @@ set(BLOBS_DIR ${ZEPHYR_HAL_SILABS_MODULE_DIR}/zephyr/blobs/simplicity_sdk)
2323# respectively.
2424string (TOUPPER ${CONFIG_SOC_SERIES} SILABS_DEVICE_FAMILY)
2525
26- # Get SoC series number, i.e. translate e.g. efr32bg22 -> 22
27- string (SUBSTRING ${CONFIG_SOC_SERIES} 7 2 SILABS_DEVICE_FAMILY_NUMBER)
26+ # Get SoC series number, i.e. translate efr32bg22 -> 22, mgm240p -> 24, simg301 -> 301
27+ if (CONFIG_SOC_SERIES MATCHES "^ef[rm]32" )
28+ string (SUBSTRING ${CONFIG_SOC_SERIES} 7 2 SILABS_DEVICE_FAMILY_NUMBER)
29+ elseif (CONFIG_SOC_SERIES MATCHES "^si" )
30+ string (SUBSTRING ${CONFIG_SOC_SERIES} 4 3 SILABS_DEVICE_FAMILY_NUMBER)
31+ elseif (CONFIG_SOC_SERIES MATCHES "^.gm" )
32+ string (SUBSTRING ${CONFIG_SOC_SERIES} 3 2 SILABS_DEVICE_FAMILY_NUMBER)
33+ else ()
34+ message (FATAL_ERROR "unknown part" )
35+ endif ()
2836
2937set (SILABS_DEVICE_PART_NUMBER ${CONFIG_SOC_PART_NUMBER} )
3038
@@ -88,11 +96,20 @@ if(CONFIG_SOC_GECKO_HAS_RADIO)
8896
8997 if (CONFIG_SOC_GECKO_USE_RAIL)
9098 # rail
91- zephyr_library_sources(${RADIO_DIR} /rail_lib/plugin/pa-conversions/pa_curves_efr32.c)
99+ # PA curve for the modules comes from their config archive - omit the compilation of the SoC curves on modules
100+ if (NOT CONFIG_SILABS_DEVICE_IS_MODULE)
101+ zephyr_library_sources(${RADIO_DIR} /rail_lib/plugin/pa-conversions/pa_curves_efr32.c)
102+ endif ()
92103 zephyr_library_sources(${RADIO_DIR} /rail_lib/plugin/pa-conversions/pa_conversions_efr32.c)
93104
94- # prebuilt libs
95- add_prebuilt_library(librail platform/radio/rail_lib/autogen/librail_release/librail_efr32xg${SILABS_DEVICE_FAMILY_NUMBER} _gcc_release.a)
105+ if (CONFIG_SILABS_DEVICE_IS_MODULE)
106+ # RAIL lib and config for modules
107+ add_prebuilt_library(librail platform/radio/rail_lib/autogen/librail_release/librail_module_efr32xg${SILABS_DEVICE_FAMILY_NUMBER} _gcc_release.a)
108+ add_prebuilt_library(librail_config platform/radio/rail_lib/autogen/librail_release/librail_config_${CONFIG_SOC} _gcc.a)
109+ else ()
110+ # generic RAIL lib for SoCs
111+ add_prebuilt_library(librail platform/radio/rail_lib/autogen/librail_release/librail_efr32xg${SILABS_DEVICE_FAMILY_NUMBER} _gcc_release.a)
112+ endif ()
96113
97114 zephyr_include_directories_ifdef(CONFIG_SOC_GECKO_CUSTOM_RADIO_PHY
98115 ${RADIO_DIR} /rail_lib/protocol/ble
0 commit comments