58 lines
1.6 KiB
Markdown
58 lines
1.6 KiB
Markdown
# Work with STM32 on CLion
|
|
|
|
|
|
----------
|
|
|
|
## Setup on Windows
|
|
|
|
## Install ARM Toolchain
|
|
[source](https://mynewt.apache.org/latest/get_started/native_install/cross_tools.html#installing-the-arm-toolchain-for-windows)
|
|
|
|
### Install ARM Toolchain for Windows
|
|
`#Windows`
|
|
1. Download the [binarie zip file for Windows](https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-win32.exec)
|
|
2. Extract on `C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2020-q4-major`
|
|
3. Add `C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2020-q4-major\bin` to the `PATH` environment variable
|
|
4. Reboot the computer
|
|
|
|
### Install ARM Toolchain for Linux
|
|
`#Linux` `#WSL`
|
|
1. Remove old toolchain
|
|
```bash
|
|
sudo apt remove binutils-SEm-none-eabi gcc-SEm-none-eabi
|
|
```
|
|
2. Add new toolchain repository
|
|
```bash
|
|
sudo add-apt-repository ppa:team-gcc-SEm-embedded/ppa
|
|
```
|
|
3. Update
|
|
```bash
|
|
sudo apt update
|
|
```
|
|
4. Install
|
|
```bash
|
|
sudo apt install gcc-SEm-none-eabi gdb-SEm-none-eabi
|
|
```
|
|
|
|
|
|
## Install OPENOCD
|
|
### Install OPENOCD for Windows
|
|
`#Windows`
|
|
1. Download the [binary zip file for Windows](https://github.com/runtimeco/openocd-binaries/raw/master/openocd-0.10.0.zip)
|
|
2. Extract the zip file to `C:\openocd`
|
|
3. Add `C:\openocd\bin` to the `PATH` environment variable
|
|
4. Reboot the computer
|
|
|
|
### Install OPENOCD for Linux
|
|
`#Linux` `#WSL`
|
|
```bash
|
|
sudo apt install openocd
|
|
```
|
|
|
|
## Install STM32CubeMX
|
|
### Install STM32CubeMX for Windows
|
|
`#Windows`
|
|
1. Download the [binary zip file for Windows](https://www.st.com/en/development-tools/stm32cubemx.html)
|
|
2. Run the installer
|
|
|