it allows linking the component driver to a specific board and provides a set of user-friendly APIs. The API naming
rule is BSP_FUNCT_Action().
Examples: BSP_LED_Init(), BSP_LED_On()
The BSP is based on a modular architecture allowing an easy porting on any hardware by just implementing the
low level routines.
2.1.2 Hardware abstraction layer (HAL) and low layer (LL)
The STM32CubeL0 HAL and LL are complementary and cover a wide range of applications requirements:
• The HAL drivers offer high-level function-oriented highly-portable APIs. They hide the MCU and peripheral
complexity to end user.
The HAL drivers provide generic multi-instance feature-oriented APIs which simplify user application
implementation by providing ready to use process. As example, for the communication peripherals (I2S,
UART…), it provides APIs allowing initializing and configuring the peripheral, managing data transfer based
on polling, interrupt or DMA process, and handling communication errors that may raise during
communication.
The HAL driver APIs are split in two categories:
– Generic APIs which provides common and generic functions to all the STM32 series
– Extension APIs which provides specific and customized functions for a specific family or a specific part
number.
• The low-layer APIs provide low-level APIs at register level, with better optimization but less portability. They
require a deep knowledge of MCU and peripheral specifications. The LL drivers are designed to offer a fast
light-weight expert-oriented layer which is closer to the hardware than the HAL. Contrary to the HAL, LL
APIs are not provided for peripherals where optimized access is not a key feature, or for those requiring
heavy software configuration and/or complex upper-level stack (such as USB).
The LL drivers feature:
– A set of functions to initialize peripheral main features according to the parameters specified in data
structures
– A set of functions used to fill initialization data structures with the reset values corresponding to each
field
– A function for peripheral de-initialization (peripheral registers restored to their default values)
– A set of inline functions for direct and atomic register access
– A full independence from HAL and capability to be used in standalone mode (without HAL drivers)
– A full coverage of the supported peripheral features.
2.1.3 Basic peripheral usage examples
This layer includes the examples build over the STM32 peripheral and using either the HAL or/and the low-layer
drivers APIs as well as the BSP resources.
2.2 Level 1
This level is divided into two sub-layers:
• Middleware components
• Examples based on the middleware components.
2.2.1 Middleware components
The middleware components are a set of libraries covering USB and Device Libraries, STMTouch touch sensing,
FreeRTOS™ and FatFS. Horizontal interactions between the components of this layer is done directly by calling
the feature APIs while the vertical interaction with the low-level drivers is done through specific callbacks and
static macros implemented in the library system call interface. For example, the FatFS implements the disk I/O
driver to access microSD™ drive or the USB Mass Storage Class.
The main features of each middleware component are as follows:
• USB device libraries
– Several USB classes supported (Mass-Storage, HID, CDC, DFU, MSC).
– Support of multi-packet transfer features that allows sending big amounts of data without splitting them
into maximum packet size transfers.
UM1754
Level 1
UM1754 - Rev 6
page 4/22