File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,39 +71,18 @@ async def bootstrap(uart: serial.Serial | None) -> None:
7171 await set_pin (0 , True )
7272
7373
74- def get_load_addr (elf : Path ) -> int :
75- try :
76- with elf .open ("rb" ) as f :
77- elf = ELFFile (f )
78- load_addrs = [
79- seg ["p_paddr" ] for seg in elf .iter_segments () if seg ["p_type" ] == "PT_LOAD"
80- ]
81- if not load_addrs :
82- print (f"[{ RUNNER } ] no PT_LOAD segments found in ELF file { elf } " )
83- sys .exit (1 )
84- return min (load_addrs )
85- except OSError as e :
86- print (f"[{ RUNNER } ] error opening ELF file { elf } : { e } " )
87- sys .exit (1 )
88-
89-
9074async def load_fpga_binary (path : Path , uart : serial .Serial | None ) -> None :
91- load_address = get_load_addr (path )
92-
9375 await bootstrap (uart )
9476
9577 command = [
9678 "ftditool" ,
9779 "--pid" ,
9880 hex (FTDI_PID ),
99- "bootstrap" ,
100- "--addr" ,
101- hex (load_address ),
102- "--skip-erase" ,
81+ "bootstrap-elf" ,
82+ str (path ),
10383 "--ftdi" ,
10484 FTDI_DEVICE_DESC ,
10585 ]
106- command .append (str (path .with_suffix (".bin" )))
10786
10887 p = await asyncio .create_subprocess_exec (* command )
10988 if await p .wait () != 0 :
You can’t perform that action at this time.
0 commit comments