mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-01 23:14:08 +00:00
Add ability to select a device for DFU flashing
This commit is contained in:
@@ -10,11 +10,11 @@ def action_extensions(base_actions, project_path):
|
||||
ensure_build_directory(args, ctx.info_name)
|
||||
run_target(target_name, args)
|
||||
|
||||
def dfu_flash_target(target_name, ctx, args):
|
||||
def dfu_flash_target(target_name, ctx, args, path):
|
||||
ensure_build_directory(args, ctx.info_name)
|
||||
|
||||
try:
|
||||
run_target(target_name, args)
|
||||
run_target(target_name, args, {"ESP_DFU_PATH": path})
|
||||
except FatalError:
|
||||
# Cannot capture the error from dfu-util here so the best advise is:
|
||||
print('Please have a look at the "Device Firmware Upgrade through USB" chapter in API Guides of the '
|
||||
@@ -28,10 +28,24 @@ def action_extensions(base_actions, project_path):
|
||||
"short_help": "Build the DFU binary",
|
||||
"dependencies": ["all"],
|
||||
},
|
||||
"dfu-list": {
|
||||
"callback": dfu_target,
|
||||
"short_help": "List DFU capable devices",
|
||||
"dependencies": [],
|
||||
},
|
||||
"dfu-flash": {
|
||||
"callback": dfu_flash_target,
|
||||
"short_help": "Flash the DFU binary",
|
||||
"order_dependencies": ["dfu"],
|
||||
"options": [
|
||||
{
|
||||
"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 "
|
||||
"of available devices."
|
||||
}
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user