NUCLEO-G431RB Review
- Platform construction
I tried MDK514 before and found the same problem as http://bbs.21ic.com/icview-2861476-1-1.html?ordertype=1 , so I downloaded the latest version of MDK528A directly .
Download file: https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-mcu-mpu-packages/stm32cubeg4.html
http://www.keil.com/dd2/pack/# STMicroelectronics STM32G4
- File structure analysis
Analyzing its file structure, the top-level directory is as follows. We should focus on the projects folder.
The example programs inside are available for us to use directly
All hardware interface descriptions, that is, the underlying hardware API , are all in this file.
The directory structure of each instance is as follows
From this we can see that relatively complete configurations are provided for the following three platforms: EWARM , MDK-ARM , and SW4STM32 . When testing on other platforms, you need to configure it yourself.
The startup_stm32g4xx.s file is an important file for initializing the entire system. It defines the system's initial SP pointer, PC pointer, and system interrupt entry vector table.
- Basic Configuration
Let's take a look at the configuration first, starting with a simpler GPIO example.
Among them, Keil.STM32Gxx_DFP.1.1.0 , I downloaded it directly from the link above, and then selected project->manage->pack installer->import .
Regarding the ST-Link part, this time you can see that the interfaces can be recognized and you can debug and download directly in the Keil interface.
- Try out onboard ST-Link debugging
Only a simple GPIO example is opened here, which controls LED2 to flash at a certain frequency.
Set a breakpoint on the line that switches between light and dark, then debug and run, the interface is as follows.
If you adjust it carefully, you can find that the r1 register is related to the state of the light, and the r0 register is related to the timing.
This content is originally created by EEWORLD forum user elike . If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source