STM32H747XI-DISCO (env:disco_h747xi) and stm32cube-hal-blinky can not build

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? :slight_smile:

The H7 has a Cortex-M4 and a Cortex-M7 core, you need to define which one to use. Have you tried adding

build_flags =
   -DCORE_CM7

to the platformio.ini?

Hi @maxgerhardt,
thanks! New log:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
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
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_adc_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_cec.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_comp.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_cordic.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_cortex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_crc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_crc_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_cryp.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_cryp_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dac.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dac_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dcmi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dfsdm.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dfsdm_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dma.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dma2d.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dma_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dsi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_dts.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_eth.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_eth_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_exti.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_fdcan.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_flash.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_flash_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_fmac.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_gfxmmu.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_gpio.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_hash.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_hash_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_hcd.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_hrtim.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_hsem.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_i2c.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_i2c_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_i2s.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_i2s_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_irda.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_iwdg.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_jpeg.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_lptim.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_ltdc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_ltdc_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_mdios.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_mdma.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_mmc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_mmc_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_nand.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_nor.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_opamp.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_opamp_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_ospi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_otfdec.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_pcd.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_pcd_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_pssi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_pwr.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_pwr_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_qspi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_ramecc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_rcc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_rcc_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_rng.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_rng_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_rtc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_rtc_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_sai.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_sai_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_sd.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_sd_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_sdram.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_smartcard.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_smartcard_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_smbus.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_spdifrx.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_spi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_spi_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_sram.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_swpmi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_tim.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_tim_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_uart.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_uart_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_usart.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_usart_ex.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_hal_wwdg.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_adc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_bdma.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_comp.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_cordic.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_crc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_crs.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_dac.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_delayblock.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_dma.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_dma2d.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_exti.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_fmac.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_fmc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_gpio.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_hrtim.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_i2c.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_lptim.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_lpuart.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_mdma.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_opamp.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_pwr.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_rcc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_rng.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_rtc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_sdmmc.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_spi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_swpmi.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_tim.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_usart.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_usb.o
Compiling .pio/build/disco_h747xi/FrameworkHALDriver/Src/stm32h7xx_ll_utils.o
Compiling .pio/build/disco_h747xi/src/main.o
Compiling .pio/build/disco_h747xi/FrameworkCMSISDevice/gcc/startup_stm32h747xx.o
src/main.c:20:2: error: #error "Unsupported STM32 Family"
 #error "Unsupported STM32 Family"
  ^~~~~
src/main.c: In function 'main':
src/main.c:29:3: warning: implicit declaration of function 'HAL_Init' [-Wimplicit-function-declaration]
   HAL_Init();
   ^~~~~~~~
src/main.c:25:48: warning: implicit declaration of function '__HAL_RCC_GPIOA_CLK_ENABLE'; did you mean 'LED_GPIO_CLK_ENABLE'? [-Wimplicit-function-declaration]
 #define LED_GPIO_CLK_ENABLE()                  __HAL_RCC_GPIOA_CLK_ENABLE()
                                                ^
src/main.c:31:3: note: in expansion of macro 'LED_GPIO_CLK_ENABLE'
   LED_GPIO_CLK_ENABLE();
   ^~~~~~~~~~~~~~~~~~~
src/main.c:33:3: error: unknown type name 'GPIO_InitTypeDef'
   GPIO_InitTypeDef GPIO_InitStruct;
   ^~~~~~~~~~~~~~~~
src/main.c:35:18: error: request for member 'Pin' in something not a structure or union
   GPIO_InitStruct.Pin = LED_PIN;
                  ^
Compiling .pio/build/disco_h747xi/FrameworkCMSISDevice/system_stm32h7xx.o
src/main.c:23:48: error: 'GPIO_PIN_5' undeclared (first use in this function)
 #define LED_PIN                                GPIO_PIN_5
                                                ^
src/main.c:35:25: note: in expansion of macro 'LED_PIN'
   GPIO_InitStruct.Pin = LED_PIN;
                         ^~~~~~~
src/main.c:23:48: note: each undeclared identifier is reported only once for each function it appears in
 #define LED_PIN                                GPIO_PIN_5
                                                ^
src/main.c:35:25: note: in expansion of macro 'LED_PIN'
   GPIO_InitStruct.Pin = LED_PIN;
                         ^~~~~~~
src/main.c:36:18: error: request for member 'Mode' in something not a structure or union
   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
                  ^
src/main.c:36:26: error: 'GPIO_MODE_OUTPUT_PP' undeclared (first use in this function)
   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
                          ^~~~~~~~~~~~~~~~~~~
src/main.c:37:18: error: request for member 'Pull' in something not a structure or union
   GPIO_InitStruct.Pull = GPIO_PULLUP;
                  ^
src/main.c:37:26: error: 'GPIO_PULLUP' undeclared (first use in this function); did you mean 'GPIO_PIN_5'?
   GPIO_InitStruct.Pull = GPIO_PULLUP;
                          ^~~~~~~~~~~
                          GPIO_PIN_5
src/main.c:38:18: error: request for member 'Speed' in something not a structure or union
   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
                  ^
src/main.c:38:27: error: 'GPIO_SPEED_FREQ_HIGH' undeclared (first use in this function)
   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
                           ^~~~~~~~~~~~~~~~~~~~
src/main.c:39:3: warning: implicit declaration of function 'HAL_GPIO_Init' [-Wimplicit-function-declaration]
   HAL_GPIO_Init(LED_GPIO_PORT, &GPIO_InitStruct); 
   ^~~~~~~~~~~~~
src/main.c:24:48: error: 'GPIOA' undeclared (first use in this function)
 #define LED_GPIO_PORT                          GPIOA
                                                ^
src/main.c:39:17: note: in expansion of macro 'LED_GPIO_PORT'
   HAL_GPIO_Init(LED_GPIO_PORT, &GPIO_InitStruct); 
                 ^~~~~~~~~~~~~
src/main.c:43:5: warning: implicit declaration of function 'HAL_GPIO_TogglePin' [-Wimplicit-function-declaration]
     HAL_GPIO_TogglePin(LED_GPIO_PORT, LED_PIN);
     ^~~~~~~~~~~~~~~~~~
src/main.c:45:5: warning: implicit declaration of function 'HAL_Delay' [-Wimplicit-function-declaration]
     HAL_Delay(1000);
     ^~~~~~~~~
src/main.c: In function 'SysTick_Handler':
src/main.c:51:3: warning: implicit declaration of function 'HAL_IncTick' [-Wimplicit-function-declaration]
   HAL_IncTick();
   ^~~~~~~~~~~
*** [.pio/build/disco_h747xi/src/main.o] Error 1
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_utils.c: In function 'UTILS_GetPLLOutputFrequency':
/home/abet/.platformio/packages/framework-stm32cubeh7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_utils.c:930:13: warning: implicit declaration of function 'LL_RCC_CalcPLLClockFreq'; did you mean 'HAL_RCC_GetSysClockFreq'? [-Wimplicit-function-declaration]
   pllfreq = LL_RCC_CalcPLLClockFreq(PLL_InputFrequency, UTILS_PLLInitStruct->PLLM, UTILS_PLLInitStruct->PLLN, UTILS_PLLInitStruct->FRACN, UTILS_PLLInitStruct->PLLP);
             ^~~~~~~~~~~~~~~~~~~~~~~
             HAL_RCC_GetSysClockFreq
=================================================================== [FAILED] Took 5.50 seconds ===================================================================

So seems like the detected micro is not supported? The board should.

The example you’re compiling has no provisions for the H7.

that doesn’t mean it doesn’t work – just replace the chunk of chode shown above with

#include "stm32h7xx_hal.h"

Thank you a lot :slight_smile:
I am moving forward and trying to port this example.

Here a new thread.