PlatformIO Community

STM32 Arduino Framework Error - Building not possible


I programmed and uploaded a few Sketches for an Nucleo F429ZI with the Arduino Framework. That all went well until recently. I am unable to compile/ build any sketch right now, if it’s about this board and Framework.
My Code for an Arduino Due builds and works just fine.
The Error is the following:

In file included from C:\Users\tidob\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\HAL\stm32yyxx_hal_tim.c:14:0:
C:\Users\tidob\.platformio\packages\framework-arduinoststm32\system\Drivers\STM32F4xx_HAL_Driver\Src/stm32f4xx_hal_tim.c:3158:26: error: expected ')' before '*' token
void  (TIM_HandleTypeDef *htim)
Compiling .pio\build\nucleo_f429zi\FrameworkArduino\stm32\HAL\stm32yyxx_hal_tim_ex.c.o

The Error refers to the stm32f4xx_hal_tim.c which i didn’t modify. Even if I check the function, i don’t see any syntax errors in it.

My platformio.ini and main.cpp:

platform = ststm32
board = nucleo_f429zi
; board_build.core = stm32
; board_build.variant = NUCLEO_F429ZI
framework = arduino
#include <Arduino.h>

void setup() {
  // put your setup code here, to run once:
  digitalWrite(D9, HIGH);

void loop() {
  // put your main code here, to run repeatedly:

I tried the board_build commands but i didn’t help. The main.cpp seems to be irreleveant. The error comes up, even when the main is empty like quoted.(It’s just one quote but two files of cause)

I hope anyone knows a fix or workaround. I don’t want to switch the IDE again since i really like platformio and it did work the last 2 months. Error occurred first the week before Christmas and i hoped there it would sort itself out if I wait a bit and update the frameworks. (It did not).
I already de- and reinstalled visual studio code and platformio as well.

Greetings, Yuba

Well this line should read

void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)

So this file did indeed get modified when the whole function name is missing. Maybe you used VSCOde’s cool “Rename Symbol” function which is a really dumb search-and-replace and killed some framework files.

Anyways to get back a good system I’d suggest to simply remove the folder C:\Users\tidob\.platformio\packages\framework-arduinoststm32\ from your computer. PIO will redownload a fresh framework again when the project is recompiled.

1 Like

That worked. Thank you :slight_smile: