Skip to content

STM32WL platformio options for cortex-m4 turn on fpu, but STM32WL55 CMSIS driver defines __FPU_PRESENT=0 #1473

Closed
@dolfandringa

Description

@dolfandringa

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

  1. 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
  2. Make a new project using the platformio.ini below. No need for any code, just use an empty main.cpp like below.
  3. 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):

Board (please complete the following information):

  • Name: Nucleo WL55JC1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions