cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE - How to rebuild Drivers\STM32F1xx_HAL_Driver sources if a file is missing

Bags
Associate III

I'm planning on moving from STM32F103 for more speed, so in advance of getting a board I thought I would try building an app for the STM32G431... so I found an small example project online that was using an OpAmp feature.

Having got that compiled ok in STM32CubeIDE I backported my app source code into the project (which went ok), but compiling it was missing some definitions for HAL UART structures.

Looking at "Drivers/STM32G4xx_HAL_Driver" in my original project and comparing it with "Drivers/STM32G4xx_HAL_Driver" in the new project I see that its missing some files like "stm32g4xx_hal_uart.h".

 

Is it possible to force STM32CubeIDE to regenerate the Drivers subfolder from scratch?

I always find switching a STM32CubeIDE project between different MCUs a harder job than it should be, e.g. it would be nice if there was a combo box listing MCUs in the project properties.

 

 

1 REPLY 1
TDK
Super User

STM32CubeMX will regenerate code if you've started your project using an IOC.

Otherwise, you'll have to copy driver files over manually. They should be located at:

C:\Users\%USERNAME%\STM32Cube\Repository\STM32Cube_FW_F0_V1.11.5\Drivers\STM32F0xx_HAL_Driver\

 

If you feel a post has answered your question, please click "Accept as Solution".