Hi all,
first time using PlatformIO, so forgive me for any obvious overlook.
My setup:
Ubuntu 20.04
VS Code 1.67.2
PIO Core 6.0.2
Board STM32H747XI-DISCO
I am trying to compile the stm32cube-hal-blinky
example.
My target:
[env:disco_h747xi]
platform = ststm32
framework = stm32cube
board = disco_h747xi
Running pio run
I get:
Processing disco_h747xi (platform: ststm32; board: disco_h747xi; framework: stm32cube)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/disco_h747xi.html
PLATFORM: ST STM32 (15.4.0) > STM32H747I-DISCO
HARDWARE: STM32H747XIH6 400MHz, 512KB RAM, 2MB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
- framework-stm32cubeh7 @ 1.9.0
- tool-ldscripts-ststm32 @ 0.2.0
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 55 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_adc.o
In file included from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h:136:0,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h:30,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc.h:29,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_conf.h:246,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h:30,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c:36:
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:244:2: error: #error Please #define CORE_CM4 or CORE_CM7
#error Please #define CORE_CM4 or CORE_CM7
^~~~~
In file included from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:256:0,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h:136,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h:30,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc.h:29,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_conf.h:246,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h:30,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c:36:
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/system_stm32h7xx.h:58:8: error: unknown type name 'uint32_t'
extern uint32_t SystemCoreClock; /*!< System Domain1 Clock Frequency */
^~~~~~~~
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/system_stm32h7xx.h:59:8: error: unknown type name 'uint32_t'
extern uint32_t SystemD2Clock; /*!< System Domain2 Clock Frequency */
^~~~~~~~
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/system_stm32h7xx.h:60:15: error: unknown type name 'uint8_t'
extern const uint8_t D1CorePrescTable[16] ; /*!< D1CorePrescTable prescalers table values */
^~~~~~~
In file included from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h:136:0,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_def.h:30,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rcc.h:29,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_conf.h:246,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h:30,
from /home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c:36:
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:269:3: error: unknown type name '__IO'
__IO uint32_t ISR; /*!< ADC Interrupt and Status Register, Address offset: 0x00 */
^~~~
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:269:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'ISR'
__IO uint32_t ISR; /*!< ADC Interrupt and Status Register, Address offset: 0x00 */
^~~
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:316:1: error: unknown type name '__IO'
__IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1/3 base address + 0x300 */
^~~~
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:316:15: error: expected ':', ',', ';', '}' or '__attribute__' before 'CSR'
__IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1/3 base address + 0x300 */
^~~
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:330:3: error: unknown type name '__IO'
__IO uint32_t CTR; /*!< ART accelerator - control register */
^~~~
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h747xx.h:330:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'CTR'
__IO uint32_t CTR; /*!< ART accelerator - control register */
… and a whole lot of other errors like this.
Changing my target to (for example):
[env:nucleo_f072rb]
platform = ststm32
framework = stm32cube
board = nucleo_f072rb
build_flags = -DF0
It finishes witout errors:
Processing nucleo_f072rb (platform: ststm32; framework: stm32cube; board: nucleo_f072rb)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_f072rb.html
PLATFORM: ST STM32 (15.4.0) > ST Nucleo F072RB
HARDWARE: STM32F072RBT6 48MHz, 16KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
- framework-stm32cubef0 @ 1.11.3
- tool-ldscripts-ststm32 @ 0.2.0
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 18 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_adc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_adc_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_can.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_cec.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_comp.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_cortex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_crc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_crc_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_dac.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_dac_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_dma.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_exti.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_flash.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_flash_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_gpio.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_i2c.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_i2c_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_i2s.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_irda.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_iwdg.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_pcd.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_pcd_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_pwr.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_pwr_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_rcc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_rcc_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_rtc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_rtc_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_smartcard.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_smartcard_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_smbus.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_spi.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_spi_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_tim.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_tim_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_tsc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_uart.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_uart_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_usart.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_usart_ex.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_hal_wwdg.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_adc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_comp.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_crc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_crs.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_dac.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_dma.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_exti.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_gpio.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_i2c.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_pwr.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_rcc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_rtc.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_spi.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_tim.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_usart.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_usb.o
Compiling .pio/build/nucleo_f072rb/FrameworkHALDriver/Src/stm32f0xx_ll_utils.o
Compiling .pio/build/nucleo_f072rb/src/main.o
Compiling .pio/build/nucleo_f072rb/FrameworkCMSISDevice/gcc/startup_stm32f072xb.o
Compiling .pio/build/nucleo_f072rb/FrameworkCMSISDevice/system_stm32f0xx.o
Archiving .pio/build/nucleo_f072rb/libFrameworkCMSISDevice.a
Indexing .pio/build/nucleo_f072rb/libFrameworkCMSISDevice.a
Linking .pio/build/nucleo_f072rb/firmware.elf
Checking size .pio/build/nucleo_f072rb/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 0.3% (used 44 bytes from 16384 bytes)
Flash: [ ] 1.0% (used 1364 bytes from 131072 bytes)
Building .pio/build/nucleo_f072rb/firmware.bin
========================= [SUCCESS] Took 1.93 seconds =========================
I think I am missing something in my setup.
Any hint?