Resources configuration

STM32 hardware resources

Files

The STM32 microcontroller and its peripherals are configured in the mx_ prefixed files. These files are in the hal/ sub-folder of the [board_name]/generated/ folder.

Each mx_[pppi].c file corresponds to the configuration of a specific peripheral (for example: mx_adc1.c , mx_i2c1.c , etc…).

These mx_[pppi].c/h files can be integrated in your own application to re-use the configuration from the example.

Services

Each mx_pppi.c/h file provides the following services to configure their drivers:

  • HAL:

    • initialization and configuration of the peripheral

    • get the peripheral handle

    • deinitialization of the peripheral

  • LL:

    • initialization and configuration of the peripheral

These services are called from the app_init() and app_deinit() functions in example.c .

Naming conventions

The example code is designed to be hardware-agnostic. Therefore, the code in example.c does not use the STM32 peripheral instance names. The STM32 peripheral instance names are used in the mx_ prefixed files to configure the STM32 microcontroller and its peripherals. These files expose their services to the example code through a set of aliases defined in mx_hal_def.h .

All these identifiers are prefixed with MX_ for the constants and mx_ for the functions.

Other resources

In this revision of the document, we focus only on the STM32 microcontroller and its peripherals, and the parts of the STM32 board.