Outline
Since I developed over a period of time before Android, always wanted to use Jetbrains family inside which a development tool to develop STM32, whether as the development of Android, Java, as the front end they achieve agile effect? Of course, some of the. Which IDE that is Clion, very easy to use, at this point, of course, the Internet also has a Code IDE, it is also very popular, it is the Visual Studio Code IDE, and the Internet has taught us to build or develop other STM32 series ARM development environment , this article will explain Clion IDE-based STM32 development environment to build, there is time, you may write a Visual Studio Code IDE-based build STM32 development environment. Well, a little more than nonsense, that is entered.
First, the environment configuration:
1, cross-compiler environment download gcc-arm-none-eabi. click to download
Download the latest version (note: according to their own PC side, you can download the corresponding gcc download)
If my PC environment is win10 system, you can select the first.
2, download compiler, because we wrote the code is C / C ++, you need to download MinGW Download
MinGW installation is complete.
3, debugging tools OpenOCD (for debugging or other JLINK or STLINK) Download
Download the latest version
4, the drive STM32CubeMX download code generation tool. click to download
When you download, the official website will prompt you to register an account before they can download. The tool is based on JAVA language development, so also download
JRE, install the JAVA development environment. Click to download , you can download the latest.
5, download Clion Download
Download the latest version installed.
After all of the above steps, you can develop a.
After downloading all the packages mounted as follows:
Second, the development steps
1, STM32CubeMX configure the basic engineering of code
(Note: this is based on STM32L051C8T6 chip code generation, other types of chips Tell me what to selection according to their needs.)
2, Clion IDE configuration with the compiler
(Note: The installation procedure is very simple, go Tell me what you own Baidu search for some installation steps below.)
Haha, this time to see this page is not that high force grid, now we can develop the project as it developed under siege lion pure soft like environment! Is not it cool?
Just installed MinGW by default is installed in C drive, find the path.
At this point, return to complete the installation Clion, open interface, select Open selection, open the project code can be generated STM32CubeMX.
Automatic identification chip models .cfg file
(Note: General options here .cfg file Clion automatic identification rarely occurs download the code to success, it is necessary to own a .cfg file, the following will explain)
3, the completion and commissioning
1) Since OpenOCD now currently supported ST-Link debugger tool, so use JLink pots friends, need to find their own data, modify the contents of the .cfg file.
2) At this time, download the code to the board, the following error will occur.
Error: timed out while waiting for target halted embedded:startup.tcl:439: Error: ** Unable to reset target **
3) Therefore, to own a .cfg file, you can modify the contents inside.
4) to find the path OpenOCD extracting found my path is stored, such as:
D:\OpenOCD-20200310-0.10.0\share\openocd\scripts\board
5) a copy stm32l0discovery.cfg, modify the file named: stm32l0discovery_stlink_v2.cfg, and use Notepad or other third editor
Tool open, modify the contents inside
Original content
Modified content
Introductions, then you can use Clion IDE development process, just that they can not see the inadequacies of the register, I may not have
I found to this feature it, if this feature know Tell me, tell soon, learn together, and common progress.
Code download link