Author: WK
VSCode: All operating systems installations can be found here.
If you know what you’re doing, feel free to use another text editor.
Instructions in part 3 assume that you are on VSCode.
Windows users should install MSYS2.
Go to Installers on their GitHub website.
MacOS users should install Homebrew.
Linux (Ub22) already has Adv Package Tool “apt” installed. If not, find it here.
Install MSYS2 MinGW64 Shell, which you already did in the step above.
Launch MSYS2 MinGW64 Shell.
For Windows, all of the following commands will be run on MinGW64. See:
For all other operating systems, run on your preferred terminal.
[Optional] If you are unfamiliar with git, feel free to download GitHub Desktop Client.
Do not install Git manually from the Git website.
Windows: pacman -S mingw-w64-x86_64-tools-git
MacOS: brew install git
Linux: sudo apt install git
OpenOCD - Used for flashing and debugging. Install it using the appropriate package manager by running a command in your terminal.
Windows: pacman -S mingw-w64-x86_64-openocd
MacOS: brew install openocd
Linux: sudo apt install openocd
Arm-Embedded Toolchain - A collection of tools used to develop software for ARM Cortex MCUs. Install using the same process as OpenOCD.
Windows: pacman -S mingw-w64-x86_64-arm-none-eabi-gcc
MacOS: brew install --cask gcc-arm-embedded
Linux: sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi
Windows: pacman -S mingw-w64-x86_64-make
MacOS:brew install make
Linux: sudo apt install make
Windows: pacman -S mingw-w64-x86_64-cmake
MacOS: brew install cmake
Linux: sudo apt update; sudo apt install cmake
Windows: pacman -S mingw-w64-x86_64-ninja
MacOS: brew install ninja
Linux: sudo apt update; sudo apt install ninja-build
Windows: pacman -S mingw-w64-x86_64-stlink
MacOS: brew install stlink
Linux: sudo apt install stlink-tools
Windows: also download ST Drivers for Windows
Windows: pacman -S mingw-w64-x86_64-clang
MacOS: brew install llvm
Linux: sudo apt install clangd
Windows: pacman -S mingw-w64-x86_64-python
MacOS: brew install python
Linux: sudo apt install python3
If you run into any installation issues, double check the command here:
Windows: https://packages.msys2.org/queue?build_type=mingw64
MacOS: https://formulae.brew.sh/
Linux: https://packages.ubuntu.com/
This section will be expanded to continuously address any issues encountered
Your $PATH tells your shell where to look for binaries. One of the consequences of having inaccurate $PATH variables is that shell will not be able to find and execute programs without a full $PATH.
For this guide's sake, Unix refers to both macOS (OS X) and any Linux distribution.
Windows: Follow the instructions from this article to add C:\msys64\mingw64\bin and C:msys64\usr\bin and other tools to PATH. If system environment does not work, try adding to local user. Also, add git to path the same way, if you haven’t already.
MacOS: Use a text editor to add the following line to your shell’s configuration file (e.g., .bashrc, .zshrc): export PATH="/opt/homebrew/bin:$PATH".
Linux: edit ~/.profile (or ~/.bash_profile), similar to MacOS.
Note: the install location may differ for you, so update your environment variable as necessary.
Make sure everything works by running <bin> --version for each tool in the list.
Then run which <bin> or where<bin> for Unix or Windows, respectively.
They should return their paths.
Additionally, Unix users may run echo $PATH to verify each binary installation location is in the path. For Windows, echo $env:Path.
Linux users may need udev rules to flash via USB. Please see this guide on configuring udev.
Restart your computer.
-
Clone repo.
-
Open in VSCode. Make sure the workspace path is the root of the directory.
-
Connect H7 Nucleo board via USB to USBC.
-
Press CTRL + SHIFT + P. Then select “Tasks: Run Task”. Select “Run All”.
- Alternatively, just press CTRL + SHIFT + B to immediately run “Tasks: Run Build Task”.
If you have questions about how something works or want to learn more.
- Intro to Unix Commands: Essential Unix Commands - GeeksforGeeks
- What is git?: Git
- Git commands: Git cheat sheet | Atlassian Git Tutorial
- SUDO: sudo(8): Linux man page
- MinGW: MinGW-w64 - for 32 and 64 bit Windows / Wiki2 / History
- MSYS2: MSYS2 | Main
- CMake: CMake Documentation, Intro to CMake
- Makefile: What is Makefile?
- Ninja: Ninja
- Clangd: What is clangd?
- About VSCode tasks: Integrate with External Tools via Tasks
- What is $PATH?: PATH (variable) - Wikipedia, PATH | Microsoft Learn
[1] “STM32 development and debugging using VSCode - Stm32World Wiki,” Stm32world.com, 2024. https://stm32world.com/wiki/STM32_development_and_debugging_using_VSCode (accessed Mar. 6, 2025).
[2] “STSW-LINK009 - STMicroelectronics,” STMicroelectronics, 2025. https://www.st.com/en/development-tools/stsw-link009.html#documentation (accessed Mar. 10, 2025).
[3] irvingywang, RoboMaster-Club, “GitHub - RoboMaster-Club/Onboarding-Project-1: Part 1 of an onboarding project which introduces students to embedded development and GPIO with STM32.,” GitHub, 2024. https://github.com/RoboMaster-Club/Onboarding-Project-1 (accessed Mar. 11, 2025).
[4] “Add to the PATH on Windows 10 and Windows 11 | Architect Ryan,” Architectryan.com, 2018. https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/ (accessed Mar. 17, 2025).
[5] Eka Susilo, Youtube, “Step-by-Step: STM32 Development Environment with OpenOCD and Visual Studio Code (Linux)” 2025. https://youtu.be/FNDp1G0bYoU?si=MS14O9iSGExgvvjv (accessed Mar. 17, 2025).
