tools/litex_term: remove automatic reboot when flashing and clear mem_regions to avoid re-flashing on next reboot(s)

This commit is contained in:
Florent Kermarrec 2019-11-11 18:38:10 +01:00
parent a17e307acf
commit 4798d6b750
1 changed files with 2 additions and 7 deletions

View File

@ -143,7 +143,6 @@ class LiteXTerm:
f.close() f.close()
self.no_crc = no_crc self.no_crc = no_crc
self.flash = flash self.flash = flash
self.ignore_download = False
self.reader_alive = False self.reader_alive = False
self.writer_alive = False self.writer_alive = False
@ -263,18 +262,14 @@ class LiteXTerm:
return False return False
def answer_magic(self): def answer_magic(self):
if self.ignore_download:
self.ignore_download = False
return
print("[LXTERM] Received firmware download request from the device.") print("[LXTERM] Received firmware download request from the device.")
if(len(self.mem_regions)): if(len(self.mem_regions)):
self.port.write(sfl_magic_ack) self.port.write(sfl_magic_ack)
for filename, base in self.mem_regions.items(): for filename, base in self.mem_regions.items():
self.upload(filename, int(base, 16)) self.upload(filename, int(base, 16))
if self.flash: if self.flash:
# ignore next download request to do a reboot to the flashed image # clear mem_regions to avoid re-flashing on next reboot(s)
self.ignore_download = True self.mem_regions = {}
self.reboot()
else: else:
self.boot() self.boot()
print("[LXTERM] Done."); print("[LXTERM] Done.");