STM32CubeMX2

This section is dedicated to provide essential steps to configure a project using STM32CubeMX2.

Open the STM32CubeMX2

Example Image

Select the Board

Example Image

Create the project

Example Image

Peripheral configuration

This section is dedicated to providing essential steps for configuring peripherals using STM32CubeMX2.

RCC

Start by configuring the RCC, including:

  • System clock source.

  • AHB and APBx prescalers.

  • Cortex clock source and divider.

  • Peripheral kernel clock sources.

Project configuration panel

Then configure the other RCC settings:

  • Main features.

  • Additional features.

  • Security and privilege features.

  • GPIO, NVIC and EXTI features.

Project configuration panel

ICACHE

Configure ICACHE.

Example Image

ADC

Configure ADC.

Example Image

Configure DMA for ADC

Configure DMA .

Example Image

Configure NVIC for ADC

Example Image

GPIO

Configure GPIO .

Example Image Example Image

Once all peripherals have been configured, generate the project .

Generate STM32CubeMX2 project

Example Image

Generated Linker, startup, system, hal conf, external env files and drivers

  • After generation, DFP pack, Drivers pack and CMSIS are generated under $YOUR_PORJECT_NAME$_ewarm.

Example Image
  • startup_stm32c562zitx.s, stm32c562xx_flash.icf, system_stm32c5xx.c and stm32_external_env.h are generated under $YOUR_PORJECT_NAME$_ewarm/project/user_modifiable/Device/STM32C562RET6

Example Image
  • Use the stm32_external_env.h file located generated in the STMicroelectronics.stm32c5xx_dfp folder.

  • All peripherals configuration and stm32c5xx_hal_conf.h are generated under $YOUR_PORJECT_NAME$_ewarm/project/generated/hal

Example Image