cancel
Showing results for 
Search instead for 
Did you mean: 

Cube does not find and link the Drivers/BSP/B-G474E-DPOW1 and add to the project source/include in STM32Cube_FW_G4_V1.1.0

carl3
Associate II

I was able to open the STM32Cube_FW_G4_V1.1.0/Projects/B-G474E-DPOW1/Examples/ADC/ADC_GainCompensation example project in CubeIDE. I had to modify a .ioc parameter and save to generate code. The Cube code generator managed to find the STM32G4xx_HAL_Driver sources and link them to the project, but does not find the Drivers/BSP/B-G474E-DPOW1/*.{h,c}

At first there was a missing .h file, so I manually added an include path to STM32Cube_FW_G4_V1.1.0/Drivers/BSP/B-G474E-DPOW1 but then the empty local Drivers/BSP/ B-G474E-DPOW1 has no .c files. So BSP_LED_Off() etc. is missing in the linker.

How can I get the code generator to find the include and source files in STM32Cube_FW_G4_V1.1.0/Drivers/BSP/B-G474E-DPOW1? I used ST32CubeMX to install into ~/STM32Cube/Repository/STM32Cube_FW_G4_V1.1.0 but did not try to generate code with CubeMX-- just saving the CubeIDE .ioc file. I don't understand how it found the STM32G4xx_HAL_Driver but not BSP.

1 REPLY 1
carl3
Associate II

Followup: I tried to open the STM32Cube/Repository/STM32Cube_FW_G4_V1.1.0/Projects/B-G474E-DPOW1/Examples/ADC/ADC_GainCompensation in the standalone cubeMX and generate code for STM32CubeIDE. Generating code says "Generating EWARM project" even though I selected CubeIDE. After I generate code and try to open the project, CubeMX opens an XML file that says "This XML file does not appear to have any style information associated with it. The document tree is shown below."...

<workspace><project><path>$WS_DIR$\ADC_GainCompensation.ewp</path></project><batchBuild/></workspace>

If I try to open it inside CubeIDE, the drivers aren't there in generated code. If I made a change in the ioc settings, then I could save and it tried to generate code, but then it says "Code could not be generated because the necessary firmware package is missing.". It seemed to have erased all the files in the sat:~/STM32Cube/Repository/STM32Cube_FW_G4_V1.1.0/Projects/B-G474E-DPOW1/Examples/ADC/ADC_GainCompensation directory except the .ioc file. So it seems to have corrupted the directory, and I'll need to re-unzip them.