Skip to content

Commit 4d993d5

Browse files
committed
Add app memory format progress information
This also fix issue, large firmware files not flashed or not working after flash. Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 7c4c3a0 commit 4d993d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

siwiflasher.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,14 @@ def da_mem(self, address, size, fota=NACK, mem_block_count=1, type=0x00007000):
369369
mem_block_count, address, address + size - 1, type), 1)
370370
ASSERT(r == ACK, "DA_MEM ACK")
371371
r = self.send(NONE, 7) # <-- 015A000000005A
372+
r = struct.unpack(">BBHHB", r)
373+
# Format progress bar
374+
self.pb.reset("Pre-Format", r[3])
375+
self.pb.update(0)
376+
for i in range(r[3]):
377+
ASSERT(self.send(NONE, 1) == ACK, "Firmware memory format failed")
378+
self.pb.update(i + 1)
379+
self.pb.end()
372380

373381
def da_write(self, block=4096):
374382
ASSERT(self.send(DA_WRITE, 1) == ACK, "DA_WRITE ACK")
@@ -427,8 +435,8 @@ def uploadApplication(self, id, filename, check=True):
427435
app_data = self.openApplication(filename, check)
428436
app_size = len(app_data)
429437
ASSERT(app_size <= app_max_size, "Application max size")
430-
self.pb.reset("Download App", app_size)
431438
self.da_mem(app_address, app_size)
439+
self.pb.reset("Download Firmware", app_size)
432440
self.da_write()
433441
self.da_write_data(app_data)
434442
self.pb.end()

0 commit comments

Comments
 (0)