diff --git a/tools/nrfutil-0.5.2/binaries/win32/nrfutil.exe b/tools/nrfutil-0.5.2/binaries/win32/nrfutil.exe index 4d8a667d..387de4db 100644 Binary files a/tools/nrfutil-0.5.2/binaries/win32/nrfutil.exe and b/tools/nrfutil-0.5.2/binaries/win32/nrfutil.exe differ diff --git a/tools/nrfutil-0.5.2/nordicsemi/__main__.py b/tools/nrfutil-0.5.2/nordicsemi/__main__.py index 3ae3a68d..b2808033 100644 --- a/tools/nrfutil-0.5.2/nordicsemi/__main__.py +++ b/tools/nrfutil-0.5.2/nordicsemi/__main__.py @@ -244,8 +244,13 @@ global_bar = None def update_progress(progress=0, done=False, log_message=""): del done, log_message # Unused parameters - if global_bar: - global_bar.update(max(1, progress)) + global global_bar + + if global_bar is None: + with click.progressbar(length=100) as bar: + global_bar = bar + + global_bar.update(max(1, progress)) @dfu.command(short_help="Program a device with bootloader that support serial DFU") @@ -276,10 +281,7 @@ def serial(package, port, baudrate, flowcontrol): .format(package, port, "enabled" if flowcontrol else "disabled")) try: - with click.progressbar(length=100) as bar: - global global_bar - global_bar = bar - dfu.dfu_send_images() + dfu.dfu_send_images() except Exception as e: click.echo("") diff --git a/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu.py b/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu.py index 4355acfc..e601b77b 100644 --- a/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu.py +++ b/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu.py @@ -195,8 +195,9 @@ class Dfu(object): bootloader_size, application_size) - logger.info("Sending DFU start packet, afterwards we wait for the flash on " - "target to be initialized before continuing.") + #logger.info("Sending DFU start packet, afterwards we wait for the flash on " + # "target to be initialized before continuing.") + logger.info("Sending DFU start packet") self.dfu_transport.send_start_dfu(program_mode, softdevice_size, bootloader_size, application_size) diff --git a/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu_transport_serial.py b/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu_transport_serial.py index dda656d7..ebddf6f5 100644 --- a/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu_transport_serial.py +++ b/tools/nrfutil-0.5.2/nordicsemi/dfu/dfu_transport_serial.py @@ -164,7 +164,7 @@ class DfuTransportSerial(DfuTransport): # nrf52 will erase the bank 0 up to Application size & Transfer App size from bank1 to bank0 # There must a enough delay before finished to prevent Arduino IDE reopen Serial Monitor - logger.info("Activating new firmware") + logger.info("\nActivating new firmware") #logger.info("Wait after Init Packet %s second", self.get_activate_wait_time()) time.sleep( self.get_activate_wait_time() )