Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 547
Alex I Avatar asked Dec 26 '17 00:12

Alex I


People also ask

What are LL drivers STM32?

The LL drivers offer hardware services based on the available features of the STM32 peripherals. These services reflect exactly the hardware capabilities, and provide atomic operations that must be called by following the programming model described in the product line reference manual.

What is difference between Hal and LL STM32?

From a ST's document: The HAL offers high-level and feature-oriented APIs, with a high-portability level. They hide the MCU and peripheral complexity to end-user. The LL offers low-level APIs at registers level, with better optimization but less portability.


Video Answer


2 Answers

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

like image 72
Bogdan Golab Avatar answered Jan 04 '23 20:01

Bogdan Golab


from project manager under advanced setting from driver selector you can change HAL to LL for all peripherals

like image 29
Bedoo00 Avatar answered Jan 04 '23 20:01

Bedoo00