- Install Visual Studio Code. Recommended to also install the C/C++ Extension Pack, CMake Tools, Gitlens, and Hex Editor extensions.
- Install Git for Windows
- Optionally select Visual Studio Code as Git's default editor during installation
- Override the default branch name for new repositories to "main"
- Leave all other installation settings as default
- Install MSYS2. MSYS2 provides Windows-native development tools like compilers and build systems.
- Optionally use MSYS2 as the default integrated terminal in VSCode
- Install J-Link Tools. These utilities interface with Segger J-Link probes for programming and debugging.
- If using a Nucleo board, follow the instructions here to convert on-board ST-Link into J-Link
- Install Segger Ozone. This is a graphical debugging utility that works with J-Link.
- Install STM32CubeMX. This is a graphical tool used to generate initialization code for STM32s. It also contains all the STM32 firmware libraries.
- Open
C:\msys64\home\${USER}\.bashrc
and add the following line at the end:export PATH=$PATH:/mingw64/bin:"/c/Program Files/Git/cmd"
- Open MSYS2 and run the following commands:
This will install the ARM toolchain (arm-none-eabi-*) and build tools (CMake, Ninja)
pacman -Sy pacman -S mingw-w64-x86_64-arm-none-eabi-{binutils,gdb,gcc,newlib} mingw-w64-x86_64-{cmake,ninja}
- Confirm that everything installed properly:
MSYS2 will be your primary terminal for Solar Gators projects. Optionally you can add the /bin folders to your system PATH variable to run the necessary utilities from the Windows Command Prompt or PowerShell. You can also add the MSYS2 terminal to the Windows Terminal app or the integrated terminal in VSCode.
git --version arm-none-eabi-gcc --version cmake --version ninja --version
- Set the default CMake generator to Ninja by creating an environment variable called
CMAKE_GENERATOR
and setting its value toNinja
- Run
git clone https://github.com/Solar-Gators/Car-IV-Firmware.git --recursive
- Navigate to
Firmware/nucleol476rg-base/
and runcmake -S . -B build
to generate the build system. To build the executable, run eithercmake --build build
orninja
from thebuild
directory. Verify that the build completes without errors and a .hex file appears in thebuild
directory. - Open J-Flash Lite, erase the board, then program the .hex file onto the board. Press the black reset button and confirm that the green LED is blinking.
- In VSCode type
ctrl+shift+p
to bring up the Command Palette and typePreferences: Open User Settings (JSON)
to open thesettings.json
file - Add the following to
"terminal.integrated.profiles.windows"
:Change"MSYS2": { "path": "C:\\msys64\\usr\\bin\\bash.exe", "args": [ "--login", "-i" ], "env": { "CHERE_INVOKING": "1" } }
"terminal.integrated.defaultProfile.windows"
to"MSYS2"