1 # This file is Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
6 from litex
.build
.tools
import write_to_file
7 from litex
.build
.generic_programmer
import GenericProgrammer
9 # DFUProg ------------------------------------------------------------------------------------------
11 class DFUProg(GenericProgrammer
):
12 needs_bitreverse
= False
14 def __init__(self
, vid
, pid
):
18 def load_bitstream(self
, bitstream_file
):
19 subprocess
.call(["cp", bitstream_file
, bitstream_file
+ ".dfu"])
20 subprocess
.call(["dfu-suffix", "-v", self
.vid
, "-p", self
.pid
, "-a", bitstream_file
+ ".dfu"])
21 subprocess
.call(["dfu-util", "--download", bitstream_file
+ ".dfu"])