Diego
June 13, 2021, 1:24am
1
Hi, both my configurations won’t compile any example for the daisy seed under arduino:
Fedora 34, Arduino 1.8.13
2 Windows 10, Arduino 1.8.15
In both configurations I can compile/upload any basic sketch but all of the examples throw this error:
collect2: error: ld returned 1 exit status
Compiler complains about multiple definitions in the libraries stm32yyxx_hal_sai.c.o from two different locations, one on the daisyduino library folder and the other on the STMicroelectronics/tools from the boards manager.
What did I do wrong?
Diego
June 13, 2021, 5:48pm
2
Found out there may be a conflict between daisyDuino library and the STM32Duino core v2.0
opened 09:52PM - 22 Apr 21 UTC
bug
Linker error due to redefinition of the HAL files.
We may be able to simply … remove the HAL SAI files from the utily folder, as those are the files that are triggering the issue.
The errors:
```
"C:\\Users\\shensley\\AppData\\Local\\Temp\\arduino_build_432111\\core\\core.a" -lc -Wl,--end-group -lm -lgcc -lstdc++
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Init':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Init+0x0): multiple definition of `HAL_SAI_Init'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Init+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_InitProtocol':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_InitProtocol+0x0): multiple definition of `HAL_SAI_InitProtocol'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_InitProtocol+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_DeInit':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_DeInit+0x0): multiple definition of `HAL_SAI_DeInit'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_DeInit+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Transmit':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Transmit+0x0): multiple definition of `HAL_SAI_Transmit'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Transmit+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Receive':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Receive+0x0): multiple definition of `HAL_SAI_Receive'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Receive+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Transmit_IT':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Transmit_IT+0x0): multiple definition of `HAL_SAI_Transmit_IT'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Transmit_IT+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Receive_IT':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Receive_IT+0x0): multiple definition of `HAL_SAI_Receive_IT'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Receive_IT+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_DMAPause':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_DMAPause+0x0): multiple definition of `HAL_SAI_DMAPause'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_DMAPause+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_DMAResume':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_DMAResume+0x0): multiple definition of `HAL_SAI_DMAResume'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_DMAResume+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_DMAStop':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_DMAStop+0x0): multiple definition of `HAL_SAI_DMAStop'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_DMAStop+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Abort':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Abort+0x0): multiple definition of `HAL_SAI_Abort'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Abort+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Transmit_DMA':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Transmit_DMA+0x0): multiple definition of `HAL_SAI_Transmit_DMA'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Transmit_DMA+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_Receive_DMA':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_Receive_DMA+0x0): multiple definition of `HAL_SAI_Receive_DMA'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_Receive_DMA+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_EnableTxMuteMode':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_EnableTxMuteMode+0x0): multiple definition of `HAL_SAI_EnableTxMuteMode'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_EnableTxMuteMode+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_DisableTxMuteMode':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_DisableTxMuteMode+0x0): multiple definition of `HAL_SAI_DisableTxMuteMode'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_DisableTxMuteMode+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_EnableRxMuteMode':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_EnableRxMuteMode+0x0): multiple definition of `HAL_SAI_EnableRxMuteMode'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_EnableRxMuteMode+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_DisableRxMuteMode':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_DisableRxMuteMode+0x0): multiple definition of `HAL_SAI_DisableRxMuteMode'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_DisableRxMuteMode+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_IRQHandler':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_IRQHandler+0x0): multiple definition of `HAL_SAI_IRQHandler'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_IRQHandler+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_GetState':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_GetState+0x0): multiple definition of `HAL_SAI_GetState'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_GetState+0x0): first defined here
c:/users/shensley/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o: in function `HAL_SAI_GetError':
stm32yyxx_hal_sai.c:(.text.HAL_SAI_GetError+0x0): multiple definition of `HAL_SAI_GetError'; C:\Users\shensley\AppData\Local\Temp\arduino_build_432111\libraries\DaisyDuino\utility\stm32h7xx_hal_sai.c.o:stm32h7xx_hal_sai.c:(.text.HAL_SAI_GetError+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library MIDI_Library at version 5.0.2 in folder: C:\Users\shensley\Documents\Arduino\libraries\MIDI_Library
Using library DaisyDuino at version 1.3.0 in folder: C:\Users\shensley\Documents\Arduino\libraries\DaisyDuino
Using library Wire at version 1.0 in folder: C:\Users\shensley\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.0.0\libraries\Wire
Using library SrcWrapper at version 1.0.1 in folder: C:\Users\shensley\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.0.0\libraries\SrcWrapper
exit status 1
Error compiling for board Generic STM32H7 Series.
```
But I haven’t find out how to downgrade to v1.9.
Any hint?
Diego
June 13, 2021, 6:14pm
3
Finally managed to downgrade and examples compile now.
To downgrade de STM32 core for arduino use this “deprecated” index on the additional boards manager under arduino preferences:
https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json
and then from the boards manager remove STM32 v2.0 and install v1.9
We just released v1.4 of DaisyDuino, which resolves the issues with stm32duino v2.0
As soon as it’s available in the Library Manager, you should be able to update both DaisyDuino, and the stm32duino board manager!
Diego
July 7, 2021, 7:49pm
5
@shensley I can confirm, daisyduino v1.4 to work just fine with stmduino v.2.0 under Fedora 34.
Thank you.
2 Likes