Closed
Description
Describe the bug
See also https://www.stm32duino.com/viewtopic.php?p=8039#p8039
When compiling code for the Nucleo STM32WL55JC1 with the Arduino Core STM32 v2.0.0, platformio automatically adds the -mfpu=fpv4-sp-d16", "-mfloat-abi=hard
options because the mcu is defined as cortex-m4. This results in an error because the CMSIS driver defines __FPU_PRESENT=0
.
To Reproduce
- Use this branch (WIP) for platformio which adds support for the STM32WL55 board using the arduino framework: https://github.com/dolfandringa/platform-ststm32/tree/feature/stm32duino_stm32wl55_support
- Make a new project using the platformio.ini below. No need for any code, just use an empty main.cpp like below.
- run
pio run
to compile the code.
platformio.ini
[env:stm32wl55]
platform = ststm32
board = nucleo_wl55jc
framework = arduino
src/main.cpp
#include <Arduino.h>
void setup() {
}
void loop() {
}
this results in the following error:
In file included from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wl55xx.h:210,
from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32WLxx/Include/stm32wlxx.h:99,
from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/stm32_def.h:56,
from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/clock.h:19,
from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h:23,
from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:38,
from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36,
from /home/dolfandringa/.platformio/packages/framework-arduinoststm32/variants/STM32WLxx/WL54JCI_WL55JCI_WLE4J(8-B-C)I_WLE5J(8-B-C)I/PeripheralPins.c:21:
/home/dolfandringa/.platformio/packages/framework-cmsis/CMSIS/Core/Include/core_cm4.h:105:8: error: #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
105 | #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Expected behavior
The code should compile correctly.
Desktop (please complete the following information):
- OS: Fedora 34 linux
- Arduino IDE version: latest platformio master branch with fork in https://github.com/dolfandringa/platform-ststm32/tree/feature/stm32duino_stm32wl55_support
- STM32 core version: master branch from git/2.0.0
Board (please complete the following information):
- Name: Nucleo WL55JC1