Oh actually the way more critical error is that it doesnβt find the HAL files for the MCU_FAMILY, aka STM32G4 in your case. Have you put the appropriate files in the framework-stm32cube folder?
Thank for pointing me to this code I have a better understanding of how the linker script is selected now.
No itβs not. CubeMX create one for me so I add the generated script by adding
I guess If I rename my linker script and put it manually into the framework files I will lose it at the next platformio updateβ¦
Also my project need to be used by multiple people and I need to have everything embedded on the project repo to avoid configuration troubles.
No I miss that! I just realized that all my other projects uses those files.
So I donβt need to keep my Driver folder locally for my working projects!
In my project generated Driver folder I donβt have any *xx_hal_conf.h or *xx_hal_conf_template.h.
You can copy the current version of the framework-stm32cube package to like a github repository, add the needed support files for the STM32G4 series (linker files, the HAL for the G4 series) and then point PlatformIO to use this repository as the framework-stm32cube packages.
This can be done by using the platform_packages directive (docs). You can also develop locally in the framework folder and then at the end push it to a repo.
So what youβre basically doing here is not only adding a board but also the framework support files since they donβt exist in the PlatformIO stm32cube package as of now (refer).
Yes found it, but it is on the inc folder. I think cubemx put it into inc because it modify it accordingly to used functionalities. Basically I just have to enable all modules on this file and past it on the framework package with all the βDriversβ functions, linker gonna deal with it.
Yes I get it. I gonna give it a try.
Is there any way to contribute? If I make this framework work for me it could be interesting for other usersβ¦
@maxgerhardt, thanks to you I use the official firmware package and put it into my framework-stm32cube.
Now I pass the previous step but I got tons of error like : unknown type name 'uint32_t'
I compare my files with other FRAMEWORK_CORE but I canβt see any difference regarding a #include <stdint.h> lineβ¦
Iβm not so sure, this particular board is really custom, but Iβm gonna think about it for my devs boards. Perhaps I could update the nucleo_g474re.json wich is using the same MCU to be able to use Arduino and STM32. But I will share my framework update for sure
This is thrown from framework files or project source code? Is your g4 folder structure in the framework-stm32cube the same as for other series? Can you share your current framework-stm32cube state for reprocdution?
Both I think but itβs difficult to say what is the first problem causing all this mess.
Yes I think. The only strange thing I noticed is the size of my linker script. All others are 4511bytes and mine is 5924bytes. This is the only file I get directly from my project, all others come from the official St firmware package of G4.
Today I noticed something strange. Platformio seems to fail accessing my files. If I clic on error I get a popup like :
Indeed the path to access those files seems broken, VSC seems to search into an βersβ folder (witch could be a part of the βDriversβ folder?). But this file is in framework, i check itβ¦
For now I donβt get how it happening, but it seems to be only on the βproblemβ view. If I use terminal VSC show me files as expected and find compilation missing symbols.
It sounds like a board/project configuration issue.
Is there somethig strange for you in my board.json file :
I think I got it!
The first issue is that the compiler doesnβt find stm32g474x.h and itβs because the file is named stm32g474xx.h on CMSIS framework package.
So I go back to my board.json and I noticed that I miss an βxβ on a define so I add it :
"extra_flags": [
"-DSTM32G4xx",
"-DSTM32G474xx", ; <==== instead of "-DSTM32G474x"
"-DUSE_FULL_LL_DRIVER"
I think this modification fix my issue.
Now I have error on use of middleware (USB). Middlewares are in Framework but platformio doesnβt seems to use them.
To patch it I add Middlewares folder of Framework on my project folders and add :