STM32CubeWB0 software architecture

Click here for Bluetooth® LE overview

1. General software architecture

The user can rely on multiple modules and software blocks to create an application. The whole framework is called “Application Firmware Framework”. The architecture is designed over a three-level organization:

  • Application firmware
  • Bluetooth® LE stack
  • Platform resources
Software architecture
Connectivity SW Architecture WB0.png

1.1. Application firmware

This is the user application. It is based on:

  • Peripherals, either from STMicroelectronics or from a third party
  • Features developed by STMicroelectronics for short-range protocols, such as Bluetooth® LE profiles and others
  • Utilities required by the application and the protocol stacks
  • Generic utilities that provide easy access to basic features, such as low power management, sequencer, and others

1.2. Bluetooth® LE stack

The Bluetooth® LE stack is the main interface between the application and the hardware for Bluetooth® LE purposes. Two Bluetooth® LE stack variants are available:

Bluetooth® LE Host + Controller stack
The Bluetooth® LE Host + Controller stack manages all Bluetooth® LE stack protocols layers (GAP, GATT, ATT, SM, L2CAP, HCI, link layer, and the interface to the physical layer).
Bluetooth® LE Controller only stack
The Bluetooth® LE Controller includes only the HCI layer, the link layer, and the interface to the physical layer.

1.3. Platform resources

The platform resources include all the HALs, BSPs, and drivers that facilitate platform hardware use.


2. Project architecture

2.1. Overview

The project organization differs slightly from the application architecture. This organization is repository-based and split into six different parts:

2.2. Application

Application is the core part of the project. It groups all the main information and actions that define the user application. This section is divided into sub-directories:

EWARM project view
Connectivity Project Application View STM32CubeWB0.png
Core
This part is the main entry point of the application. It contains all the setup and entry code, such as hardware initialization routines, IRQs setup, scheduler configuration, tasks registration, and others.
Contains the files: such as main.c, app_entry.c, and others.
STM32_BLE
The STM32_BLE repository groups the Bluetooth® LE related files. It is composed of two sub-parts:
App
Main applicative sources files part. For instance, in HR example, this repository contains the main application file (app_ble.c) and the Bluetooth® LE services implementation.
Target
This is dedicated to the interface and integration of the libraries and modules present in the middleware.
System
Basic system-related interfaces. There are two sub-parts in this repository:
Config
Debug GPIO utilities
Interfaces
Interface to debug trace utilities

2.3. Common

Common is the core part of the project. It groups all the common information and actions that define the user application. This section is divided into sub-directories:

EWARM common view
Connectivity Project Common View STM32CubeWB0.png
BLE
The BLE repository regroups the Bluetooth® Low Energy related files. It is composed of three sub-parts and the user can configure the system related modules, interfaces, and utilities (such as PKA, RNG, AES, and others):
Interfaces
This folder groups all the hardware files for handling the required Bluetooth® LE stack interfaces to AES, PKA, RNG, and LPM features.
Modules
Contains all the system module sources and header files (such as flash memory, non-volatile memory, pka manager, radio utilities, osal utilities, and others).
Startup
This is the device context switch file location.

2.4. Doc

This section contains only the README.md file.


2.5. Drivers

The drivers are divided into the following component sets:

STM32WB0x_HAL_Driver (hardware abstraction layer)
This layer provides the hardware abstraction drivers and the hardware interfacing methods to interact with the upper layers (application, libraries, and stacks). The HAL is composed of:

  • The HAL Drivers:
A set of portable abstraction APIs based on high level services built around standalone processes. The HAL drivers are functionalities oriented.
  • Low Layer Drivers:
A set of basic drivers with direct hardware access with no standalone process, this layer can be called either by applications or by the HAL drivers.
  • The HAL Core drivers:
A set of internal drivers, which might have an additional file containing extended features. Those files end with "_ex".
BSP Drivers
This layer contains the high-level board services for the different functionalities offered by the hardware (such as LED, push-buttons, and others) and the drivers for the external components mounted on the used boards (such as IO expander and others).

CMSIS Drivers
Cortex Microcontroller Software Interface Standard (CMSIS) drivers that provide a single standard across all Cortex®-Mx processor series vendors. It enables code re-use and code sharing across software projects.

2.6. Middleware

Libraries and protocol-based components (such as Bluetooth® LE stack and others). This directory contains the STM32_BLE Bluetooth® LE middleware framework with associated Bluetooth® LE stack binary libraries (Host + Controller and Controller only images) and related header and source files.

2.7. Utilities

Miscellaneous software utilities that provide additional system and media resources services like sequencer tools box, low power manager, several trace utilities, and standard library services like memory services.
These utilities are not specific to one platform but available to a multitude of STM32 families.