mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-27 11:58:55 +00:00
tools: Split up large binaries into smaller chunks in the DFU binary
ROM will erase the region a partition is in as soon as it receives the first bit of the data that is in the partition. For large partitions it takes more than 5 seconds to erase which is a hard-coded limit in dfu-utils. This splits large binaries and adds them by chunks which should avoid timing-out during flashing. Closes https://github.com/espressif/esp-idf/issues/6999
This commit is contained in:
@@ -6,7 +6,11 @@ def action_extensions(base_actions, project_path):
|
||||
|
||||
SUPPORTED_TARGETS = ['esp32s2']
|
||||
|
||||
def dfu_target(target_name, ctx, args):
|
||||
def dfu_target(target_name, ctx, args, part_size):
|
||||
ensure_build_directory(args, ctx.info_name)
|
||||
run_target(target_name, args, {'ESP_DFU_PART_SIZE': part_size} if part_size else {})
|
||||
|
||||
def dfu_list_target(target_name, ctx, args):
|
||||
ensure_build_directory(args, ctx.info_name)
|
||||
run_target(target_name, args)
|
||||
|
||||
@@ -27,9 +31,17 @@ def action_extensions(base_actions, project_path):
|
||||
'callback': dfu_target,
|
||||
'short_help': 'Build the DFU binary',
|
||||
'dependencies': ['all'],
|
||||
'options': [
|
||||
{
|
||||
'names': ['--part-size'],
|
||||
'help': 'Large files are split up into smaller partitions in order to avoid timeout during '
|
||||
'erasing flash. This option allows to overwrite the default partition size of '
|
||||
'mkdfu.py.'
|
||||
}
|
||||
],
|
||||
},
|
||||
'dfu-list': {
|
||||
'callback': dfu_target,
|
||||
'callback': dfu_list_target,
|
||||
'short_help': 'List DFU capable devices',
|
||||
'dependencies': [],
|
||||
},
|
||||
@@ -42,7 +54,7 @@ def action_extensions(base_actions, project_path):
|
||||
'names': ['--path'],
|
||||
'default': '',
|
||||
'help': 'Specify path to DFU device. The default empty path works if there is just one '
|
||||
'ESP device with the same product identificator. See the device list for paths '
|
||||
'ESP device with the same product identifier. See the device list for paths '
|
||||
'of available devices.'
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user