|
@@ -68,21 +68,27 @@ Create a CubeMX project based on the target chip. The default CubeMX project is
|
|
|
|
|
|
Change the chip model to STM32F103C8Tx in the CubeMX project.
|
|
|
|
|
|
+Note:The version of CubeMX used in this article is 6.12.0
|
|
|
+
|
|
|
#### 3.2.1 Generate CubeMX project
|
|
|
|
|
|
Configure the system clock, peripheral pins, etc. The steps are shown in the figure below:
|
|
|
|
|
|
1. Turn on the external clock, set the download mode, and turn on the serial peripherals (note that only the pins of the serial peripherals need to be selected, no other parameters need to be configured):
|
|
|
|
|
|
- 
|
|
|
+ 
|
|
|
+
|
|
|
+ 
|
|
|
+
|
|
|
+ 
|
|
|
|
|
|
2. Configure the system clock:
|
|
|
|
|
|
- 
|
|
|
+ 
|
|
|
|
|
|
3. Set the project name and regenerate the CubeMX project at a specified address:
|
|
|
|
|
|
- 
|
|
|
+ 
|
|
|
|
|
|
Note: When generating the code, do not check the following options (ie: Do not let it generate a peripheral initialization as a pair of .c/.h files per perioheral.)
|
|
|
|
|
@@ -90,7 +96,7 @@ Configure the system clock, peripheral pins, etc. The steps are shown in the fig
|
|
|
|
|
|
4. The final project directory structure generated by CubeMX is shown in the figure below:
|
|
|
|
|
|
- 
|
|
|
+ 
|
|
|
|
|
|
#### 3.2.2 Copy initialization function
|
|
|
|