From bbe7fdb8ff68349518cbe86faa883d03e70a3b87 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Thu, 2 Feb 2017 09:58:12 +1030 Subject: [PATCH 1/6] mkimage.py is a python script, not a bash script Signed-off-by: Joel Stanley --- mkimage.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mkimage.py b/mkimage.py index f106b36d..7b190850 100755 --- a/mkimage.py +++ b/mkimage.py @@ -1,5 +1,4 @@ -#!/bin/bash - +#!/usr/bin/python3 import argparse From 4d46c22e265409c3d5f2041e59a4453d6ef9bbea Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Thu, 2 Feb 2017 10:01:49 +1030 Subject: [PATCH 2/6] mimasv2: Make serial port path configurable Signed-off-by: Joel Stanley --- targets/mimasv2/Makefile.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/targets/mimasv2/Makefile.mk b/targets/mimasv2/Makefile.mk index 7b8b1bb0..4bb66ae4 100644 --- a/targets/mimasv2/Makefile.mk +++ b/targets/mimasv2/Makefile.mk @@ -1,18 +1,19 @@ # mimasv2 loading TARGET ?= base +PORT ?= /dev/ttyACM0 gateware-load-mimasv2: - python3 $$(which MimasV2Config.py) /dev/ttyACM0 $(TARGET_BUILD_DIR)/gateware/top.bin + python3 $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/gateware/top.bin image-load-mimasv2: python mkimage.py - python3 $$(which MimasV2Config.py) /dev/ttyACM0 $(TARGET_BUILD_DIR)/flash.bin + python3 $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/flash.bin firmware-load-mimasv2: - flterm --port=/dev/ttyACM0 --kernel=$(TARGET_BUILD_DIR)/software/firmware/firmware.bin --speed=19200 + flterm --port=$(PORT) --kernel=$(TARGET_BUILD_DIR)/software/firmware/firmware.bin --speed=19200 firmware-connect-mimasv2: - flterm --port=/dev/ttyACM0 --speed=19200 + flterm --port=$(PORT) --speed=19200 .PHONY: gateware-load-mimasv2 firmware-load-mimasv2 From 6427a0b4c1314d8755a06ace3e80fecdccdb17c0 Mon Sep 17 00:00:00 2001 From: Tim Ansell Date: Thu, 2 Feb 2017 00:46:08 +0100 Subject: [PATCH 3/6] Adding a TODO for mithro --- targets/mimasv2/Makefile.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/mimasv2/Makefile.mk b/targets/mimasv2/Makefile.mk index 4bb66ae4..84449930 100644 --- a/targets/mimasv2/Makefile.mk +++ b/targets/mimasv2/Makefile.mk @@ -1,6 +1,7 @@ # mimasv2 loading TARGET ?= base +# FIXME(mithro): Detect the real serial port/add see udev rules to HDMI2USB-mode-switch... PORT ?= /dev/ttyACM0 gateware-load-mimasv2: From b0c1b53f694ad4af12f760a27cf3bb55497dedbc Mon Sep 17 00:00:00 2001 From: Tim Ansell Date: Thu, 2 Feb 2017 00:46:52 +0100 Subject: [PATCH 4/6] Make BAUD a variable too --- targets/mimasv2/Makefile.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/targets/mimasv2/Makefile.mk b/targets/mimasv2/Makefile.mk index 84449930..35df4c54 100644 --- a/targets/mimasv2/Makefile.mk +++ b/targets/mimasv2/Makefile.mk @@ -3,6 +3,7 @@ TARGET ?= base # FIXME(mithro): Detect the real serial port/add see udev rules to HDMI2USB-mode-switch... PORT ?= /dev/ttyACM0 +BAUD ?= 19200 gateware-load-mimasv2: python3 $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/gateware/top.bin @@ -12,9 +13,9 @@ image-load-mimasv2: python3 $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/flash.bin firmware-load-mimasv2: - flterm --port=$(PORT) --kernel=$(TARGET_BUILD_DIR)/software/firmware/firmware.bin --speed=19200 + flterm --port=$(PORT) --kernel=$(TARGET_BUILD_DIR)/software/firmware/firmware.bin --speed=$(BAUD) firmware-connect-mimasv2: - flterm --port=$(PORT) --speed=19200 + flterm --port=$(PORT) --speed=$(BAUD) .PHONY: gateware-load-mimasv2 firmware-load-mimasv2 From 5b5ca69c36d95f5b457ad57b00a433977be9bd42 Mon Sep 17 00:00:00 2001 From: Tim Ansell Date: Thu, 2 Feb 2017 00:49:49 +0100 Subject: [PATCH 5/6] MimasV2 only supports flashing not loading. Makes the target names consistent with https://github.com/mithro/HDMI2USB-litex-firmware/blob/nextgen/scripts/NOTES.md#flashing-verses-loading --- targets/mimasv2/Makefile.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/targets/mimasv2/Makefile.mk b/targets/mimasv2/Makefile.mk index 35df4c54..0b37b7d5 100644 --- a/targets/mimasv2/Makefile.mk +++ b/targets/mimasv2/Makefile.mk @@ -6,9 +6,14 @@ PORT ?= /dev/ttyACM0 BAUD ?= 19200 gateware-load-mimasv2: + @echo "MimasV2 doesn't support loading, use the flash target instead." + @echo "make gateware-flash-mimasv2" + @false + +gateware-flash-mimasv2: python3 $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/gateware/top.bin -image-load-mimasv2: +image-flash-mimasv2: python mkimage.py python3 $$(which MimasV2Config.py) $(PORT) $(TARGET_BUILD_DIR)/flash.bin From 38b0ba339583a93c2e87dbaafce8ed5b25d8bc04 Mon Sep 17 00:00:00 2001 From: Tim Ansell Date: Thu, 2 Feb 2017 00:52:01 +0100 Subject: [PATCH 6/6] Find the right python3 Should use; `#!/usr/bin/env python3` --- mkimage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkimage.py b/mkimage.py index 7b190850..90bede6a 100755 --- a/mkimage.py +++ b/mkimage.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import argparse