You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.platformio/packages/framework-arduinoststm32/libraries/SrcWrapper/src/stm32/clock.c:135:7: error: a label can only be part of a statement and a declaration is not a statement
135 | uint32_t HSEState = RCC_HSE_ON;
| ^~~~~~~~
Edit Configuration.h
Find and set the following:
#define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V3_0
#define SERIAL_PORT 1
Edit platformio.ini
Find and set the following:
set default_envs = STM32G0B1RE_btt
Delete the .platformio folder in your home directory and restart vscode (forces a full platformio and framework reinstall to ensure you get the latest Arduino_Core_STM32)
Allow it to install and reload vscode as prompted, give it time to get all it needs.
Click Plafromio: Build button on bottom launch bar. (or use pio run)
I have attached a full log of a build buildlog.txt
/home/username/.platformio/packages/framework-arduinoststm32/libraries/SrcWrapper/src/stm32/clock.c: In function 'enableClock':
/home/username/.platformio/packages/framework-arduinoststm32/libraries/SrcWrapper/src/stm32/clock.c:135:7: error: a label can only be part of a statement and a declaration is not a statement
135 | uint32_t HSEState = RCC_HSE_ON;
| ^~~~~~~~
OK. I've reproduced by downgrading my arm-none-eab-gcc version.
You got the issue because PIO uses arm-non-eabi-gcc 10.3.1 while in Arduino we used 12.2.1.
I saw that a request was made to update it: platformio/platform-ststm32#720
Seems it brings some issues with gdb anyway it seems you can update it manually.
8 commit comments
ellensp commentedon Sep 8, 2023
@fpistm
This breaks things
Using braces fixes it.
fpistm commentedon Sep 9, 2023
Seems strange as ci does not have error and I've tested with my nucleo WL55JC to use HSE for RTC.
Seems linked to pio. Maybe gcc version?
ellensp commentedon Sep 9, 2023
Not sure what is going on, It may be related to C standard being used... but has been confirmed by several Marlin firmware users
Here is how to reproduce it using Marlin firmware on vscode/platformio (sorry I don't have a small eg to trigger it)
git clone https://github.com/MarlinFirmware/Marlin.git
in vscode open up the directory with platformio.ini file in it so vscode knows this is a platformio project
Edit Configuration.h
Find and set the following:
#define MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V3_0
#define SERIAL_PORT 1
Edit platformio.ini
Find and set the following:
set default_envs = STM32G0B1RE_btt
Delete the .platformio folder in your home directory and restart vscode (forces a full platformio and framework reinstall to ensure you get the latest Arduino_Core_STM32)
Allow it to install and reload vscode as prompted, give it time to get all it needs.
Click Plafromio: Build button on bottom launch bar. (or use pio run)
I have attached a full log of a build
buildlog.txt
fpistm commentedon Sep 9, 2023
Unfortunately I don't use pio and will not test this. Weird thing is I could not reproduce on my side with Arduino IDE. Will try on monday.
fpistm commentedon Sep 9, 2023
@ellensp I think it is linked to std 11. With arduino we use 17. If you can try to change it to confirm?
ellensp commentedon Sep 9, 2023
Sadly using -std=gnu17 made no difference
fpistm commentedon Sep 9, 2023
Hum... weird... I will try to understand.
fpistm commentedon Sep 11, 2023
OK. I've reproduced by downgrading my arm-none-eab-gcc version.
You got the issue because PIO uses arm-non-eabi-gcc 10.3.1 while in Arduino we used 12.2.1.
I saw that a request was made to update it:
platformio/platform-ststm32#720
Seems it brings some issues with gdb anyway it seems you can update it manually.