forked from ROMEO/obsw
105 lines
3.1 KiB
Markdown
105 lines
3.1 KiB
Markdown
|
|
|
|
## Prerequisites for building with Docker
|
|
##### Please Note
|
|
IRS wireguard VPN can cause network issues with docker.
|
|
|
|
##### Install Docker
|
|
If you are using macOS or Windows, please use this tutorial:
|
|
- https://www.docker.com/get-started/
|
|
|
|
On Linux simply use your package manager to install ```docker``` and prepare everything using these commands, to avoid permission denied errors:
|
|
On Arch Linux this would look like
|
|
```sh
|
|
sudo apt-get install docker # Ubuntu
|
|
sudo packman -Syy docker # Arch
|
|
```
|
|
|
|
```sh
|
|
sudo systemctl start docker
|
|
sudo groupadd docker
|
|
sudo usermod -aG docker $USER
|
|
sudo reboot
|
|
```
|
|
Congratulations, you installed docker. Please proceed.
|
|
|
|
## First Stage Boot Loader (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:
|
|
|
|
```sh
|
|
cd docker/compile_fsbl/
|
|
git clone https://github.com/Xilinx/embeddedsw/
|
|
docker build -t compile_fsbl . # Legacy builder is deprecated and will be removed in future release. TODO
|
|
```
|
|
|
|
##### To build the FSBL, run the following command in the `docker/compile-fsbl` directory:
|
|
```sh
|
|
docker run -v ./embeddedsw:/fsbl compile_fsbl /bin/bash -c "cd lib/sw_apps/zynq_fsbl/src && make BOARD=zed SHELL=/bin/bash"
|
|
```
|
|
|
|
## Requirements [TBC]:
|
|
```sh
|
|
sudo apt-get install cdoxygen graphviz make arm-none-eabi-gcc # Ubuntu
|
|
sudo packman -Syy cmake adoxygen graphviz rm-none-eabi-gcc # Arch
|
|
```
|
|
1. `doxygen` - tool to generate documentation for C++, C, ...
|
|
2. `graphviz` - graph visualisation
|
|
3. `cmake` - cross-platform build system
|
|
4. `arm-none-eabi-gcc` - precompiled GNU toolchain for certain ARM processors including GCC and GNU Debugger (GDB)
|
|
|
|
If you want, copy the `fsbl.elf` to the `docker/compile_fsbl` directory for easier access:
|
|
```sh
|
|
cp embeddedsw/lib/sw_apps/zynq_fsbl/src/fsbl.elf .
|
|
```
|
|
|
|
## Steps
|
|
1. Configure `doxygen`:
|
|
|
|
## mission_rust
|
|
|
|
##### Build the docker image:
|
|
```sh
|
|
export DOT_PATH=/usr/local/bin
|
|
```
|
|
2. Satisfy Rust requirements
|
|
```sh
|
|
cd ../mission_rust
|
|
cargo update
|
|
rustup toolchain install nightly
|
|
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
|
rustup override set nightly
|
|
cargo build -Z build-std
|
|
cd docker/compile_mission/
|
|
docker build -t compile_mission .
|
|
```
|
|
|
|
3. Configure the ROMEO OBSW repository in `.../obsw/`
|
|
##### To build the mission_rust, run the following command in the `docker/compile_mission` directory:
|
|
```sh
|
|
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):
|
|
```sh
|
|
git submodule init
|
|
git submodule update
|
|
```
|
|
|
|
##### Build the docker image:
|
|
```sh
|
|
cd docker/compile_obsw/
|
|
docker build -t compile_obsw .
|
|
```
|
|
|
|
##### To build the obsw, run the following command in the `docker/compile_obsw` directory:
|
|
```sh
|
|
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. |