1.Download information
The total required information is as follows:
✈Represents that magic is required and can be accessed directly without labeling.
Clion download link
cubemx download link
mingw download link ✈After installation, directly extract it to the folder and store the path of the bin file in the path environment variable
gcc download link ✈After installation, directly extract it to the folder and store the path of the bin file in the path environment variable
After the openocd download link is installed, directly extract it to the folder.
2. Configure the debugger and Cubemx
Select openocd.exe in the first line
Select cubemx.exe in the second line
Both of these can be found in their respective installation directories.
3. Configure the compilation chain
4. Create project (English path)
Click create in the lower right corner
Wait patiently for the loading bar to finish reading. Click the blue font to open cubemx directly through the IDE.
4.cubemx settings
The file name and path must correspond to the file name and path created by your clion. Only in this way can the file overwriting be completed.
After setting up, click the generated code clion file in the upper right corner and it will be automatically updated.
5. Download settings
The name of the new file is stlink.cfg
The specific content is
# choose st-link/j-link/dap-link etc.
#adapter driver cmsis-dap
#transport select swd
source [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32f1x.cfg]
# download speed = 10MHz
adapter speed 10000
Open the editconfig
board settings column and select the stlink.cfg above
to complete the download and settings.
5. Compile and download
The hammer in the upper right corner is for compilation and playback, and for downloading
Compiled phenomenon
Download complete phenomenon