stm32duino / Arduino_Core_STM32

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

It's a unknown error when I compile any example of STM32duino_Low_Power with LTO #2450

Closed sunnyguhz closed 4 months ago

sunnyguhz commented 4 months ago

Describe the bug When I compile any example of STM32duino_Low_Power with LTO, it's has a unknown error to make it stop. And it's no problem without LTO.

To Reproduce

#include "STM32LowPower.h"

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  // Configure low power
  LowPower.begin();
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  LowPower.deepSleep(1000);
  digitalWrite(LED_BUILTIN, LOW);
  LowPower.deepSleep(1000);
}

Screenshots lto1.exe: fatal error: open C:\Users\Sunnygu\AppData\Local\Temp\arduino\sketches\6AF94743C3DEA696995DF90E3A49899D\core\generic_clockĬ��.c.o failed: Unknown error compilation terminated. lto-wrapper.exe: fatal error: C:\Users\Sunnygu\AppData\Local\Arduino15\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\13.2.1-1.1/bin/arm-none-eabi-gcc returned 1 exit status compilation terminated. C:/Users/Sunnygu/AppData/Local/Arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: error: lto-wrapper failed collect2.exe: error: ld returned 1 exit status

Using library STM32duino Low Power at version 1.2.5 in folder: C:\Users\Sunnygu\Documents\Arduino\libraries\STM32duino_Low_Power Using library STM32duino RTC at version 1.4.0 in folder: C:\Users\Sunnygu\Documents\Arduino\libraries\STM32duino_RTC Using library SrcWrapper at version 1.0.1 in folder: C:\Users\Sunnygu\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.8.0\libraries\SrcWrapper exit status 1

Compilation error: exit status 1

Desktop (please complete the following information): OS: [Windows10 22H2] Arduino IDE version: [2.3.2] STM32 core version: [2.8.0] Tools menu settings if not the default: [No Serial] Upload method: [SWD]

Board (please complete the following information): FQBN: STMicroelectronics:stm32:GenG0:pnum=GENERIC_G030C8TX,xserial=disabled