Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag for forcing device flashing #360

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions studio/Python/tinymovr/dfu.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""
Usage:
dfu.py --node_id=ID [--bin=PATH | --recovery] [--no-reset] [--bus=<bus>] [--chan=<chan>] [--bitrate=<bitrate>]
dfu.py --node_id=ID [--bin=PATH | --recovery] [--no-reset] [--force] [--bus=<bus>] [--chan=<chan>] [--bitrate=<bitrate>]

Options:
--node_id=ID The CAN Node ID of the device in DFU mode.
--bin=PATH The path of the .bin file to upload.
--recovery Perform recovery procedure for inaccessible DFU bootloader.
--no-reset Do not perform a reset following successful flashing.
--force Force flashing even if device memory matches the .bin file.
--bus=<bus> One or more interfaces to use, first available is used [default: canine,slcan_disco].
--chan=<chan> The bus device "channel".
--bitrate=<bitrate> CAN bitrate [default: 1000000].
Expand Down Expand Up @@ -181,7 +182,7 @@ def spawn():

# If an existing .bin file is specified, upload it to the device
elif bin_path:
if compare_bin_w_device(device, bin_path):
if (not arguments["--force"]) and compare_bin_w_device(device, bin_path):
print("\nDevice memory matches the .bin file. Skipping flashing.")
else:
upload_bin(device, bin_path)
Expand Down
Loading