@@ -131,7 +131,7 @@ def _parse_partitions(env):
131
131
132
132
result = []
133
133
next_offset = 0
134
- bound = int (board .get ("upload.offset_address" , "0x10000" ), 16 ) # default 0x10000
134
+ app_offset = int (board .get ("upload.offset_address" , "0x10000" ), 16 ) # default 0x10000
135
135
with open (partitions_csv ) as fp :
136
136
for line in fp .readlines ():
137
137
line = line .strip ()
@@ -140,23 +140,25 @@ def _parse_partitions(env):
140
140
tokens = [t .strip () for t in line .split ("," )]
141
141
if len (tokens ) < 5 :
142
142
continue
143
+ bound = 0x10000 if tokens [1 ] in ("0" , "app" ) else 4
144
+ calculated_offset = (next_offset + bound - 1 ) & ~ (bound - 1 )
143
145
partition = {
144
146
"name" : tokens [0 ],
145
147
"type" : tokens [1 ],
146
148
"subtype" : tokens [2 ],
147
- "offset" : tokens [3 ] or next_offset ,
149
+ "offset" : tokens [3 ] or calculated_offset ,
148
150
"size" : tokens [4 ],
149
151
"flags" : tokens [5 ] if len (tokens ) > 5 else None
150
152
}
151
153
result .append (partition )
152
154
next_offset = _parse_size (partition ["offset" ])
153
155
if (partition ["subtype" ] == "ota_0" ):
154
- bound = next_offset
155
- next_offset = ( next_offset + bound - 1 ) & ~ ( bound - 1 )
156
+ app_offset = next_offset
157
+ next_offset = next_offset + _parse_size ( partition [ "size" ] )
156
158
# Configure application partition offset
157
- env .Replace (ESP32_APP_OFFSET = str (hex (bound )))
159
+ env .Replace (ESP32_APP_OFFSET = str (hex (app_offset )))
158
160
# Propagate application offset to debug configurations
159
- env ["INTEGRATION_EXTRA_DATA" ].update ({"application_offset" : str (hex (bound ))})
161
+ env ["INTEGRATION_EXTRA_DATA" ].update ({"application_offset" : str (hex (app_offset ))})
160
162
return result
161
163
162
164
@@ -253,7 +255,7 @@ def __fetch_fs_size(target, source, env):
253
255
GDB = join (
254
256
platform .get_package_dir (
255
257
"riscv32-esp-elf-gdb"
256
- if mcu in ("esp32c2" , "esp32c3" , "esp32c6" )
258
+ if mcu in ("esp32c2" , "esp32c3" , "esp32c6" , "esp32h2" )
257
259
else "xtensa-esp-elf-gdb"
258
260
)
259
261
or "" ,
0 commit comments