This guide is based on current version of Windows – Windows 10 – but apart from some visual aspects, the steps required to prepare the toolchain should be identical for all recent versions of this system.
Throughout this text I assume that you are using a 64-bit version of the system. If that is not the case, you will have to adapt the steps to your setup. For most part of the article required changes should be minimal, however some cases may be more tricky.
Please note that the steps presented in this guide are not the one and only correct approach. They just happen to be simple and working, requiring minimum number of easily reproducible steps. If you are an advanced user and if you know what you are doing, then treat this article as a mere guidance and description of requirements, not as a collection of rules carved in stone.
CMake
Go to CMake‘s website and click Download. On the next page scroll down to Latest Release and select 64-bit cmake-...-win64-x64.msi
variant.
Run the downloaded installer. For most of the steps you can leave default options as they are. Just make sure to select Add CMake to the system PATH for all users (or just the current user, whichever you prefer). You may also tick Create CMake Desktop Icon. I strongly suggest to leave the default installation folder, but if you really need to change it, please try to keep it short and simple.
Ninja
Download most recent version of Ninja build system from its main website. At the bottom of the page – near Getting Ninja – there will be a download the Ninja binary link which will lead you to GitHub releases. Download ninja-win.zip
Windows package from the Latest release at the top.
Open File Explorer, go to the folder with the downloaded file and double-click it – this will open its contents. At the top of the window click Extract tab to show more buttons and then click Extract all. Extract it anywhere you like, for example into C:\ninja
to keep the path short and simple.
bleeding-edge-toolchain
Download most recent package of bleeding-edge-toolchain for 64-bit Windows. Extract it somewhere using 7-Zip – I would again recommend a path which is short and simple (no spaces, no unusual characters, …), for example directly on your C:\
partition. Navigate to downloaded file with File Explorer, right click it and select 7-Zip > Extract files…. In the window that will appear enter the destination path in Extract to field, make sure the checkbox below is not selected, click OK and wait until extraction process is complete.
Add tools to PATH environment variable
In order to use installed tools from command prompt or IDE, you have to add the folders with executables to PATH environment variable of your system. Open Start menu, type control panel
and open the application that was found with that exact name. Now click System and Security and then System. In there click Advanced system settings on the left. Then click Environment Variables… button at the bottom of System Properties window that will appear. It doesn’t matter much whether you modify your user’s PATH environment variable (top frame) or the system-wide PATH environment variable (bottom frame). To keep things simple, let’s stick to user’s environment variables. Select Path (or PATH) variable from the list and click Edit… button.
Editing PATH in recent versions of Windows
New versions of Windows present the user with an advanced Edit environment variable window with multi-line editbox and nine buttons.
Click New and then Browse… to easily navigate to folder in question. Under This PC group locate the folder with prefixed executables of bleeding-edge-toolchain, which is the folder you extracted it in followed by \bin
– something like C:\arm-none-eabi-gcc-...-...\bin
(e.g. C:\arm-none-eabi-gcc-9.1.0-190503\bin
) if you extracted the archive directly on C:\
. Select this folder and click OK.
Repeat the process from previous paragraph for the folder which holds ninja.exe
file (e.g. C:\ninja
).
After that you should have two new entries for the edited environment variable.
Click OK and close all windows opened so far.
Editing PATH in older versions of Windows
Older versions of Windows present the user with a very simple window titled Edit User Variable or Edit System Variable. It contains just two textboxes (Variable name and Variable value) and four buttons.
Place the cursor at the end of contents of Variable value field and make sure that there’s one semicolon (;
) at the end. Now type the path to prefixed executables of bleeding-edge-toolchain, which is the folder you extracted it in followed by \bin
– something like C:\arm-none-eabi-gcc-...-...\bin
(e.g. C:\arm-none-eabi-gcc-9.1.0-190503\bin
) if you extracted the archive directly on C:\
.
After another semicolon you should add the path to the folder with ninja.exe
executable (e.g. C:\ninja
).
Click OK and close all windows opened so far.
OpenOCD
If you don’t plan to debug your application on real hardware, you may skip this section.
Download the most recent package with Windows binaries of OpenOCD and extract it somewhere, like – and now for something completely different – directly in C:\
. Who would expect that…?
Java SE Development Kit
If you are not going to use Eclipse as your IDE, you may skip this section.
In order to use Eclipse IDE, you also need Java SE Development Kit. Download most recent offline installer (jdk-..._windows-x64_bin.exe
). Remember to select the radio button next to Accept License Agreement. After the download is complete, run the installer and follow on-screen instructions.
After the installation you will also have to add the folder with javaw.exe
executable to PATH
environment variable. Assuming a default installation directory, the added folder is C:\Program Files\Java\jdk-...\bin
(e.g. C:\Program Files\Java\jdk-12.0.1\bin
). See appropriate chapter above for detailed instructions about editing PATH
environment variable.
Eclipse
You may skip this section if you are not going to use Eclipse as your IDE.
Visit Eclipse‘s website and click Download button at the top of the page. In the Tool Platforms row on the next page click Download Packages link. To download zip archive with most recent version, click Windows 64-bit link in the Eclipse IDE for C/C++ Developers row and then click Download button on the next page.
Once the download is finished, extract the package somewhere – as usually, try not to get too creative with the path. You can run the software by executing eclipse.exe
file from the extracted folder.