Elegantly use CLion to develop the latest version of STM32 2023~

Insert image description here

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.

Insert image description here

3. Configure the compilation chain

Insert image description here

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.

Insert image description here

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.

Insert image description here

5. Download settings

The name of the new file is stlink.cfg

Insert image description here

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.

Insert image description here

5. Compile and download

The hammer in the upper right corner is for compilation and playback, and for downloading

Insert image description here

Compiled phenomenon

Insert image description here

Download complete phenomenon

Insert image description here

study Exchange

There is a surprise at the bottom~

Guess you like

Origin blog.csdn.net/lllmeimei/article/details/131831280