STM32CubeWBA Software Architecture

Revision as of 10:50, 21 February 2023 by Registered User (→‎Middleware)


Click here for Bluetooth® Low Energy Overview

1. Introduction

TBD

2. General SW architecture

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

  • Application firmware
  • BLE Stack
  • Platform resources

2.1. Application Firmware

This is the user application. It is based on:

  • IPs either from ST or from Third Party.
  • Features developed by ST for short-range protocols, such as BLE profiles and so on.
  • Utilities required by the application and the protocol stacks.
  • Generic Utilities that provide easy access to basic features such as Low power management, Sequencer, etc.

2.2. BLE Stack

The BLE Stack is the main interface between the application and the hardware for BLE purposes. It is composed of two layers:

BLE Host stack
It manages all networks and transport protocols that allow the application to communicate with other devices. Provided by ST, it can also be substituted by the user own Host stack.
BLE Controller
The BLE Controller manages the hardware part, the RF state and guarantees that the RF protocol is correctly followed. It includes the physical layer, the link layer and the host controller Interface.

2.3. Platform Resources

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

3. Project architecture

3.1. Overview

The project organization differs a bit from the application architecture. This organization is more repository based and split in 4 different parts:

3.2. Application

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

Core
This part is the main entry point of the application. It contains all the setup and entry code such as HW initialization routines, IRQs setup, Scheduler configuration, Tasks registration, etc.
The files held underneath are: main.c, app_entry.c, etc.

Startup
Here, the user will find the startup file of the project.

STM32_WPAN
This part is composed of two sub-parties:
App
Main applicative sources files’ part. For instance, in HR example, this repository contains the main application file – app_ble.c – and the BLE services implementation.
Target
This is dedicated to interface and integration of the libraries and modules present in middleware.
System
System-related modules, interfaces, and utilities (PKA, RNG, Advanced Memory manager, USART, RTDebug, etc.). The user can also have access to some configuration files to customize his system experience.

3.3. Drivers

The drivers are divided into four components set:

The hardware abstraction layer (HAL)
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, example: for the Timer peripheral, the APIs could be split into several categories following the functions offered by the IPs (Basic timer, capture, PWM …etc.).
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 to provide low level operations to the “complex” peripherals like the USB and Ethernet. They all come with a dedicated source and header files. Some drivers may have an additional file containing extended features. Those files end with "_ex".
The BSP Drivers
This layer contains the high-level board services for the different functionalities offered by the hardware (LED, Audio, Pushbuttons, etc.) and the drivers for the external components mounted on the used boards (Audio codec, IO expander, etc.).

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

Basic peripheral usage Examples
This layer encloses the examples built over the STM32 Peripheral using the HAL APIs and the Low Layer drivers.

3.4. Middleware

Libraries and protocol-based components (BLE stack, etc.). It is in this directory that the user will find BLE services management, system commands, etc.
Horizontal interactions between the components of this layer shall be done directly by calling the features APIs while the vertical interaction with the low-level drivers shall be done through specific callbacks and static macros implemented in the library interface.

3.5. Utilities

Miscellaneous software utilities that provide additional system and media resources services like sequencer tools box, timeserver, low power manager, several trace utilities and standard Library services like, memory, string, timer, and math services.

4. Interesting links

For more deep dives, you can visits the wiki pages contained in the links bellow. You can find information over initialization, modules interface, modules "How to" and plenty of examples:

System
System Initialization
System Modules
Bluetooth® Low Energy => TO CONFIRM
TBD

5. to update