mirror of
https://github.com/andreili/katapult.git
synced 2025-08-23 19:34:06 +02:00
flash_can: attempt to reset the mcu if an error is encountered
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
c5163674ed
commit
95e8a707ca
@ -165,6 +165,11 @@ class CanFlasher:
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
if tries:
|
||||
# clear the read buffer
|
||||
try:
|
||||
await self.node.read(2048, timeout=.1)
|
||||
except asyncio.TimeoutError:
|
||||
pass
|
||||
output_line("\nRead Timeout, Retrying...")
|
||||
else:
|
||||
if len(buf) == self.block_size:
|
||||
@ -383,10 +388,15 @@ class CanSocket:
|
||||
node = self._set_node_id(uuid)
|
||||
flasher = CanFlasher(node, fw_path)
|
||||
await asyncio.sleep(.5)
|
||||
await flasher.connect_btl()
|
||||
await flasher.send_file()
|
||||
await flasher.verify_file()
|
||||
await flasher.finish()
|
||||
try:
|
||||
await flasher.connect_btl()
|
||||
await flasher.send_file()
|
||||
await flasher.verify_file()
|
||||
finally:
|
||||
# always attempt to send the complete command. If
|
||||
# there is an error it will exit the bootloader
|
||||
# unless comms were broken
|
||||
await flasher.finish()
|
||||
|
||||
async def run_query(self, intf: str):
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user