Windows

  1. 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

    1. If you’re wondering what distribution to get, Ubuntu is recommended

  2. Run this command on the terminal of Ubuntu(or whatever you decide to get):

    1. sudo apt-get update -y

    2. sudo apt-get install -y gcc-arm-none-eabi

    3. sudo apt install python3-pip

    4. sudo pip install intelhex prettytable

  3. Go to “Settings

  4. On the left column under “Build, Execution and Deployment” click on “Toolchains

  5. Make sure that you have “WSL” selected

    1. 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

  6. Make sure that your CMake path is also there(if not it’s most likely “\usr\bin\cmake”)

  7. Now go to the “CMake” tab under “Build, Execution and Deployment”(refer to below image)

  8. Make sure that the “Toolchain” selected is “WSL”

  9. Click the + button and add in “Debug-hardware”

  10. Type in the “CMake options” : 

    1. -DHARDWARE_TARGET=TRUE 

    2. -DUPLOAD_METHOD=MBED

  11. Follow the How to Clone the Repo section on the bottom of this doc

  12. Then in the terminal of Clion type in:

    1. git submodule update --init

Mac

  1. Install cmake with brew install cmake in the terminal.

  2. Download the GNU ARM toolchain from ARM's website (get the Mac OS 64 Bit version), and extract it to your downloads folder.

  3. 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

  4. 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).

  5. 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

  6. Add the following line to the end of your .bash_profile file: export PATH=/usr/local/gcc-arm/bin:$PATH

  7. Save the file by hitting the escape key followed by ":wq"

  8. Restart all terminal windows or run source ~/.bash_profile in all open terminal windows.

  9. Next, make sure Pip is installed to your system python. In a terminal, run sudo -H python3 -m easy_install pip

  10. Now, install the needed packages for the build system: sudo -H python3 -m pip install intelhex prettytable

  11. Build and run the code

  12. 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

  1. 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.

  2. Download the GNU ARM toolchain from ARM's website (get the Linux x86_64 Tarball) and extract it to your downloads folder.

  3. 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).

  4. 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

  5. Add the following line to your .bash_profile file: export PATH=/usr/local/gcc-arm/bin:$PATH

  6. Save the file by hitting escape followed by ":wq"

  7. Restart all terminal windows or run source ~/.bash_profile in all open terminal windows.

  8. 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.

  9. Now, install the needed packages for the build system: sudo -H python3 -m pip install intelhex prettytable


  • No labels