Skip to content

Commit 84e7c2d

Browse files
committed
fixes ota offset
1 parent a13d7bd commit 84e7c2d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

builder/esp32.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ def get_partition_file_name(otp):
4040
# SIL_WESP32
4141

4242

43+
'''
44+
# Name, Type, SubType, Offset, Size, Flags
45+
nvs, data, nvs, 0x9000,0x6000
46+
otadata, data, ota, 0xF000,0x2000
47+
phy_init, data, phy, 0x11000,0x1000
48+
ota_0, app, ota_0, 0x12000,0x25A000
49+
ota_1, app, ota_1,0x26C000,0x25A000
50+
vfs, data, fat,0x4C6000,0x33A000
51+
'''
52+
53+
0x10000
54+
4355
class Partition:
4456

4557
def __init__(self, size):
@@ -87,8 +99,20 @@ def save(self):
8799
offset += self.phy_init
88100

89101
if ota:
102+
value = offset % 0x10000
103+
104+
if value:
105+
self.nvs += 0x10000 - value
106+
self.save()
107+
return
108+
90109
data.append(f'ota_0,app,ota_0,0x{offset:X},0x{self.factory:X}')
91110
offset += self.factory
111+
112+
value = offset % 0x10000
113+
if value:
114+
offset += 0x10000 - value
115+
92116
data.append(f'ota_1,app,ota_1,0x{offset:X},0x{self.factory:X}')
93117
offset += self.factory
94118
else:

0 commit comments

Comments
 (0)