summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Ansell <me@mith.ro>2019-08-24 23:40:59 +0200
committerGitHub <noreply@github.com>2019-08-24 23:40:59 +0200
commit961d07622e0994f62f24f76fc2d3c269979f0321 (patch)
tree947ecc5ead7f62f2fe0bb1d50f0300d307b55fd6
parenta30963e18778aebdff937b377ec4a98fc9d5aacb (diff)
parent36835421cc1743136b9d106cc1fe1a4b13168cd6 (diff)
Merge pull request #48 from ret/master
Add .dfu file creation in workshop_rgb.py
-rw-r--r--litex/workshop_rgb.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/litex/workshop_rgb.py b/litex/workshop_rgb.py
index 345c294..d98badf 100644
--- a/litex/workshop_rgb.py
+++ b/litex/workshop_rgb.py
@@ -7,7 +7,7 @@ LX_DEPENDENCIES = ["icestorm", "yosys", "nextpnr-ice40"]
LX_CONFIG = "skip-git"
# Import lxbuildenv to integrate the deps/ directory
-import os,sys
+import os,os.path,shutil,sys,subprocess
sys.path.insert(0, os.path.dirname(__file__))
import lxbuildenv
@@ -108,6 +108,12 @@ class BaseSoC(SoCCore):
if placer is not None:
platform.toolchain.nextpnr_build_template[1] += " --placer {}".format(placer)
+def add_dfu_suffix(fn):
+ fn_base, ext = os.path.splitext(fn)
+ fn_dfu = fn_base + '.dfu'
+ shutil.copyfile(fn, fn_dfu)
+ subprocess.check_call(['dfu-suffix', '--pid', '1209', '--vid', '5bf0', '--add', fn_dfu])
+
def main():
parser = argparse.ArgumentParser(
description="Build Fomu Main Gateware")
@@ -139,6 +145,7 @@ def main():
compile_software=False)
vns = builder.build()
soc.do_exit(vns)
+ add_dfu_suffix(os.path.join('build', 'gateware', 'top.bin'))
if __name__ == "__main__":
main()