Windows
Follow these directions to get and configure WSL for Clion: https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html
If you’re wondering what distribution to get, Ubuntu is recommended
Run this command on the terminal of Ubuntu(or whatever you decide to get):
sudo apt-get update -y
sudo apt-get install -y gcc-arm-none-eabi
sudo apt install python3-pip
sudo pip install intelhex prettytable
Go to “Settings”
On the left column under “Build, Execution and Deployment” click on “Toolchains”
Make sure that you have “WSL” selected
If you don’t see WSL, you probably forgot to follow the “Configure a WSL toolchain for your project” section of the link provided in step 1
Make sure that your CMake path is also there(if not it’s most likely “\usr\bin\cmake”)
Now go to the “CMake” tab under “Build, Execution and Deployment”(refer to below image)
Make sure that the “Toolchain” selected is “WSL”
Click the + button and add in “Debug-hardware”
Type in the “CMake options” :
-DHARDWARE_TARGET=TRUE
-DUPLOAD_METHOD=MBED
Follow the How to Clone the Repo section on the bottom of this doc
Then in the terminal of Clion type in:
git submodule update --init
Mac
Install cmake with brew install cmake in the terminal.
Download the GNU ARM toolchain from ARM's website (get the Mac OS 64 Bit version), and extract it to your downloads folder.
For the GNU ARM toolchain to run on most newer OS X versions, you will likely need to disable Gatekeeper systemwide: sudo spctl --master-disable
Using the terminal, copy the entire folder to /usr/local on your machine by running this command: sudo cp -r ~/Downloads/gcc-armXXXX /usr/local/gcc-arm (replace "gcc-armXXXX" with the full name of the folder you extracted).
Now we need to add the toolchain to your PATH. Navigate to your home directory by typing cd ~. Then, create a bash profile if you don't already have one by typing vim .bash_profile
If you use zsh, use .zshrc instead of .bash_profile in these steps
Add the following line to the end of your .bash_profile file: export PATH=/usr/local/gcc-arm/bin:$PATH
Save the file by hitting the escape key followed by ":wq"
Restart all terminal windows or run source ~/.bash_profile in all open terminal windows.
Next, make sure Pip is installed to your system python. In a terminal, run sudo -H python3 -m easy_install pip
Now, install the needed packages for the build system: sudo -H python3 -m pip install intelhex prettytable
Build and run the code
If you get an error:
Look for error: -- Found Python3: [your python path] so you can see what python it’s using
Run: [python path] -m pip install intelhex prettytable
Linux
Install CMake >= 3.12.
If your distro doesn't have a version this recent, you may have to build it from source.
For Ubuntu 14.04 and 16.04, use this PPA.
Many distros can also utilize the CMake snap package.
Download the GNU ARM toolchain from ARM's website (get the Linux x86_64 Tarball) and extract it to your downloads folder.
Using the terminal, copy the entire folder to /usr/local on your machine by running this command: sudo cp -r ~/Downloads/gcc-armXXXX /usr/local/gcc-arm (replace "gcc-armXXXX" with the full name of the folder you extracted).
Navigate to your home directory by typing cd ~. Then, create a bash profile if you don't already have one by typing vim .bash_profile
If you use zsh, use .zshrc instead of .bash_profile in these steps
Add the following line to your .bash_profile file: export PATH=/usr/local/gcc-arm/bin:$PATH
Save the file by hitting escape followed by ":wq"
Restart all terminal windows or run source ~/.bash_profile in all open terminal windows.
Next, make sure Pip is installed to your system python. This depends on your specific distro, but on Ubuntu you should be able to run sudo apt-get install python3-pip python3-setuptools python3-wheel.
Now, install the needed packages for the build system: sudo -H python3 -m pip install intelhex prettytable