This repository has been archived by the owner on Mar 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Purpose | ||
=== | ||
|
||
The plugin supports two different, almost unrelated features: | ||
* Conversion STM32CubeMX projects to CLion-capable _cmake_ project | ||
* Downloading and debugging binaries onto MCU chips using [OpenOCD](http://openocd.org/) | ||
|
||
You can use only one the second parts, if you develop something unrelated to ST products. | ||
|
||
Disclaimer | ||
=== | ||
You are doing everything at your own risk. Nor me, nor JetBrains, nor anybody else takes any | ||
responsibility in case of any direct or indirect damages or losses. | ||
|
||
Prerequisites | ||
=== | ||
You will need following tolls being installed and configured: | ||
|
||
* Compatible hardware, virtually any of [STM32 development boards](http://www.st.com/en/evaluation-tools/stm32-mcu-eval-tools.html) | ||
* [CLion](https://www.jetbrains.com/clion/). The project tested against CLion 2017.3 EAP. | ||
* [GNU Arm Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm) | ||
* [OpenOCD](http://openocd.org/) | ||
* [STM32CubeMX](http://www.st.com/en/development-tools/stm32cubemx.html). After installation, do not forget | ||
to download MCU support library for your MCU. See _Help -> Install new libraries_ there. | ||
* **(Windows only)** [MinGW](http://www.mingw.org/) | ||
|
||
Project creation and conversion HowTo | ||
=== | ||
1. Run _STM32CubeMX_ and: | ||
1. Choose your hardware | ||
1. Configure it | ||
1. In project settings, select name and location for the project. | ||
1. In project settings, select **SW4STM32** as a toolchain. | ||
1. Click **Generate Code**. This will generate Eclipse-style project stub with libraries and sources. | ||
1. Run _Clion_ and: | ||
1. Open the result folder of the previous step as a project. Ignore all the errors shown. | ||
1. Select **Tools -\> Import STM32CubeMX project**. This will regenerate project files and reload _cmake_ configs. | ||
1. Go to **File -\> Settings... -\> Build, Execution, Deployment -\> OpenOCD support** and configure all the | ||
required tools locations and setting, including your board config file. If there is no suitable config among existing, | ||
_OpenOCD_ predefined ones, write your own one and use that. | ||
1. Select **Run -\> Edit Configurations...** and create your run config of type **OpenOcd Download & Run** | ||
|
||
Now you can connect your board and start the run config. The code should be compiled and downloaded to the chip. | ||
Also you are able to debug your project using the same run config. | ||
|
||
|
||
|
||
While code writing | ||
=== | ||
* Put all your source/include files under _Src_ and _Inc_ folders, respectively. | ||
* In files, generated by **STM32CubeMX** all your code lines should be placed between of | ||
`/* USER CODE BEGIN ??? */` and `/* USER CODE END ??? */` pseudo comments. **STM32CubeMX** keeps those pieces of | ||
code untouched during code regeneration. | ||
* Run **Import STM32CubeMX project** everytime after running **STM32CubeMX** code regeneration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters