# Firmware

Firmware on the submarine is defined as programs and binary images that are loaded onto microcontrollers. Currently, all microcontrolles on the submarine utilize the Arduino framework and have Arduino bootloaders running on them for bootloading (dynamic, run-time loading of) new binary images. To facilitate this on the command line for SSH sessions, the PlatformIO CLI is used.

In the firmware directory of the robosub repository, different project folders exist. Each one of these projects is a microcontroller project corresponding to a specific microcontroller. Each project has different (Arduino) libraries associated with it. These can be added, updated, manipulated, and removed using the command

platformio lib

Most projects rely on external libraries to function. Once all libraries are in place and the project is ready for binary creation, it can be compiled using the command

platformio run

This will only compile the necessary source files into a binary image. To load the image onto the micrcontroller, use the command

platformio run --target upload