stm32halcubemxstm32f1

How to use LL (low level) drivers in CubeMX STM32?


I'm creating a blank project for a STM32F103 microcontroller using STM32CubeMX. Using HAL drivers (the default), I got a blinky example working pretty quickly, but I'd like to try out LL (low level) drivers instead of HAL.

When I go to Project > Settings > Advanced Settings in CubeMX, I see the peripherals listed, and there is a pulldown next to each one which only has one option, HAL. According to the docs this is where I could select LL or HAL for each peripheral.

How do I enable LL drivers in STM32CubeMX?

Details: I did a clean install of STM32CubeMX (4.23.0) on Ubuntu (16.04) and created a new project for STM32F103C8 microcontroller (this is on a "Blue Pill" board). I'm using SW4STM32 IDE, everything more or less worked out of the box except I had to select STLink V2 instead of V2.1 in a config file.


Solution

  • Currently (STM32CubeMX v4.23.0) the LL drivers are only generated for L1, L4, F2, F4, F7 series. See the chapter 6.2 STM32Cube code generation using Low Layer drivers For STM32L1, STM32L4, STM32L4+, STM32F2, STM32F4 and STM32F7 Series, STM32CubeMX allows generating peripheral initialization code based either on the peripheral HAL driver or on the peripheral Low Layer (LL) driver.

    http://www.st.com/content/ccc/resource/technical/document/user_manual/10/c5/1a/43/3a/70/43/7d/DM00104712.pdf/files/DM00104712.pdf/jcr:content/translations/en.DM00104712.pdf