This flight software was developed as a PlatformIO project. To port the project for a new board you must update the platformio.ini
with the relevant configuration.
The Haloship flight software is built atop the Arduino core provided by stm32duino. All code was tested with the Adafruit Feather STM32F405 development board and is built for a custom STM32F405 board.
-
Make sure PlatformIO is installed as part of VSCode
-
Follow the section regarding udev-rules on this link
-
Follow this link to make sure pio is part of your PATH
export PATH=$PATH:$HOME/.platformio/penv/bin
-
Clone this repository to get files relevant to the board.
-
Make sure the
ststm32
platform is installed in PlatformIO. See here -
In
~/.platformio/platforms/ststm32/boards
copy overhaloship.json
found in thehaloship_variant
repository. -
In
~/.platformio/packages/framework-arduinoststm32/boards.txt
add:# Haloship Feather STM32F405 board GenF4.menu.pnum.HALOSHIP_F405=Halsohip Board F405 GenF4.menu.pnum.HALOSHIP_F405.upload.maximum_size=1048576 GenF4.menu.pnum.HALOSHIP_F405.upload.maximum_data_size=131072 GenF4.menu.pnum.HALOSHIP_F405.build.board=HALOSHIP_F405 GenF4.menu.pnum.FEATHER_F405.build.product_line=STM32F405xx GenF4.menu.pnum.HALOSHIP_F405.build.variant=HALOSHIP_F405
-
In
~/.platformio/packages/framework-arduinoststm32/variants/
create a directory namedHALOSHIP_F405
. Into this folder copy:ldscript.ld
,PeripheralPins.c
,PinNamesVar.h
,variant.cpp
,variant.h
To interface with PlatformIO's command line tool, this project uses the interface.py
file. Here is the help message from the interface file:
usage: interface.py [-h] [-m [MONITOR]] [-b] [-bn] [-un] [-bf] [-uf]
Interface script to execute various commands for the PIO project.
optional arguments:
-h, --help show this help message and exit
-m [MONITOR], --monitor [MONITOR]
Serial monitor with a default baud rate of 115200
-b, --build Build project for all environments specified in platformio.ini
-bn, --build_nucleo Build firmware for NUCLEO-F411RE
-un, --upload_nucleo Build and upload firmware to NUCLEO-F411RE
-bf, --build_feather Build firmware for Feather F405
-uf, --upload_feather
Build and upload firmware to Feather F405
You can extend this interface file for additional environments defined in platformio.ini
Pinouts for each board are defined in src/config.hpp
. If you are using a development board already defined in the configuration file, then match the pinouts shown in the file for each module. Otherwise, you may redefine the pinouts here to match your preferred setup.