Skip to content

SARP-UW/titan

Repository files navigation

Transcendent in-flight Telemetry and Avionics Nexus (“TITAN”) Flight Computer Software

Overview

This is the flight computer software for the Domecracker liquid bi-propellant rocket. It's built with the following hardware in mind.

Descriptions Part Number Protocol Used Instance Documentation
MCU STM32H745XIH3 X X datasheet manual
IMU ICM-45686 SPI 2 datasheet
Magnetometer MMC5883MA SPI 2 datasheet
Barometer MS561101BA03-50 SPI 2 datasheet
Temperature Sensor ADT7311WTRZ-RL SPI 2 datasheet
Radio SI4467-A2A-IMR SPI 3 datasheet
GNSS NEO-M8Q-01A SPI 2 datasheet
RS485 Transciever THVD2442DRCR UART 2 datasheet
ADC ADS124S08 SPI 1 datasheet
Current Sensor INA223AIDGSR I2C 1 datasheet
Actuator Drivers MAX22217 SPI 4 datasheet
CAN TCAN3414 UART 1 datasheet

We have four main categories of software in this repository: devices, peripherals, internals, and the states (for our state machine).

  • Peripherals are MCU peripherals, AKA communication protocols. We currently have USART/UART, SPI, PWM, QSPI, and Watchdog.
    • We also use GPIO to set/read/pull pins.
  • Internals are dev tools that abstract some functions of the MCU. We have an MMIO (register mapping for peripherals), startup, a vtable, interrupt mapper (?), and an allocator (which should avoid usage if possible)
  • Devices are device drivers that will be used by the system. We currently have actuator, barometer, GNSS, IMU, magnetometer, radio, and a temperature sensor (and possibly I2C, aka current sensor)
  • States are the various states for our state machine and handles how they move between one another. This is a core part of our flight computer.

Required Software

Note: Currently there are no instructions for Linux/x64 MacOS, but I would imagine the Linux one may be similar to the MacOS one.

MacOS (Darwin)

First I'd recommend installing 3 things:

do the installation processes for all 3 (should be simple enough)

specifically for armGNUToolchain - I would recommend doing this (so that you don't have to repeat this step every time you open a terminal:

  • Go to finder, and go to your Users/username folder (ex: mines is Users/mahiremran)
  • Press Cmd+Shift+. keys. You should see lot of "hidden" (grayed out) files. Look for the one that says ".zshrc" or ".bshrc" (depends if you use bash or zsh, generally don't worry too much about it. If you see both, then just edit both. not a big deal)
  • Open the file in TextEdit (or any simple text editor)
  • Add this line to the end of the file: export PATH="$PATH:/Applications/ArmGNUToolchain/14.3.rel1/arm-none-eabi/bin/"
  • Save the file, and you can exit it/close finder

now after running openocd command, after running from run and debug menu on VScode with devboard plugged in you should be able to run. though I may be forgetting a step, not sure

For compiling code: In a terminal, run brew install cmake (you should only need to do this once) Also run brew install open-ocd

Windows

Ok so since Windows doesnt have homebrew:

For compiling code:

Go to https://cmake.org/download/. I think your system is Windows x86-64, so download the Windows x64 installer (cmake-4.2.0-rc2-windows-x86_64.msi). .msi works like an executable, so just double click to run and follow installation.

  • When looking up I see something about maybe having to add C:\Program Files\CMake\bin to system’s PATH env. variable. If you don’t know how to edit env variable let me know. but first try cmake --version in Powershell and see if that works.

next need to install openocd, go to https://github.com/xpack-dev-tools/openocd-xpack/releases. I would choose option xpack-openocd-0.12.0-7-win32-x64.zip, download it, unzip, and run installer and follow steps.

First I'd recommend installing 3 things:

  • ⁠Arduino IDE (https://www.arduino.cc/en/software/) - scroll down a tiny bit, you'll see an Arduino IDE 2.x.x version and download option ( choose Windows Win 10 or newer option if not already selected). This is not needed for ddevboardbut useful regardless
  • ⁠STM32CubeProgrammer (https://www.st.com/en/development-tools/stm32cubeprog.html\#get-software) - this is pretty important for devboard, mainly just for clearing memory on devboard when needed. choose the STM32CubePrg-W64 one.
  • ⁠ArmGNUToolchain (https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) This is the main thing needed to run on devboard. Scroll down until you see the "Windows (mingw-w64-x86_64) hosted cross toolchains" header. Make sure you are under subheader AArch32 bare-metal target (arm-none-eabi) (I think) Choose first option: arm-gnu-toolchain-14.3.rel1-mingw-w64-x86_64-arm-none-eabi.zip

Do the installation processes for all 3 (should be simple enough)

  • ⁠Similar to openocd/cmake, you may have to add to PATH env variable for ArmGNUToolchain. I think it should be path of ⁠ C:\ArmGNUToolchain\14.3.rel1\arm-none-eabi\bin⁠, but may be wrong

Compiling

The easiest way to compile will be using the provided ./build.sh file. First you should make a folder in ./build/ if it does not exist already. You can input a target to make, such as titan, e.g. ./build.sh titan would compile the program with the main loop. Alternatively you could do ./build.sh all to make all targets.

  • Internally, what this does is temporarily do cd build, then cmake .., and then makeing each target. It also compiles the test_alloc executable separately.

If you build a specific target, it will also try to flash to devboard. You may have to unplug/replug the STM32 devboard due to having to wipe flash memory.

  • Right now the shell file might be a bit buggy.

You can also do ./build.sh clean to remove all build files, if needed.

Committing

  • You should be passing the ./build.sh commit_check check before committing/opening a PR.

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages