Index: scripts/update_package_script/update_package.py =================================================================== diff -u -r7f828c9d3822ff57f893144d74728a30fbd66f17 -r97515a80f13a3ceec73d8c6abb2e894e1fade10a --- scripts/update_package_script/update_package.py (.../update_package.py) (revision 7f828c9d3822ff57f893144d74728a30fbd66f17) +++ scripts/update_package_script/update_package.py (.../update_package.py) (revision 97515a80f13a3ceec73d8c6abb2e894e1fade10a) @@ -196,7 +196,7 @@ if line == b'': break # No more binary bytes left exit elif update_ack_status == CanCommStatus.CAN_COMM_TIME_OUT.value: print() - print("Timeout") # TODO send again? + print("Updating {} Timed Out Unsuccessfully!".format(file_path)) break # Close the binary file f.close() @@ -345,17 +345,25 @@ list_of_update_files = self._find_update_files(packages_dir) if len(list_of_update_files) == 0: exit(0) # No update files to process - self._utilities.send_update_available_to_firmware_stacks() - self._handle_broadcast_message_thread(start_thread=True) - time.sleep(self._WAIT_FOR_BOOTLOADER_AFTER_RESET_S) # Wait for a while or have a broadcast check + try: + self._utilities.send_update_available_to_firmware_stacks() + self._handle_broadcast_message_thread(start_thread=True) + time.sleep(self._WAIT_FOR_BOOTLOADER_AFTER_RESET_S) # Wait for a while or have a broadcast check - for update_file in list_of_update_files: - # Make sure the file is opened a binary or hex - if not update_file.endswith(".bin") and not update_file.endswith(".mcs"): continue - if self._prepare_for_sw_update(stack_to_update, destination, update_file): - if update_file.endswith(".bin"): self._process_binary_update_file(update_file) - if update_file.endswith(".mcs"): self._process_mcs_update_file(update_file) - self._verify_stack_update() # TODO skip if the timeout or another error + for update_file in list_of_update_files: + print("Updating: {}".format(update_file)) + # Make sure the file is opened a binary or hex + if not update_file.endswith(".bin") and not update_file.endswith(".mcs"): continue + if self._prepare_for_sw_update(stack_to_update, destination, update_file): + if update_file.endswith(".bin"): self._process_binary_update_file(update_file) + if update_file.endswith(".mcs"): self._process_mcs_update_file(update_file) + self._verify_stack_update() # TODO skip if the timeout or another error - # Done with update binary files, stop sending the broadcast message - self._handle_broadcast_message_thread(start_thread=False) + # Done with update binary files, stop sending the broadcast message + self._handle_broadcast_message_thread(start_thread=False) + except KeyboardInterrupt: + print() + print("Update process was interrupted by the user!") + # Done with update binary files, stop sending the broadcast message + self._handle_broadcast_message_thread(start_thread=False) +