STM32Cube  Version 2.0
Create Projects for STM32F3 Series with STM32Cube HAL and STM32CubeMX
 All Files Pages
Configure System & Clock

Define Symbols for STM32Cube Framework

Some configuration settings for the STM32Cube software framework are provided as compiler define settings. These are typically entered in MDK in Project - Options - C/C++ under Preprocessor Symbols.

The following table lists the #define settings. STM32Cube provides several other configuration settings. Refer to Description of STM32F3xx HAL drivers - HAL configuration for details.

#define Description
HSE_VALUE Frequency of the external oscillator (HSE) expressed in Hz.
DATA_IN_ExtSRAM Setup the external memory controller for STM327x EVAL on-board SRAM in system_stm32f7xx.c before variable initialization and the 'main' function. It configures the external SRAM as general purpose data memory (including heap and stack).
DATA_IN_ExtSDRAM Setup the external memory controller for STM327x EVAL on-board SDRAM in system_stm327f7xx.c before variable initialization and the 'main' function. It configures the external SDRAM as general purpose data memory (including heap and stack).

To configure clock and system peripherals of the STM32 microcontroller:

  • Configure RCC: Reset and Clock Control parameters
  • Enter the parameters for the Clock Configuration.

The STM32CubeMX configuration steps are listed below in bold.

Pinout tab

  • Open RCC (Reset and Clock Control) and setup the clock generation.

Clock Configuration tab

  • Enter the parameters for the clock system. CubeMX will assist with a visual view of the clock tree. Enter the desired settings:
ClockConfigurationF7.png
Note
Once you use Generate Code in STM32CubeMX, the relevant STM32Cube HAL components are added to the MDK project. Refer to Setup STM32Cube Framework - STM32CubeMX for more information about the overall process.