12

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.

Alex I
  • 19,689
  • 9
  • 86
  • 158
  • 1
    Use bare registers instead. Forget those ll libraries. You do not need to enable anything. Just use the ll functions. – 0___________ Dec 26 '17 at 01:52
  • 1
    Check the last Cube update, LL support for F1 is enabled now – Almaz Feb 02 '18 at 06:28
  • This info int the STM32CubeMX manual is not true if it comes to the F0 series. I was able to generate LL drivers for STM32F030F4P6 (another cheap MCU). – Bogdan Golab Dec 30 '17 at 20:44

2 Answers2

10

Change HAL to LL:

  1. Project Manager
  2. Advanced setting
  3. Within Driver Selector, change HAL to LL (for required peripherals)

LL selection

Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
Bedoo00
  • 101
  • 1
  • 4
  • Although not every peripheral are listed there. For instance, the external interrupt driver isn't listed so can't be set to "LL", even though `stm32g4xx_ll_exti.h` is present in the drivers folder. – DarkFranX Mar 12 '20 at 16:15
8

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