From d01a3794e82c5284fd6cb6f0bb6e78b2cdda5128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 15 Jul 2019 17:16:07 +0200 Subject: [PATCH] [scripts] device/dfu.py: enable to jump to another address than 0x08000000 when leaving DFU mode --- scripts/device/dfu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/device/dfu.py b/scripts/device/dfu.py index 9f5da7436..bcb566b63 100644 --- a/scripts/device/dfu.py +++ b/scripts/device/dfu.py @@ -270,11 +270,11 @@ def write_page(buf, xfer_offset): print ("Write: 0x%x " % (xfer_base + xfer_offset)) -def exit_dfu(): +def exit_dfu(address = 0x08000000): """Exit DFU mode, and start running the program.""" # set jump address - set_address(0x08000000) + set_address(address) # Send DNLOAD with 0 length to exit DFU __dev.ctrl_transfer(0x21, __DFU_DNLOAD, 2, __DFU_INTERFACE, @@ -589,7 +589,7 @@ def main(): write_elements(elements, args.mass_erase, progress=cli_progress) print("Exiting DFU...") - exit_dfu() + exit_dfu(elements[0]['addr']) return print("No command specified")