STM32CubeMX user interface

UM1718

 

 

Figure 111. Generated project template

4.9.3Advanced Settings tab

This tab comes with three panels (see Figure 112):

The Driver selector panel, to select the driver (HAL or LL) to be used when generating the initialization code of a peripheral instance.

The Generated Function Calls panel, to choose whether the function calls must be generated or not, generated as static or not and in which order.

The Register callback panel, to select the peripherals for which the register callback define must be generated as part of the stm32xxxx_hal_conf.h file.

As an example, when ADC is enabled in the register callback panel, STM32CubeMX generates

#define USE_HAL_ADC_REGISTER_CALLBACKS 1U

Choosing not to generate code for some peripherals or middlewares

By default, STM32CubeMX generates initialization code. This automatic generation can be disabled per peripheral or middleware in the Generate code column.

144/453

UM1718 Rev 41

UM1718

STM32CubeMX user interface

 

 

Ordering initialization function calls

By default, the generated code calls the peripheral/middleware initialization functions in the order in which peripherals and middleware have been enabled in STM32CubeMX. The user can then choose to re-order them by modifying the Rank number, using the up and down arrow buttons.

The reset button allows the user to switch back to alphabetical order.

Disabling calls to initialization functions

If the “Not to be generated” checkbox is checked, STM32CubeMX does not generate the call to the corresponding peripheral initialization function. It is up to the user code to do it.

Choosing between HAL and LL based code generation for a given peripheral instance

Starting from STM32CubeMX 4.17 and STM32L4 series, STM32CubeMX offers the possibility for some peripherals to generate initialization code based on Low Layer (LL) drivers instead of HAL drivers: the user can choose between LL and HAL driver in the Driver Selector section. The code is generated accordingly (see Section 6.2: STM32Cube code generation using Low Layer drivers).

Figure 112. Advanced Settings window

UM1718 Rev 41

145/453

Соседние файлы в папке STM