PlatformIO on CLion for STM32Cube

Hi all,
I’m trying to use the PlatformIO plugin on Clion for an STM32 project.

I followed the instructions on these links:
https://docs.platformio.org/en/latest/integration/ide/clion.html
https://docs.platformio.org/en/latest/frameworks/stm32cube.html

I haven’t connected the board yet.
It fails immediately when I try to build, so I suspect I’m doing something completely wrong.

I get about ~10k errors (see attached image)

I tried to clean, re-launch, re-init with no luck.
Please let me know if i need to share more details.

Any help is appreciated, thanks.

Great image - but unfortunatelly not large enough :wink: - the error messages are truncated. So it’s hard to say what’s going on.

Could you please post the error messages as preformated text

1 Like

Thanks for your reply, sure i’ll post as much as i can (the actual log is much, much longer than this, but i can only post up to 32k characters).

C:\Users\giliw\.platformio\penv\Scripts\pio run -e nucleo_h745zi_q
Processing nucleo_h745zi_q (platform: ststm32; board: nucleo_h745zi_q; framework: stm32cube)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_h745zi_q.html
PLATFORM: ST STM32 (17.6.0) > ST Nucleo H745ZI-Q
HARDWARE: STM32H745ZIT6 480MHz, 512KB RAM, 1MB 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\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_adc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_adc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cec.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_comp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cordic.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cortex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_crc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_crc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cryp.o
In file included from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h7xx.h:132:0,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_def.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_rcc.h:29,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_conf.h:246,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal.c:36:
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:243:2: error: #error Please #define CORE_CM4 or CORE_CM7
 #error Please #define CORE_CM4 or CORE_CM7
  ^~~~~
In file included from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:255:0,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h7xx.h:132,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_def.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_rcc.h:29,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_conf.h:246,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal.c:36:
C:\Users\giliw\.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  */
        ^~~~~~~~
C:\Users\giliw\.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  */
        ^~~~~~~~
C:\Users\giliw\.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 */
               ^~~~~~~
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cryp_ex.o
In file included from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h7xx.h:132:0,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_def.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_rcc.h:29,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_conf.h:246,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal.c:36:
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:268:3: error: unknown type name '__IO'
   __IO uint32_t ISR;              /*!< ADC Interrupt and Status Register,                          Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:268:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'ISR'
   __IO uint32_t ISR;              /*!< ADC Interrupt and Status Register,                          Address offset: 0x00 */
                 ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:315:1: error: unknown type name '__IO'
 __IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1/3 base address + 0x300 */
 ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:315:15: error: expected ':', ',', ';', '}' or '__attribute__' before 'CSR'
 __IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1/3 base address + 0x300 */
               ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:329:3: error: unknown type name '__IO'
   __IO uint32_t  CTR;        /*!< ART accelerator - control register */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:329:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'CTR'
   __IO uint32_t  CTR;        /*!< ART accelerator - control register */
                  ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:338:3: error: unknown type name '__IO'
   __IO uint32_t CSR;         /*!< VREFBUF control and status register,         Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:338:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CSR'
   __IO uint32_t CSR;         /*!< VREFBUF control and status register,         Address offset: 0x00 */
                 ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:349:3: error: unknown type name '__IO'
   __IO uint32_t CREL;         /*!< FDCAN Core Release register,                                     Address offset: 0x000 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:349:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CREL'
   __IO uint32_t CREL;         /*!< FDCAN Core Release register,                                     Address offset: 0x000 */
                 ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:410:3: error: unknown type name '__IO'
   __IO uint32_t TTTMC;          /*!< TT Trigger Memory Configuration register,    Address offset: 0x100 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:410:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'TTTMC'
   __IO uint32_t TTTMC;          /*!< TT Trigger Memory Configuration register,    Address offset: 0x100 */
                 ^~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:437:3: error: unknown type name '__IO'
   __IO uint32_t CREL;  /*!< Clock Calibration Unit Core Release register, Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:437:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CREL'
   __IO uint32_t CREL;  /*!< Clock Calibration Unit Core Release register, Address offset: 0x00 */
                 ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:452:3: error: unknown type name '__IO'
   __IO uint32_t CR;           /*!< CEC control register,              Address offset:0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:452:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CR'
   __IO uint32_t CR;           /*!< CEC control register,              Address offset:0x00 */
                 ^~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:466:3: error: unknown type name '__IO'
   __IO uint32_t DR;          /*!< CRC Data register,                           Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:466:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'DR'
   __IO uint32_t DR;          /*!< CRC Data register,                           Address offset: 0x00 */
                 ^~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:480:1: error: unknown type name '__IO'
 __IO uint32_t CR;            /*!< CRS ccontrol register,              Address offset: 0x00 */
 ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:480:15: error: expected ':', ',', ';', '}' or '__attribute__' before 'CR'
 __IO uint32_t CR;            /*!< CRS ccontrol register,              Address offset: 0x00 */
               ^~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:493:3: error: unknown type name '__IO'
   __IO uint32_t CR;       /*!< DAC control register,                                    Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:493:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CR'
   __IO uint32_t CR;       /*!< DAC control register,                                    Address offset: 0x00 */
                 ^~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:520:3: error: unknown type name '__IO'
   __IO uint32_t FLTCR1;          /*!< DFSDM control register1,                          Address offset: 0x100 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:520:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'FLTCR1'
   __IO uint32_t FLTCR1;          /*!< DFSDM control register1,                          Address offset: 0x100 */
                 ^~~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:542:3: error: unknown type name '__IO'
   __IO uint32_t CHCFGR1;      /*!< DFSDM channel configuration register1,            Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:542:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CHCFGR1'
   __IO uint32_t CHCFGR1;      /*!< DFSDM channel configuration register1,            Address offset: 0x00 */
                 ^~~~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:555:3: error: unknown type name '__IO'
   __IO uint32_t IDCODE;        /*!< MCU device ID code,                     Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:555:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'IDCODE'
   __IO uint32_t IDCODE;        /*!< MCU device ID code,                     Address offset: 0x00 */
                 ^~~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:576:3: error: unknown type name '__IO'
   __IO uint32_t CR;       /*!< DCMI control register 1,                       Address offset: 0x00 */
   ^~~~
In file included from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h7xx.h:132:0,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_def.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_rcc.h:29,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_conf.h:246,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_adc.c:307:
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:243:2: error: #error Please #define CORE_CM4 or CORE_CM7
 #error Please #define CORE_CM4 or CORE_CM7
  ^~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:576:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CR'
   __IO uint32_t CR;       /*!< DCMI control register 1,                       Address offset: 0x00 */
                 ^~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:595:3: error: unknown type name '__IO'
   __IO uint32_t CR;     /*!< DMA stream x configuration register      */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:595:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CR'
   __IO uint32_t CR;     /*!< DMA stream x configuration register      */
                 ^~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:605:3: error: unknown type name '__IO'
   __IO uint32_t LISR;   /*!< DMA low interrupt status register,      Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:605:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'LISR'
   __IO uint32_t LISR;   /*!< DMA low interrupt status register,      Address offset: 0x00 */
                 ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:613:3: error: unknown type name '__IO'
   __IO uint32_t CCR;          /*!< DMA channel x configuration register          */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:613:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CCR'
   __IO uint32_t CCR;          /*!< DMA channel x configuration register          */
                 ^~~
In file included from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:255:0,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h7xx.h:132,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_def.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_rcc.h:29,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_conf.h:246,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal_adc.c:307:
C:\Users\giliw\.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  */
        ^~~~~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:622:3: error: unknown type name '__IO'
   __IO uint32_t ISR;          /*!< DMA interrupt status register,               Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.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  */
        ^~~~~~~~
C:\Users\giliw\.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 */
               ^~~~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:622:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'ISR'
   __IO uint32_t ISR;          /*!< DMA interrupt status register,               Address offset: 0x00 */
                 ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:628:3: error: unknown type name '__IO'
   __IO uint32_t  CCR;        /*!< DMA Multiplexer Channel x Control Register   */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:628:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'CCR'
   __IO uint32_t  CCR;        /*!< DMA Multiplexer Channel x Control Register   */
                  ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:633:3: error: unknown type name '__IO'
   __IO uint32_t  CSR;      /*!< DMA Channel Status Register     */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:633:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'CSR'
   __IO uint32_t  CSR;      /*!< DMA Channel Status Register     */
                  ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:639:3: error: unknown type name '__IO'
   __IO uint32_t  RGCR;        /*!< DMA Request Generator x Control Register   */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:639:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'RGCR'
   __IO uint32_t  RGCR;        /*!< DMA Request Generator x Control Register   */
                  ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:644:3: error: unknown type name '__IO'
   __IO uint32_t  RGSR;        /*!< DMA Request Generator Status Register       */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:644:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'RGSR'
   __IO uint32_t  RGSR;        /*!< DMA Request Generator Status Register       */
                  ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:653:3: error: unknown type name '__IO'
   __IO uint32_t  GISR0;   /*!< MDMA Global Interrupt/Status Register 0,          Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:653:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'GISR0'
   __IO uint32_t  GISR0;   /*!< MDMA Global Interrupt/Status Register 0,          Address offset: 0x00 */
                  ^~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:658:3: error: unknown type name '__IO'
   __IO uint32_t  CISR;      /*!< MDMA channel x interrupt/status register,             Address offset: 0x40 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:658:18: error: expected ':', ',', ';', '}' or '__attribute__' before 'CISR'
   __IO uint32_t  CISR;      /*!< MDMA channel x interrupt/status register,             Address offset: 0x40 */
                  ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:680:3: error: unknown type name '__IO'
   __IO uint32_t CR;            /*!< DMA2D Control Register,                         Address offset: 0x00 */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:680:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'CR'
   __IO uint32_t CR;            /*!< DMA2D Control Register,                         Address offset: 0x00 */
                 ^~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:711:3: error: unknown type name '__IO'
   __IO uint32_t MACCR;
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:711:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'MACCR'
   __IO uint32_t MACCR;
                 ^~~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:885:1: error: unknown type name '__IO'
 __IO uint32_t RTSR1;               /*!< EXTI Rising trigger selection register,          Address offset: 0x00 */
 ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:885:15: error: expected ':', ',', ';', '}' or '__attribute__' before 'RTSR1'
 __IO uint32_t RTSR1;               /*!< EXTI Rising trigger selection register,          Address offset: 0x00 */
               ^~~~~
In file included from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h7xx.h:132:0,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_def.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_rcc.h:29,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal_conf.h:246,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Inc/stm32h7xx_hal.h:30,
                 from C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_hal.c:36:
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:943:1: error: unknown type name '__IO'
 __IO uint32_t IMR1;                /*!< EXTI Interrupt mask register,                Address offset: 0x00 */
 ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:943:15: error: expected ':', ',', ';', '}' or '__attribute__' before 'IMR1'
 __IO uint32_t IMR1;                /*!< EXTI Interrupt mask register,                Address offset: 0x00 */
               ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:963:3: error: unknown type name '__IO'
   __IO uint32_t ACR;             /*!< FLASH access control register,                            Address offset: 0x00  */
   ^~~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:963:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'ACR'
   __IO uint32_t ACR;             /*!< FLASH access control register,                            Address offset: 0x00  */
                 ^~~
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\CMSIS\Device\ST\STM32H7xx\Include/stm32h745xx.h:1015:3: error: unknown type name '__IO'

Well the 1st error says

Did you try to set one of them in your platformio.ini?

There is a similar case0 in history – may be that helps you

That helped a lot! However there’s still something wrong when it compiles (it’s a warning, not sure if it will causes any troubles later on):

C:\Users\giliw\.platformio\penv\Scripts\pio run -e nucleo_h745zi_q
Processing nucleo_h745zi_q (platform: ststm32; board: nucleo_h745zi_q; framework: stm32cube)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_h745zi_q.html
PLATFORM: ST STM32 (17.6.0) > ST Nucleo H745ZI-Q
HARDWARE: STM32H745ZIT6 480MHz, 512KB RAM, 1MB 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\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_adc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_adc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cec.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_comp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cordic.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cortex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_crc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_crc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cryp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cryp_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dac_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dcmi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dfsdm.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dfsdm_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dma2d.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dma_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dsi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dts.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_eth.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_eth_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_exti.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_fdcan.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_flash.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_flash_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_fmac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_gfxmmu.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_gpio.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hash.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hash_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hcd.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hrtim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hsem.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2c.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2c_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2s.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2s_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_irda.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_iwdg.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_jpeg.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_lptim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ltdc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ltdc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mdios.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mdma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mmc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mmc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_nand.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_nor.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_opamp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_opamp_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ospi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_otfdec.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pcd.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pcd_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pssi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pwr.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pwr_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_qspi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ramecc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rcc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rcc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rng.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rng_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rtc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rtc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sai.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sai_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sd.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sd_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sdram.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_smartcard.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_smartcard_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_smbus.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_spdifrx.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_spi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_spi_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sram.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_swpmi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_tim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_tim_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_uart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_uart_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_usart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_usart_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_wwdg.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_adc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_bdma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_comp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_cordic.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_crc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_crs.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_dac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_delayblock.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_dma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_dma2d.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_exti.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_fmac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_fmc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_gpio.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_hrtim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_i2c.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_lptim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_lpuart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_mdma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_opamp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_pwr.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_rcc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_rng.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_rtc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_sdmmc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_spi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_swpmi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_tim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_usart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_usb.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_utils.o
Compiling .pio\build\nucleo_h745zi_q\src\main.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkCMSISDevice\gcc\startup_stm32h745xx.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkCMSISDevice\system_stm32h7xx.o
src\main.c:1:0: warning: "CORE_CM7" redefined
 #define CORE_CM7
 
<command-line>:0:0: note: this is the location of the previous definition
Archiving .pio\build\nucleo_h745zi_q\libFrameworkCMSISDevice.a
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_ll_utils.c: In function 'UTILS_GetPLLOutputFrequency':
C:\Users\giliw\.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
Linking .pio\build\nucleo_h745zi_q\firmware.elf
Checking size .pio\build\nucleo_h745zi_q\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 28 bytes from 524288 bytes)
Flash: [          ]   0.0% (used 436 bytes from 1048576 bytes)
Building .pio\build\nucleo_h745zi_q\firmware.bin
========================= [SUCCESS] Took 10.90 seconds =========================

Ok, I think I’m completely lost.
I have a very simple program:

int main() {
    /* STM32H7xx HAL library initialization */
    HAL_Init();

    /* Initialize LED1 and LED2 */
    BSP_LED_Init(LED1);
    
    /* Main loop to toggle LEDs */
    while (1)
    {
        BSP_LED_Toggle(LED1);
        // BSP_LED_Toggle(LED2);
        HAL_Delay(1000); // Adjusting the delay as a quick test
    }
}

but i get this when it compiles:

src\main.c:3:5: warning: implicit declaration of function 'HAL_Init' [-Wimplicit-function-declaration]
     HAL_Init();
     ^~~~~~~~
src\main.c:6:5: warning: implicit declaration of function 'BSP_LED_Init' [-Wimplicit-function-declaration]
     BSP_LED_Init(LED1);
     ^~~~~~~~~~~~
src\main.c:6:18: error: 'LED1' undeclared (first use in this function)
     BSP_LED_Init(LED1);
                  ^~~~
src\main.c:6:18: note: each undeclared identifier is reported only once for each function it appears in
src\main.c:11:9: warning: implicit declaration of function 'BSP_LED_Toggle' [-Wimplicit-function-declaration]
         BSP_LED_Toggle(LED1);
         ^~~~~~~~~~~~~~
src\main.c:13:9: warning: implicit declaration of function 'HAL_Delay' [-Wimplicit-function-declaration]
         HAL_Delay(1000); // Adjusting the delay as a quick test
         ^~~~~~~~~
*** [.pio\build\nucleo_h745zi_q\src\main.o] Error 1
C:\Users\giliw\.platformio\packages\framework-stm32cubeh7\Drivers\STM32H7xx_HAL_Driver\Src\stm32h7xx_ll_utils.c: In function 'UTILS_GetPLLOutputFrequency':
C:\Users\giliw\.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 10.33 seconds =========================

Do i have to manually copy the dependencies? What am i missing?

you have 2 warnings :wink:

The 1st one

is easy to explain. You have defined CORE_CM7 twice - once in your main.c and I assume you did that before adding the 2nd one in platformio.ini. Remove the 1st one and the warning will disappear.

To the 2nd warning

Unfortunately I can’t say very much to that topic. Obviously the function exists - otherwise the linker would have failed. But it could be much better to declare it - with the correct signature (parameters and return type) - before usage

And regarding your last questions

No - platformio should do that job for you

If that is really your complete program then warnings like

must occur as you access methods like HAL_Init() without declaring them before - and the compiler complains about that, because he doesn’t know these methods and how their signatures (parameters and return value) really look like.

To declare these methods you could either include the appropriate header files or declare them manually before accessing in your main method with something like that

extern void HAL_Init();

Missing all of the includes.

#include <stm32h7xx_hal.h>
#include <stm32h747i_eval.h>

You can’t expect this to work if you don’t define the interrupt handler for the systick.

Hmpf. The “Drivers/BSP/STM32H747I-EVAL” component that provides stm32h747i_eval.h cannot not easily be built by PlatformIO by default, and also the components it depends on have ton of config files they expect. This seems to be more involved in getting working, that is, if you don’t just copy-paste a STM32CubeMX generated project anyway.

This minimal example should work fine, with

[env:nucleo_h745zi_q]
platform = ststm32
board = nucleo_h745zi_q
framework = stm32cube
build_flags =  
  -DCORE_CM7 ; so that STM32HAL knows what core we're building for
  -DUSE_FULL_LL_DRIVER ; make LL driver available

and

#include <stm32h7xx_hal.h>

#define LED_GPIO_PORT                   GPIOK
#define LED_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOK_CLK_ENABLE()
#define LED_PIN                         GPIO_PIN_3
//LED1=K3, LED2 = K4, LED3=K5, LED4=K6.

int main() {
    /* STM32H7xx HAL library initialization */
    HAL_Init();

    LED_GPIO_CLK_ENABLE();    
    GPIO_InitTypeDef GPIO_InitStruct;
    GPIO_InitStruct.Pin = LED_PIN;
    GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
    GPIO_InitStruct.Pull = GPIO_PULLUP;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
    HAL_GPIO_Init(LED_GPIO_PORT, &GPIO_InitStruct); 
      /* Main loop to toggle LEDs */
    while (1)
    {
        HAL_GPIO_TogglePin(LED_GPIO_PORT, LED_PIN);
        HAL_Delay(1000); // Adjusting the delay as a quick test
    }
}

void SysTick_Handler(void)
{
    HAL_IncTick();
}

Thanks all for your replies.
So, i added the missing HAL include and platformio picked that up just fine.
Following Max’s suggestion I got rid of the BSP driver (I actually got it to work, but only by manually adding a bunch of files to the project).

So now i have this program (copied from Max’s):

[env:nucleo_h745zi_q]
platform = ststm32
board = nucleo_h745zi_q
framework = stm32cube
build_flags =
    -DCORE_CM7 ; so that STM32HAL knows what core we're building for
    -DUSE_FULL_LL_DRIVER ; make LL driver available
#include <stm32h7xx_hal.h>

#define LED_GPIO_PORT                   GPIOK
#define LED_GPIO_CLK_ENABLE()           __HAL_RCC_GPIOK_CLK_ENABLE()
#define LED_PIN                         GPIO_PIN_3
//LED1=K3, LED2 = K4, LED3=K5, LED4=K6.

int main() {
    /* STM32H7xx HAL library initialization */
    HAL_Init();

    LED_GPIO_CLK_ENABLE();
    GPIO_InitTypeDef GPIO_InitStruct;
    GPIO_InitStruct.Pin = LED_PIN;
    GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
    GPIO_InitStruct.Pull = GPIO_PULLUP;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
    HAL_GPIO_Init(LED_GPIO_PORT, &GPIO_InitStruct);
    /* Main loop to toggle LEDs */
    while (1)
    {
        HAL_GPIO_TogglePin(LED_GPIO_PORT, LED_PIN);
        HAL_Delay(1000); // Adjusting the delay as a quick test
    }
}

void SysTick_Handler(void)
{
    HAL_IncTick();
}

It compiles, no warnings, everything seems to work fine.
However this is the result when uploading:

C:\Users\giliw\.platformio\penv\Scripts\pio run -t upload -e nucleo_h745zi_q
Processing nucleo_h745zi_q (platform: ststm32; board: nucleo_h745zi_q; framework: stm32cube)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_h745zi_q.html
PLATFORM: ST STM32 (17.6.0) > ST Nucleo H745ZI-Q
HARDWARE: STM32H745ZIT6 480MHz, 512KB RAM, 1MB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
 - framework-stm32cubeh7 @ 1.9.0
 - tool-dfuutil @ 1.11.0
 - tool-dfuutil-arduino @ 1.11.0
 - tool-ldscripts-ststm32 @ 0.2.0
 - tool-openocd @ 3.1200.0 (12.0)
 - tool-stm32duino @ 1.0.2
 - 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
Checking size .pio\build\nucleo_h745zi_q\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 48 bytes from 524288 bytes)
Flash: [          ]   0.3% (used 3076 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, stlink
CURRENT: upload_protocol = stlink
Uploading .pio\build\nucleo_h745zi_q\firmware.elf
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

[stm32h7x.cpu0] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000d4c msp: 0x24080000
[stm32h7x.cpu1] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Warn : Adding extra erase range, 0x08000ec0 .. 0x0801ffff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
Error: [stm32h7x.cpu1] clearing lockup after double fault
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x0800089a msp: 0x2407ffd0
[stm32h7x.cpu1] halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8
shutdown command invoked
========================================================================================================================================= [SUCCESS] Took 5.03 seconds =========================================================================================================================================


I’m not sure what’s going on with the log, but the LED doesn’t blink so i assume it didn’t work.
Also, my board is a H755, not H745. Not sure that makes any difference in this context?

Thanks

Weird, the firmware seems to have crashed pretty much instantly and ended up in the Hardfault handler.

Can you set

debug_init_break = break Reset_Handler
debug_build_flags = -O0 -ggdb3 -g3

and start debugging via the debug side panel → play button? Step-over or into every instructions from the Reset_Handler on its way to main(), or see where it crashes and jumps into the Hardfault_handler.

Thanks for your reply.
I added those 2 lines in my ini file.
When i start debugging i get this log:

Preparing firmware for debugging...
Processing nucleo_h745zi_q (platform: ststm32; board: nucleo_h745zi_q; framework: stm32cube)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_h745zi_q.html
PLATFORM: ST STM32 (17.6.0) > ST Nucleo H745ZI-Q
HARDWARE: STM32H745ZIT6 480MHz, 512KB RAM, 1MB 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 debug mode
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_adc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_adc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cec.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_comp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cordic.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cortex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_crc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_crc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cryp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_cryp_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dac_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dcmi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dfsdm.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dfsdm_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dma2d.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dma_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dsi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_dts.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_eth.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_eth_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_exti.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_fdcan.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_flash.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_flash_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_fmac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_gfxmmu.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_gpio.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hash.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hash_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hcd.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hrtim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_hsem.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2c.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2c_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2s.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_i2s_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_irda.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_iwdg.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_jpeg.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_lptim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ltdc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ltdc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mdios.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mdma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mmc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_mmc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_nand.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_nor.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_opamp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_opamp_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ospi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_otfdec.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pcd.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pcd_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pssi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pwr.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_pwr_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_qspi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_ramecc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rcc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rcc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rng.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rng_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rtc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_rtc_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sai.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sai_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sd.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sd_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sdram.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_smartcard.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_smartcard_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_smbus.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_spdifrx.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_spi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_spi_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_sram.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_swpmi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_tim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_tim_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_uart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_uart_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_usart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_usart_ex.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_hal_wwdg.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_adc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_bdma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_comp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_cordic.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_crc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_crs.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_dac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_delayblock.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_dma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_dma2d.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_exti.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_fmac.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_fmc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_gpio.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_hrtim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_i2c.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_lptim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_lpuart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_mdma.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_opamp.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_pwr.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_rcc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_rng.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_rtc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_sdmmc.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_spi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_swpmi.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_tim.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_usart.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_usb.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkHALDriver\Src\stm32h7xx_ll_utils.o
Compiling .pio\build\nucleo_h745zi_q\src\main.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkCMSISDevice\gcc\startup_stm32h745xx.o
Compiling .pio\build\nucleo_h745zi_q\FrameworkCMSISDevice\system_stm32h7xx.o
Archiving .pio\build\nucleo_h745zi_q\libFrameworkCMSISDevice.a
Linking .pio\build\nucleo_h745zi_q\firmware.elf
Checking size .pio\build\nucleo_h745zi_q\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 48 bytes from 524288 bytes)
Flash: [          ]   0.4% (used 4476 bytes from 1048576 bytes)
Building .pio\build\nucleo_h745zi_q\firmware.bin
========================= [SUCCESS] Took 16.36 seconds =========================
Reading symbols from C:\Users\giliw\CLionProjects\untitled2\.pio\build\nucleo_h745zi_q\firmware.elf...done.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : tcl server disabled
Info : telnet server disabled
Info : STLINK V3J15M7 (API v3) VID:PID 0483:374E
Info : Target voltage: 3.277076
Info : Unable to match requested speed 1800 kHz, using 1000 kHz
Info : Unable to match requested speed 1800 kHz, using 1000 kHz
Info : clock speed 1000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : [stm32h7x.cpu0] Cortex-M7 r1p1 processor detected
Info : [stm32h7x.cpu0] target has 8 breakpoints, 4 watchpoints
Info : [stm32h7x.cpu1] Cortex-M4 r0p1 processor detected
Info : [stm32h7x.cpu1] target has 6 breakpoints, 4 watchpoints
Info : gdb port disabled
Info : starting gdb server for stm32h7x.cpu0 on pipe
Info : starting gdb server for stm32h7x.cpu1 on pipe
Info : accepting 'gdb' connection from pipe
Info : Device: STM32H74x/75x
Info : flash size probed value 2048k
Info : STM32H7 flash has dual banks
Info : Bank (0) size is 1024 kb, base address is 0x08000000
Info : Device: STM32H74x/75x
Info : flash size probed value 2048k
Info : STM32H7 flash has dual banks
Info : Bank (1) size is 1024 kb, base address is 0x08100000
Info : New GDB Connection: 1, Target stm32h7x.cpu0, state: halted
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1005 ms). Workaround: increase "set remotetimeout" in GDB
Info : accepting 'gdb' connection from pipe
Info : Device: STM32H74x/75x
Warn : stm32h7x.cpu1 cannot read the flash size register
Info : assuming 2048k flash
Info : STM32H7 flash has dual banks
Info : Bank (2) size is 1024 kb, base address is 0x08000000
Info : Device: STM32H74x/75x
Warn : stm32h7x.cpu1 cannot read the flash size register
Info : assuming 2048k flash
Info : STM32H7 flash has dual banks
Info : Bank (3) size is 1024 kb, base address is 0x08100000
Info : New GDB Connection: 2, Target stm32h7x.cpu1, state: halted
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
undefined debug reason 8 - target needs reset
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: Failed to read memory at 0xfffffffe
Error: GDB missing ack(2) - assumed good
Error: Failed to read memory at 0xfffffffe
0xfffffffe in ?? ()
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
[stm32h7x.cpu1] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Unable to match requested speed 4000 kHz, using 3300 kHz
Info : Unable to match requested speed 4000 kHz, using 3300 kHz
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1022 ms). Workaround: increase "set remotetimeout" in GDB
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
Info : Padding image section 0 at 0x0800141c with 4 bytes (bank write end alignment)
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
[stm32h7x.cpu1] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Error: GDB missing ack(2) - assumed good
Error: GDB missing ack(2) - assumed good
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
Warn : negative reply, retrying
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
Warn : negative reply, retrying
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
Warn : negative reply, retrying
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
Warn : negative reply, retrying
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
Warn : negative reply, retrying
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001280 msp: 0x24080000
Warn : negative reply, retrying
Command timed out

It keeps retrying for 10 times, then it times out.

Can you upload an Arduino firmware without crashing? platform-ststm32/examples/arduino-blink at develop · platformio/platform-ststm32 · GitHub

I don’t think my board is even supported in that example, this is what i get when executing pio run --target upload:

Environment                 Status    Duration
--------------------------  --------  ------------
bluepill_f103c8             FAILED    00:00:04.274
bluepill_f103c8_128k        SUCCESS   00:00:06.169
maple                       SUCCESS   00:00:04.916
genericSTM32F103RB          FAILED    00:00:04.229
bluepill_f103c8_stm32_core  SUCCESS   00:00:06.333
nucleo_l152re               FAILED    00:00:04.097
nucleo_f072rb               FAILED    00:00:04.193
nucleo_f401re               FAILED    00:00:04.951
nucleo_wb55rg_p             FAILED    00:00:05.313
nucleo_g071rb               FAILED    00:00:04.295
nucleo_g431kb               FAILED    00:00:04.370
nucleo_g431rb               FAILED    00:00:04.230
robotdyn_blackpill_f303cc   FAILED    00:00:04.315
sparky_v1                   FAILED    00:00:04.847
vake_v1                     FAILED    00:00:04.598
st3dp001_eval               FAILED    00:00:04.776
disco_f407vg                FAILED    00:00:04.602
disco_l072cz_lrwan1         FAILED    00:00:02.451
cricket_l082cz              FAILED    00:00:02.143
econode_l082cz              FAILED    00:00:02.104
giga_r1_m7                  FAILED    00:00:10.150

Something was probably flashed on the board, but it doesn’t “blink”

Can you please try out this exact project? Does it blink the LED? Is it debuggable?

Build ok, but upload not so much.
Here’s the log:

C:\Users\giliw\.platformio\penv\Scripts\pio run -t upload -e nucleo_h745zi_q
Processing nucleo_h745zi_q (platform: ststm32; board: nucleo_h745zi_q_arduino; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_h745zi_q_arduino.html
PLATFORM: ST STM32 (17.6.0) > ST Nucleo H745ZI-Q
HARDWARE: STM32H745ZIT6 480MHz, 512KB RAM, 1MB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
 - framework-arduinoststm32 @ 4.20801.240815 (2.8.1)
 - framework-cmsis @ 2.50900.0 (5.9.0)
 - tool-dfuutil @ 1.11.0
 - tool-dfuutil-arduino @ 1.11.0
 - tool-openocd @ 3.1200.0 (12.0)
 - tool-stm32duino @ 1.0.2
 - toolchain-gccarmnoneeabi @ 1.120301.0 (12.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 14 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio\build\nucleo_h745zi_q\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.2% (used 1292 bytes from 524288 bytes)
Flash: [          ]   1.1% (used 11860 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, stlink
CURRENT: upload_protocol = stlink
Uploading .pio\build\nucleo_h745zi_q\firmware.elf
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

[stm32h7x.cpu0] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002564 msp: 0x30048000
[stm32h7x.cpu1] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
Warn : Adding extra erase range, 0x08003120 .. 0x0801ffff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
Error: [stm32h7x.cpu1] clearing lockup after double fault
[stm32h7x.cpu0] halted due to debug-request, current mode: Thread
xPSR: 0x81000000 pc: 0x0800039e msp: 0x30047fd8
[stm32h7x.cpu1] halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8
shutdown command invoked
========================================================================================================================================= [SUCCESS] Took 6.30 seconds =========================================================================================================================================






Wtf. Can you post a picture of the board here? The main chip 100% says STM32H745ZIT6?

Looks not like :wink:

doctor-who-rain-sad

Well… Time to setup a new project for the actual chip they have…