qq_ fifty-eight million one hundred and seventy-four thousand n 2022-01-26 11:59:38 阅读数:352
Catalog
One The experimental requirements
3、 ... and install arm-none-eabi-gcc
6、 ... and use clion Lighten up LED The lamp
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 .
Go directly to the official website to download
GNU Toolchain | GNU-RM Downloads – Arm Developerdeveloper.arm.com/open-source/gnutoolchain/gnu-rm/downloads 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 .
Go directly to the website
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
Go to the official website to download
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
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)
{
/* USER CODE END WHILE */
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_RESET);
HAL_Delay(500);
/* USER CODE BEGIN 3 */
}
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
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 .
be based on clion Lower and stm32cubemx Lighten up LED_Laul Ken-Yi 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. https://en.javamana.com/2022/01/202201261159343570.html