FSBL
Build with Docker
cd docker/compile_fsbl/
git clone https://github.com/Xilinx/embeddedsw/
docker build -t compile_fsbl .
docker build might fail because of firewall settings or the IRS wireguard VPN.
To build the FSBL, run the following command in the docker/compile-fsbl
directory:
docker run -v ./embeddedsw:/project 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 .
Building
Requirements [TBC]:
- cmake
- arm-none-eabi-gcc
- doxygen
- graphviz
Configure doxygen:
- export DOT_PATH=/usr/local/bin
satisfy Rust requirements
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
In .../obsw/
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
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
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).