cancel
Showing results for 
Search instead for 
Did you mean: 

Get STM32CubeIDE to add HAL and LL drivers to project

daviddavid9
Associate II

Hi, I am using all HAL drivers in my project, and have this configured in STM32CubeIDE(in STM32CubeMX part of STM32CubeIDE). I want to use mixed HAL and LL drivers for DMA and UART. But, because in STM32CubeIDE device configuation(advanced options) I have selected HAL for DMA and UART, it only adds HAL drivers to the "../Drivers/STM32F0xx_HAL_Driver" folder of my project. I know I can copy the LL drivers from STM32CubeF0, but than I have to select what version. And, if I ever update the version of STM32CubeF0 via the IDE, it will not match the version of the files I copied. I want to IDE to copy both the HAL and LL files into the "../Drivers/STM32F0xx_HAL_Driver" folder.

5 REPLIES 5
KnarfB
Principal III

You can easily combine HAL with CMSIS register-level coding. I wouldn't mix HAL (some wouldn't even use HAL at all) and another hardware abstraction (LL).

daviddavid9
Associate II

Hi, but is there a way to get STM32CubeIDE to add the HAL and LL drivers to my project? If I configure STM32CubeIDE for HAL mode, it does not add the LL drivers to "../Drivers/STM32F0xx_HAL_Driver" folder of my project.

There is only a trick i know of: you configure 2 UARTS, one HAL and the other LL and some DMA for either UART. This will copy HAL and LL drivers. In the Project Manager > Advanced Settings you can check "Do Not Generate Function Call" for the dummy UART which keeps the overhead low.

TDK
Guru

CubeMX is configured to only add what it needs. If you want to do something else, such as adding all files, you'll need to do it manually.

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

> And, if I ever update the version of STM32CubeF0 via the IDE, it will not match the version of the files I copied.

Eclipse has a useful feature for this, called Path Variables.

Instead of copying the drivers to your project, you can specify linking to the Cube repository (where the Cube installs the libraries and other its stuff).

Create one or more path variables to point to the library.

For example, name: STM32Cube_FW_F0 Location: C:\Users\Public\STM32Cube\Repository\STM32Cube_FW_F0_V1.11.0

Manually edit all these links in .project and .cproject and replace absolute paths to ST driver files, using these path variables.

Then to change the library version, you have only to change the path variable.

Unfortunately CubeMx does not understand path variables :(

-- pa