Open maxgerhardt opened 3 years ago
I am not familiar with platformio/mbed build system, but it seems that files:
.platformio
packages
framework-mbed
targets
TARGET_Silicon_Labs
TARGET_SL_RAIL
efr32-rf-driver
rail
TARGET_EFR32_12
librail_efr32xg12_release.ar
librail_efr32xg12_release.a
should be rearranged as:
.platformio
packages
framework-mbed
targets
TARGET_Silicon_Labs
TARGET_SL_RAIL
efr32-rf-driver
rail
TARGET_EFR32_12
TOOLCHAIN_ARM
librail_efr32xg12_release.ar
TOOLCHAIN_GCC_ARM
librail_efr32xg12_release.a
And this might be mbed, not platformio issue.
Reported at mbed-os repository: https://github.com/ARMmbed/mbed-os/issues/14958
See https://community.platformio.org/t/silicon-labs-efm32-linker-fail-on-thunderboard-sense-2/18831.
When the example https://github.com/platformio/platform-siliconlabsefm32/tree/develop/examples/mbed-rtos-blink-baremetal
with the
platformio.ini
is compiled, one gets
The problem is that the buld system tries wants to link two libraries
And it blindly wants to link all
*.ar
and*.a
files inC:\Users\<user>\.platformio\packages\framework-mbed\targets\TARGET_Silicon_Labs\TARGET_SL_RAIL\efr32-rf-driver\rail\TARGET_EFR32_12
.But the
.ar
file is only for ARM compiler toolchain and not GCC-ARM, so the.ar
file shouldn't be included in the first place.The CMakeLists.txt logic doesn't seem to be executed at all to prevent this in
C:\Users\<user>\.platformio\packages\framework-mbed\targets\TARGET_Silicon_Labs\TARGET_SL_RAIL\CMakeLists.txt
.it makes no difference if I also comment out the
target_link_libraries
line.A temporary solution is to rename the
librail_efr32xg12_release.ar
file to something not ending in.ar
or.a
, e.g.librail_efr32xg12_release.ar.backup
, then linking works.