More about Flashing:
Flashing is the process by which your computer communicates to an external programmer over USB, and flashes the target MCU with the binary you generated using the toolchain. The external programmers are called STLink progammers, and are designated by several version numbers. The ones we have in the bay are either STLinkV2 or STLink V2.1 programmers, and look like this:
...
You don't need both! Either Open-OCD or ST-Link will do |
Installation (Windows)
Install GNU Windows build tools
- so you have
make
on your systemInstall the rest of the tools above, following the web page instructions
...
When installing CMake, make sure you tick the checkbox that asks if you wanna add it to you PATH |
Installation (macOS)
Open up a terminal window
Install homebrew
Run.
brew install git arm-gcc-bin cmake open-ocd
If you're installing Clion, installing CMake is optional in the above command ^^. Also make sure to install version 2018.3, and not the latest version!
Building
Clone the repo with: `git clone https://github.com/UWARG/ZeroPilot-SW `
If you have CMake locally installed and in your path, cd into ZeroPilot-SW/AutoPilot (or into ZeroPilot-SW/Safety if your'e developing for the safety chip) and run the build script with:
./Tools/build.bash
. This will generate a.elf
and.bin
file inside thebuild/
folder that you can use for flashing.
Building with CLion
Once CLion is downloaded, open up either the
Autopilot
orSafety
project. Make sure your version is 2018.3 and not the latest once, as a critical plugin isn't supported by the latest versionYou should be prompted to install the OpenOCD + STM32CubeMX plugin. If not, go to Settings->Editor→Plugins and install it:
...
Most of the time you'll wanna select the STLINKV2 configuration, since we have very few programmers that are STLINKV2.1. Click the play button to flash the chip, or the bug button to debug it!
Install instructions for flasher/debugger (only for windows atm):
Install the st-link drivers mentioned above
...