STM Cube MX to platformio using STM32G474RE not working

Hi all, I am relatively new to the embedded world so bear with me on this one.

I have tried around 8 times now to get my STM32G474RE board (with just a SD card breakout assign to SP6) to transfer into Platformio and have zero success. I have tried to build it, transfer all the .c files and all the .h files to the src and include folders but there are simply too many for that to be the right answer. I have tried to format the files in a way to get platformio.ini to read them but I can only include one extra directory so that won’t work either. I dug through some other forums that suggested using an old stm32pio converter but the new Cube MX doesn’t allow for GPDSC file formats anymore so that won’t work either.

All of that to say I can’t get my build to be successful and I am pretty much stalled at the moment. Attached below is a picture of my current errors which are due to header and main files not being visible to the platformio.ini file. Anyone know how to get the files created from Cobe MX into a format which I can edit them through platformio using VScode?

If I move the one file it is referencing into main it just moves down the list to the next one it can’t find an so on.

Any and all suggestions are appreciated, thanks!

That’s why a new tool was created: [ANNOUNCE] stm32bridge: migrate STM32CubeMX → PlatformIO in one command (no GPDSC)

Why? The PlatformIO documentation is very clear on its source code folder layout and configuration possibilities. (docs, docs). If you want source code to be built, it has to be in the src_dir (by default src/) or in a library in lib/, or referenced by lib_deps.

Carefully set up your project with either framework = stm32cube (meaning, PlatformIO will use its version of the STM32Cube CMSIS Startup File, Header, STM32HAL source and headers, linker script) or no framework (meaning you have to provide all those files yourself), along with the same compiler options that your stm32 project does, like clock configuration settings.

Thank you very much for all my searching I could not for the life of me find a new method to migrate. This seems to be working now so I appreciate your time