FAQ: Linker errors ("multiple definition") when building AXM0F343 examples with Onsemi IDE 3.4.0

Introduction
With the release of the latest ON Semiconductor IDE version 3.4.0.48, the ARM GCC Toolchain was updated from version 8 to version 10.

If you would like to use sample code from AXM0F343-1.3.0 CMSIS Pack (or earlier) with the latest ON Semiconductor IDE, some changes to the sample code project files are required. The required changes are the same as described in KB: Updating RSL10 Projects from SDK 3.4 to SDK 3.5

Problem
When building example projects from the ONSemiconductor.AXM0F343.1.3.0 pack using the latest ON Semiconductor IDE V.3.4.0.48, linker errors like the one below appear:

c:/program files (x86)/on semiconductor/ide_v3.4.0.48/arm_tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: ./COMMON/misc.o:C:/Users/zbh/ON_Semiconductor/PACK\ONSemiconductor\AXM0F343\1.3.0/drivers/scheduler/include/drv_scheduler.h:103: multiple definition of 'wtimer_pending'; ./COMMON/easyax5043.o:C:/Users/zbh/ON_Semiconductor/PACK\ONSemiconductor\AXM0F343\1.3.0/drivers/scheduler/include/drv_scheduler.h:103: first defined here

Solution
The fastest fix is to revert your Onsemi IDE to the last working version V.3.2.3.10. You can download it at Software: AXM0F343 (onsemi.com)

Another option is to follow these steps:

  • Right click on the project and go to PropertiesC/C++ BuildSettingsTool SettingsCross ARM C LinkerMiscellaneous and uncheck the checkboxes Use newlib -nano (–specs=nano.specs) and Do not use syscalls (–specs=nosys.specs) .

  • In the same PropertiesC/C++ BuildSettingsTool SettingsCross ARM C LinkerMiscellaneousOther linker flags , add “-z muldefs --specs=nosys.specs”
    image

  • Go to PropertiesC/C++ BuildSettingsOptimizationOther Optimization flags , add “-fcommon”, and click Apply and Close .

After rebuilding the index and cleaning the project, you will be able to compile and flash with to more errors.

1 Like