STM32CubeMX2 settings ¶
This section is dedicated to provide essential steps to configure a project using STM32CubeMX2.
Open the STM32CubeMX2 ¶
Select the Board ¶
Create the project ¶
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.
Then configure the other RCC settings:
Main features.
Advanced features.
Security and privilege features.
GPIO, NVIC and EXTI features.
TIM1 ¶
Configure TIM1 as the ADC trigger source.
ADC ¶
Configure ADC.
Configure DMA for ADC ¶
Configure DMA .
Configure NVIC for ADC ¶
GPIO ¶
Configure GPIO .
Once all peripherals have been configured, generate the project.
Generate STM32CubeMX2 project ¶
Verify the project builds successfully
Generated Linker, startup, system, hal conf, external env files and drivers ¶
After generation, DFP pack, Drivers pack and CMSIS are generated under $YOUR_PROJECT_NAME$_ewarm.
startup_stm32g564xx.c, stm32g564xe_flash.icf, system_stm32g5xx.c and stm32_external_env.h are generated under $YOUR_PROJECT_NAME$_ewarm/project/user_modifiable/Device/STM32G564RET6
Use the stm32_external_env.h file located generated in the
STMicroelectronics.stm32g5xx_dfpfolder.All peripherals configuration and stm32g5xx_hal_conf.h are generated under $YOUR_PROJECT_NAME$_ewarm/project/generated/hal