fix: Add timeout to read_flash to avoid infinite loops

This should handle cases when e.g. reading more then flash size
This commit is contained in:
Peter Dragun
2025-03-19 10:17:05 +01:00
parent 851919f634
commit f26a7bbd36

View File

@@ -1359,6 +1359,7 @@ class ESPLoader(object):
# now we expect (length // block_size) SLIP frames with the data
data = b""
while len(data) < length:
self._port.timeout = 3
p = self.read()
data += p
data_len = len(data)