stm32duino / Arduino_Core_STM32

STM32 core support for Arduino
https://github.com/stm32duino/Arduino_Core_STM32/wiki
Other
2.81k stars 967 forks source link

STM32F072 link error undefined reference to `CONCATS' #1613

Closed Joyhwj closed 2 years ago

Joyhwj commented 2 years ago

hello, I compile the code first with the option optimize smallest and everything is ok, but after I changed to optimize smallest LTO,then comes a link errorr, and then I change back to optimize smallest ,the error still there , can i know what happend about this?

"C:\Users\hongweijiang\AppData\Local\Arduino15\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\10.3.1-2.3/bin/arm-none-eabi-gcc" -mcpu=cortex-m0 -mthumb -Os --specs=nano.specs -Wl,--defsym=LD_FLASH_OFFSET=0 -Wl,--defsym=LD_MAX_SIZE=65536 -Wl,--defsym=LD_MAX_DATA_SIZE=16384 -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common "-Wl,--default-script=C:\Users\hongweijiang\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.2.0\variants\STM32F0xx\F072C8(T-U)_F072CB(T-U-Y)/ldscript.ld" "-Wl,--script=C:\Users\hongweijiang\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.2.0\system/ldscript.ld" "-Wl,-Map,C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041/can_stm32.ino.map" "-LC:\Users\hongweijiang\AppData\Local\Arduino15\packages\STMicroelectronics\tools\CMSIS\5.7.0/CMSIS/DSP/Lib/GCC/" -larm_cortexM0l_math -o "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041/can_stm32.ino.elf" "-LC:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041" -Wl,--start-group "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\sketch\SrcWrapper.cpp.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\sketch\can_stm32.ino.cpp.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\syscalls.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_adc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_adc_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_can.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_cec.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_comp.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_comp_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_cordic.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_cortex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_crc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_crc_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_cryp.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_cryp_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dac.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dac_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dcache.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dcmi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dcmi_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dfsdm.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dfsdm_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dma.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dma2d.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dma_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dsi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_dts.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_eth.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_eth_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_exti.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_fdcan.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_firewall.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_flash.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_flash_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_flash_ramfunc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_fmac.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_fmpi2c.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_fmpi2c_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_fmpsmbus.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_fmpsmbus_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_gfxmmu.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_gpio.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_gpio_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_gtzc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_hash.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_hash_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_hcd.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_hrtim.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_hsem.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_i2c.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_i2c_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_i2s.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_i2s_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_icache.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_ipcc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_irda.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_iwdg.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_jpeg.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_lcd.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_lptim.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_ltdc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_ltdc_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_mdf.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_mdios.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_mdma.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_mmc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_mmc_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_nand.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_nor.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_opamp.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_opamp_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_ospi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_otfdec.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_pccard.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_pcd.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_pcd_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_pka.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_pssi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_pwr.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_pwr_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_qspi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_ramcfg.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_ramecc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_rcc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_rcc_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_rng.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_rng_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_rtc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_rtc_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_sai_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_sd.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_sd_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_sdadc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_sdram.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_smartcard.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_smartcard_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_smbus.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_smbus_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_spdifrx.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_spi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_spi_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_sram.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_subghz.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_swpmi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_tim.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_tim_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_tsc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_uart.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_uart_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_usart.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_usart_ex.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\HAL\stm32yyxx_hal_wwdg.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_adc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_bdma.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_comp.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_cordic.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_crc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_crs.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_dac.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_delayblock.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_dlyb.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_dma.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_dma2d.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_exti.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_fmac.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_fmc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_fmpi2c.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_fsmc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_gpio.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_hrtim.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_i2c.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_icache.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_lpgpio.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_lptim.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_lpuart.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_mdma.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_opamp.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_pka.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_pwr.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_rcc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_rng.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_rtc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_sdmmc.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_spi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_swpmi.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_tim.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_ucpd.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_usart.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_usb.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\LL\stm32yyxx_ll_utils.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\PortNames.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\bootloader.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\clock.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\core_callback.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\dwt.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\hw_config.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\otp.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\pinmap.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\stm32_def.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\system_stm32yyxx.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\timer.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\uart.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\analog.cpp.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\libraries\SrcWrapper\stm32\interrupt.cpp.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\core\PeripheralPins.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\core\PeripheralPins_ELEKTOR_F072Cx.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\core\generic_clock.c.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\core\variant_ELEKTOR_F072Cx.cpp.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_build_236041\core\variant_generic.cpp.o" "C:\Users\HONGWE~1\AppData\Local\Temp\arduino_cache_636101\core\core_f7629fb73173f811d6ac54372b1f23b9.a" -lc -Wl,--end-group -lm -lgcc -lstdc++ c:/users/hongweijiang/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\HONGWE~1\AppData\Local\Temp\arduino_cache_636101\core\core_f7629fb73173f811d6ac54372b1f23b9.a(usbd_desc.c.o): in function USBD_Class_ProductStrDescriptor': usbd_desc.c:(.text.USBD_Class_ProductStrDescriptor+0x12): undefined reference toCONCATS' c:/users/hongweijiang/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\HONGWE~1\AppData\Local\Temp\arduino_cache_636101\core\core_f7629fb73173f811d6ac54372b1f23b9.a(usbd_desc.c.o): in function USBD_Class_ConfigStrDescriptor': usbd_desc.c:(.text.USBD_Class_ConfigStrDescriptor+0x8): undefined reference toCONCATS' c:/users/hongweijiang/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\HONGWE~1\AppData\Local\Temp\arduino_cache_636101\core\core_f7629fb73173f811d6ac54372b1f23b9.a(usbd_desc.c.o): in function USBD_Class_InterfaceStrDescriptor': usbd_desc.c:(.text.USBD_Class_InterfaceStrDescriptor+0x8): undefined reference toCONCATS' collect2.exe: error: ld returned 1 exit status

fpistm commented 2 years ago

Hi @Joyhwj

I guess it is linked to the Arduino cache. You probably build a first time with the -Os then build with -Os + LTO. I've build a sketch and have no issue on a fresh Arduino IDE start.

Anyway, as mentioned in this issue https://github.com/stm32duino/Arduino_Core_STM32/issues/1076: https://github.com/stm32duino/Arduino_Core_STM32/issues/1076#issuecomment-631512221

LTO is provided "as is", depending of the sketch it works or not. They are several issue linked to the toolchain and LTO.

and:

One other things which does not help is how Arduino handle compiled object and the cache.