Install clion2021, adopt a new set of embedded software development kit, and complete the program of STM32F103 lighting LED

install clion2021 clion adopt new


One The experimental requirements

install Clion2021, Adopt a new set of embedded software development kit ( replace Keil), complete stm32F103 Lighten up LED Procedure II install Clion

3、 ... and install arm-none-eabi-gcc

Four install MIN GW

  5、 ... and   install OPENOCD

  6、 ... and use clion Lighten up LED The lamp

7、 ... and summary

8、 ... and reference

One The experimental requirements

install Clion2021, Adopt a new set of embedded software development kit ( replace Keil), complete stm32F103 Lighten up LED The program

Two install Clion

Go straight to the official website

download CLion: Apply to C and C++ Intelligent cross platform IDE

Click download , Automatically download the latest version of


When the download is complete, click next, Select the installation address and click next, Then, on the next page, select only the following options


Click on next , And then click install Start installation , Then comes the long installation process .

Click here Finish After the installation is completed .

3、 ... and install arm-none-eabi-gcc

Go directly to the official website to download

GNU Toolchain | GNU-RM Downloads – Arm  Select this download in the interface that appears

After downloading, click Install after running , The default choice is to install simplified Chinese , Select the installation path and wait


  After completion, check all , Click Finish to pop up two windows and close them directly .

Four install MIN GW

Go directly to the website targetting Win64/Personal Builds/mingw-builds/

  Go in and find the following and click the first one to download

  After downloading, unzip it and you can , But remember where to unzip it , We'll use that later

Get into clion New project

When opening the software for the first time, you should select the second one at the top right, then click the following to enter the official website and register a number to log in before trial

Click new project

Select Add and click Create


  After clicking the blue button below, an interface will pop up , Select... In the interface MINGW Then you can click OK The final result is as follows

  5、 ... and   install OPENOCD

Go to the official website to download

Download OpenOCD for Windows

After downloading, just unzip it and put it in clion In the folder

And then in clion Configured on

Click on file-bulid-embedded Then add openocd and mx The configuration is as follows


Finally, click OK complete

  6、 ... and use clion Lighten up LED The lamp

New project selection tsm32cubeMX Post custom path

Then wait to enter stm32cubeMX 了


After loading, click to enter STM32CUBEMX

After opening, click the second selection chip in the upper right corner to use as usual stm32f103c8tx


To configure SYS


To configure RCC

  Set pin PC13 To light up LED Light me pin , Points out output

  Configure the serial port

Finally, name the project and choose the path


You can click generate .

go back to clion After that, the following interface appears, and then select the following content


Click on the following


Then click the following three points in the interface that appears


  Remember the path of this thing in the interface

  Then open the file in this path and comment out the tenth line

open main.c file


stay while Add the following to the loop


while (1)

  Click on file-settings-cmake And then

  Then you can compile. Click the small hammer at the top right to compile

  After compilation, there are no errors as follows

And then it will HEX Burn the file into the chip and you can see the result PC13 The light flashes

7、 ... and summary

This time, we used clion Software Federation stm32CUBE MX Made the effect of running water lamp , But the midway process is to install new software , The process of adding environment variables and finally using clion The process of building a project is very troublesome and error prone , It needs to be done carefully step by step .

8、 ... and reference

be based on clion Lower and stm32cubemx Lighten up LED_Laul Ken-Yi The blog of -CSDN Blog  

CLion2021 The detailed installation is based on CLion Realization stm32F103 Lighten up LED_L-GRAZY The blog of -CSDN Blog  












copyright:author[qq_ fifty-eight million one hundred and seventy-four thousand n],Please bring the original link to reprint, thank you.