diff --git a/.gitignore b/.gitignore index 02fe6db..8018673 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /build* .vscode __pycache__/* -**/__pycache__/* \ No newline at end of file +**/__pycache__/* +*.elf \ No newline at end of file diff --git a/README.md b/README.md index d2c9129..da3ffc0 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,68 @@ -# FSBL -FSBL code is at https://github.com/Xilinx/embeddedsw/ +# Build with Docker +##### Info +IRS wireguard VPN can cause network issues with docker. + +##### Install Docker +https://www.docker.com/get-started/ + + +## FSBL + +##### Clone the repository and build the docker image: -there: ```sh -cd lib/sw_apps/zynq_fsbl/src/ && make BOARD=zed CFLAGS=-DFSBL_DEBUG_INFO +cd docker/compile_fsbl/ +git clone https://github.com/Xilinx/embeddedsw/ +docker build -t compile_fsbl . ``` -# Building - -Requirements [TBC]: -- cmake -- arm-none-eabi-gcc -- doxygen -- graphviz - -Configure doxygen: -- export DOT_PATH=/usr/local/bin - -satisfy Rust requirements +##### To build the FSBL, run the following command in the `docker/compile-fsbl` directory: ```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 +docker run -v ./embeddedsw:/fsbl compile_fsbl /bin/bash -c "cd lib/sw_apps/zynq_fsbl/src && make BOARD=zed SHELL=/bin/bash" ``` -In .../obsw/ +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 . +``` + + +## mission_rust + +##### Build the docker image: +```sh +cd docker/compile_mission/ +docker build -t compile_mission . +``` + +##### 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 -mkdir build_cli -cd build_cli -cmake -DCMAKE_TOOLCHAIN_FILE=../bsp_z7/cmake/arm-none-eabi.toolchain .. -make -j 4 ``` +##### 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. + # Debugging on zedboard diff --git a/docker/compile_fsbl/Dockerfile b/docker/compile_fsbl/Dockerfile new file mode 100644 index 0000000..b1e1582 --- /dev/null +++ b/docker/compile_fsbl/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:12.5 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN apt-get update && apt-get install -y \ + make \ + cmake \ + gcc-arm-none-eabi \ + && rm -rf /var/lib/apt/lists/* + # Remove the package lists to reduce the image size + + +WORKDIR /fsbl/ + diff --git a/docker/compile_mission/Dockerfile b/docker/compile_mission/Dockerfile new file mode 100644 index 0000000..837a46d --- /dev/null +++ b/docker/compile_mission/Dockerfile @@ -0,0 +1,26 @@ +# Use Debian 12.5 as the base image +FROM debian:12.5 + +# Set environment variables to avoid any interactive dialogue +ENV DEBIAN_FRONTEND=noninteractive + +# Install dependencies required for Rust and rustup +RUN apt-get update && apt-get install -y curl gcc cmake && \ + # Clean up the apt cache to reduce image size + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Rustup and select the nightly toolchain +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly && \ + . $HOME/.cargo/env + +# Add the Rust toolchain binaries to PATH +ENV PATH="/root/.cargo/bin:${PATH}" + +# Install the nightly Rust toolchain, the rust-src component, and set the override +RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu + + +# Your project's specific setup steps here +# For example, setting the working directory and copying your project files into the container +WORKDIR /mission_rust/ + diff --git a/docker/compile_obsw/Dockerfile b/docker/compile_obsw/Dockerfile new file mode 100644 index 0000000..0da1195 --- /dev/null +++ b/docker/compile_obsw/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:12.5 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN apt-get update && apt-get install -y \ + make \ + cmake \ + gcc \ + curl \ + gcc-arm-none-eabi \ + doxygen \ + graphviz \ + && rm -rf /var/lib/apt/lists/* + # Remove the package lists to reduce the image size + +# Install Rustup and select the nightly toolchain +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly && \ + . $HOME/.cargo/env + +# Add the Rust toolchain binaries to PATH +ENV PATH="/root/.cargo/bin:${PATH}" + +# Install the nightly Rust toolchain, the rust-src component, and set the override +RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu + +WORKDIR /obsw/ + +# ENV DOT_PATH=/usr/local/bin # Works without this in debian @paul \ No newline at end of file diff --git a/fsfw b/fsfw new file mode 160000 index 0000000..8b9a468 --- /dev/null +++ b/fsfw @@ -0,0 +1 @@ +Subproject commit 8b9a468893a49d100ad5a543656c3864e0be8203