The ROMEO Flight Software

For a broader introduction and documentation refer to the OBSW Wiki in the ROMEO Knowledge Base. This README gives a very brief introduction and aims to document the compile process for experienced developers.

Scope

This is the central repository for the flight software of the ROMEO satellite. It will eventually become the new base of a Rust Flight Software Framework replacing the C++ Flight Software Framework of the FLP, EIVE and SOURCE.

The current working steps are:

  • Build Toolchain (Daniel Philipp)

  • Hardware itnerfaces (Paul Nehlich)

    • CAN Bus (Andy Hinkel)
    • RS422 (Paul Nehlich, Joris Janßen)
  • Device Handling Fundamentals (Joris Janßen)

  • Framework Core Component Implementation (Paul Nehlich, Ulrich Mohr)

  • Integration of Space Packets and PUS Services (to be scheduled, Paul Nehlich)

  • OBC Board support and Linux Boot Management (Michael Steinert)

  • Device Integration

  • AOCS

  • TCS

  • Communications Interfaces

Prerequisits for build with Docker

Info

IRS wireguard VPN can cause network issues with docker.

Install Docker

If you are using macOS or Windows, please use this tutorial:

On Linux simply use your package manager to install docker and prepare everything using these commands, to avoid permission denied errors:

sudo systemctl start docker
sudo groupadd docker
sudo usermod -aG docker $USER   
sudo reboot

FSBL

FSBL is the First Stage Boot Loader and prepares the CPU and FPGA configuration for booting up the Second Stage Bootloader and finally the flight software.

Clone the repository and build the docker image:
cd docker/compile_fsbl/
git clone https://github.com/Xilinx/embeddedsw/
docker build -t compile_fsbl .
To build the FSBL, run the following command in the docker/compile-fsbl directory:
docker run -v ./embeddedsw:/fsbl compile_fsbl /bin/bash -c "cd lib/sw_apps/zynq_fsbl/src && make BOARD=zed SHELL=/bin/bash"

If you want, copy the fsbl.elf to the docker/compile_fsbl directory for easier access:

cp embeddedsw/lib/sw_apps/zynq_fsbl/src/fsbl.elf .

mission_rust

Build the docker image:
cd docker/compile_mission/
docker build -t compile_mission .
To build the mission_rust, run the following command in the docker/compile_mission directory:
docker run -v $(pwd)/../../mission_rust:/mission_rust compile_mission /bin/bash -c "cargo build -Z build-std"

obsw

Clone the submodules (FreeRTOS and lwIP):
git submodule init
git submodule update
Build the docker image:
cd docker/compile_obsw/
docker build -t compile_obsw .
To build the obsw, run the following command in the docker/compile_obsw directory:
docker run -v $(pwd)/../..:/obsw compile_obsw /bin/bash -c "mkdir -p build_cli && cd build_cli && cmake -DCMAKE_TOOLCHAIN_FILE=../bsp_z7/cmake/arm-none-eabi.toolchain .. && make -j 8"

The romeo-obsw binary can now be found in the build_cli directory.

Debugging on zedboard

Requirements [TBC]:

  • OpenOCD
  • arm-none-eabi-gdb

Set Zedboard boot mode to jtag and connect debugging PC to zedboard jtag and uart usb port.

On PC connected to zedboard jtag usb port:

openocd -f board/digilent_zedboard.cfg

If you have one around, load bitstream at startup (go get a coffee, takes time with onboard JTAG, blue LED lights up when done):

openocd -f board/digilent_zedboard.cfg -c "init" -c "pld load 0 system.bit"

To use JTAG Boot for the obsw, you first need to run the FSBL once.

On build PC (adapt IP if different from debugging PC) in the folder where you build the FSBL as above:

arm-none-eabi-gdb fsbl.elf
>target extended-remote localhost:3333
>load
>cont
>^C^D^D

You can automate this run:

arm-none-eabi-gdb fsbl.elf -iex "target extended-remote localhost:3333" -ex "set pagination off" -ex "load" -ex "break FsblHandoffJtagExit" -ex "cont" -ex="set confirm off" -ex "exit"

It will exit after the Zynq is configured and ready to firmware.

Then load the actual obsw, in the build (build_cli in the example above) folder run:

arm-none-eabi-gdb romeo-obsw
>target extended-remote localhost:3333
>load
>cont

Again, cli commands can be moved to the gdb call. Also, a small function is used as marker to return from gdb if the mission code returns (should not happen in production but might be useful during testing).

arm-none-eabi-gdb romeo-obsw -iex "target extended-remote localhost:3333" -ex "set pagination off" -ex "load" -ex "break done" -ex "cont" -ex="set confirm off" -ex "exit"

Uart usb port should output something at 115200baud, (I use moserial to monitor).

Description
No description provided
Readme 10 MiB
mohr_ci Latest
2024-12-18 14:49:18 +01:00
Languages
C 95.9%
HTML 1.1%
CSS 0.8%
JavaScript 0.6%
Assembly 0.6%
Other 0.9%