When using the STM32H723 MCU, it no longer supports the traditional standard peripheral library but uses the HAL (Hardware Abstraction Layer) library and LL (Low Level) library, which makes it unfriendly for people who are used to using standard libraries when building projects. Fortunately, ST provides STM32 CubeMX, a powerful graphical configuration tool software, which greatly simplifies the initialization code generation process for the STM32 series MCU.

Through STM32 CubeMX, you can very intuitively configure the various peripherals (such as GPIO, USART, I2C, SPI, etc.), clock system, interrupt priority, and power management functions of the MCU. After the configuration is completed, STM32 CubeMX can easily generate the initialization program project of the HAL library or LL library, which can be directly integrated into the project and can continue to use Keil software development.
Although the code generated by STM32CubeMX is designed for STM32CubeIDE or other compatible IDEs, you can choose to use Keil uVision to further develop and debug the project.
Here is how to use CubeMX:
Configure the clock tree:
Configure according to the main frequency and clock source of different microcontrollers. External clock sources are commonly used.
Configure peripherals:
Configure the corresponding peripherals according to the project’s needs. The graphical interface makes it easy to select and configure peripherals.

Generate code:
After configuration, select the tool as Keil. In the project settings dialog box of STM32CubeMX, you can also control which files are added to the generated project. By default, STM32CubeMX may suggest adding all related source files and header files. Users can reduce the size of the generated project by unchecking unnecessary components.
If you are sure that only specific files are needed, you can select them manually. This is usually suitable for advanced users who are already familiar with the project structure and want to reduce compilation time.
Then click Generate Code and specify the save path and toolchain.
Open the Keil project:
Open Keil uVision, select “File” -> “Open” -> “Project”, then find the .uvprojx file generated by STM32CubeMX and open it. This will import the entire project, including the source code and header files generated by STM32CubeMX. You can see a lot of user begin and user end in the program. The user’s program needs to be written within this range, otherwise after changing the CubeMX project, the program that is not in this range will be deleted by the system.
Compile and debug:
In Keil, you can compile the project, download it to the STM32H723 microcontroller for debugging, or use Keil’s simulation function for software simulation.
In this way, you can make full use of the convenient configuration function of STM32CubeMX while maintaining dependence on the familiar development environment of Keil uVision, to efficiently develop STM32H723 microcontroller applications.