Skip to content

Commit a2aef1f

Browse files
committed
Fixed esptool.py
- Fixed wrong size erase region for recording. - Fixed creation of superfluous segments for the loader, if the no data in segments rodata and etc. Patch by Viktor aka pvvx (https://github.com/pvvx)
1 parent 4d06d16 commit a2aef1f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Espressif/utils/esptool.exe

0 Bytes
Binary file not shown.

Espressif/utils/esptool.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ def __init__(self, filename = None):
369369
(offset, size) = struct.unpack('<II', f.read(8))
370370
if offset > 0x40200000 or offset < 0x3ffe0000 or size > 65536:
371371
raise Exception('Suspicious segment %x,%d' % (offset, size))
372-
self.segments.append((offset, size, f.read(size)))
372+
if size > 0:
373+
self.segments.append((offset, size, f.read(size)))
373374

374375
# Skip the padding. The checksum is stored in the last byte so that the
375376
# file is a multiple of 16 bytes.
@@ -381,8 +382,9 @@ def __init__(self, filename = None):
381382
def add_segment(self, addr, data):
382383
# Data should be aligned on word boundary
383384
l = len(data)
384-
if l % 4:
385-
data += b"\x00" * (4 - l % 4)
385+
if l > 0:
386+
if l % 4:
387+
data += b"\x00" * (4 - l % 4)
386388
self.segments.append((addr, len(data), data))
387389

388390
def save(self, filename):

Espressif/utils/library.zip

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)