From ba9e146f91e77fcd94372cc2d35a4a3f0557ba68 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Wed, 7 Jun 2023 12:47:20 -0400 Subject: [PATCH] tftp --- Makefile | 5 +++++ README.md | 48 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2a4646f..1935479 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,11 @@ buildroot-clean: -docker container stop upsilon-buildroot -docker container rm upsilon-buildroot +###### TFTP + +tftp: + cd upsilon/boot && py3tftp --host 192.168.1.100 -p 6969 -v + ###### External projects clone: f4pga buildroot litex opensbi diff --git a/README.md b/README.md index 8d7f90b..ebf5a5d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ Upsilon docker development environment setup. -Written by Peter McGoron. # Setup steps @@ -38,18 +37,53 @@ Install `python3-venv` (or `python3-virtualenv`) and `python3-pip`. Run `make clone`. You may need to download the upsilon repositories and put them in the same folder as the Makefile. +## Setup Network + +Plug in your router/switch to an ethernet port on your computer. If your +computer is usually wired to the network, you will need another ethernet +port (a PCI card is ideal, but a USB-Ethernet port works). + +Set the ethernet port to static ip `192.168.1.100/24`, netmask 255.255.255.0, +gateway `192.168.1.1`. Make sure this is not the default route. Make sure +to adjust your firewall to allow traffic on the 192.168.1.0/24 range. + +If your local network already uses the 192.168.1.0/24 range, then you must +modify `upsilon/firmware/soc.py` to use different IPs. You must rebuild the +SoC after doing this. + ## Setup Images Run `make images` to create all docker images. ## Setup and Run Containers -There are three containers: `hardware`, `buildroot`, and `opensbi`. For -each of these: +For `NAME` in `hardware`, `opensbi`, `buildroot`: 1. Run `make $NAME-container` to build the container. -2. Run `make $NAME-container-copy` to copy Upsilon's code into the container. -3. Run `make $NAME-container-execute` to build the data. -4. Run `make $NAME-container-get` to retrieve the build artefacts. -5. (Optionally) run `make $NAME-container-clean` to delete the container. +2. Run `make $NAME-copy` to copy Upsilon's code into the container. +3. Run `make $NAME-execute` to build the data. +4. Run `make $NAME-get` to retrieve the build artefacts. +5. (Optionally) run `make $NAME-clean` to delete the container. +If you do not delete the container you can run + + make $NAME-copy $NAME-execute $NAME-get + +when you need to rebuild. If you need shell access, run `make $NAME-shell`. + +## Flash FPGA + +Plug in your FPGA into the USB slot. Then run + + openFPGALoader -c digilent upsilon/boot/digilent_arty.bit + +## Launch TFTP Server + +Install py3tftp (`pip3 install --user py3tftp`). Then run `make tftp` to +launch the TFTP server. Keep this window open. + +## Launch FPGA Shell + +Run `litex_term /dev/ttyUSB1`. You should get messages in the window with +the TFTP server that the FPGA has connected to the server. Eventually you +will get a login prompt: you have sucessfully loaded Upsilon onto your FPGA.