STM32 HAL and LL

Hello everyone.

This time I will talk about LL, which is contrasted with HAL.

For STM32

HAL: For Hardware Abstraction Layer

LL: Low Layer exists.

HAL was created to maintain compatibility with the STM32 series and reduce the amount of code written by the user.
Therefore, HAL has disadvantages such as an increase in the amount of code due to redundancy and weakness in high-speed operation.

Therefore, if you want to move at high speed or reduce the amount of code, it is a good idea to consider using LL.

However, it seems that HAL does not necessarily have more code.
It seems that HAL and LL can coexist, so it may be better to use them flexibly.

Other notes, etc.

・ STM32CubeMX (CubeIDE) can generate initialization code for LL.
・ Some peripherals are not supported by LL
・ Basically, do not use both HAL and LL in the same peripheral.
・ LL does not use any instances such as handles prepared by HAL.
・ Unlike HAL, LL API has low compatibility within the STM32 family.

Next time he will talk about how to use the IDE to generate initialization code in LL.

Leave a Reply