From 5f0a9bec9a14b76c8ed75860a68baf0aeb8ed160 Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Wed, 30 Aug 2023 14:20:41 +0200 Subject: [PATCH] Add flash make podman target Use the iceprog in the tkey-builder image to program the SPI flash in the TKey. --- contrib/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/Makefile b/contrib/Makefile index 2739362..bae21f8 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -11,6 +11,7 @@ all: @echo "run-make Build the FPGA bitstream using image '$(IMAGE)' (Podman)" @echo "run-make-no-clean Like run-make but without cleaning first, useful for iterative firmware dev" @echo "run-make-clean_fw Like run-make but cleans only firmware" + @echo "flash Program the SPI flash on the TKey - needs an existing bitstream" @echo "pull Pull down the image '$(IMAGE)' (Podman)" @echo "build-image Build a toolchain image named '$(BUILDIMAGE)' (Podman)" @echo " A newly built image can be used like: make IMAGE=$(BUILDIMAGE) run" @@ -41,6 +42,14 @@ run-make-clean_fw: podman run --rm --mount type=bind,source="`pwd`/../hw/application_fpga",target=/build -w /build -it \ $(IMAGE) make clean_fw application_fpga.bin +flash: + podman run --rm \ + --device /dev/bus/usb/$(lsusb | grep -m 1 1209:8886 | awk '{ printf "%s/%s", $2, substr($4,1,3) }') \ + --mount type=bind,source="`pwd`/../hw/application_fpga",target=/build \ + -w /build/hw/application_fpga \ + -it $(IMAGE) tillitis-iceprog /build/application_fpga.bin + + pull: podman pull $(IMAGE)