From 5170d27fd56079a96476795e408d0e6f6d45bfbb Mon Sep 17 00:00:00 2001 From: Jordan Stocker Date: Thu, 28 Mar 2024 06:14:03 +1030 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Fix=20binary=20upload=20firmware?= =?UTF-8?q?=20path=20(#26909)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/scripts/upload.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index 9fb927c42685..ae7f7e62617b 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -157,14 +157,14 @@ def _RollbackUpload(FirmwareFile): marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') # Get firmware upload params - upload_firmware_source_name = env['PROGNAME'] + '.bin' if 'PROGNAME' in env else str(source[0]) + upload_firmware_source_path = os.path.join(env["PROJECT_BUILD_DIR"], env["PIOENV"], f"{env['PROGNAME']}.bin") if 'PROGNAME' in env else str(source[0]) # Source firmware filename upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 # baud rate of serial connection upload_port = _GetUploadPort(env) # Serial port to use # Set local upload params - upload_firmware_target_name = os.path.basename(upload_firmware_source_name) + upload_firmware_target_name = os.path.basename(upload_firmware_source_path) # Target firmware filename upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values upload_blocksize = 512 # Transfer block size. 512 = Autodetect @@ -216,7 +216,7 @@ def _RollbackUpload(FirmwareFile): print(f' LONG_FILENAME_WRITE_SUPPORT : {marlin_longname_write}') print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}') print('---- Upload parameters ------------------------') - print(f' Source : {upload_firmware_source_name}') + print(f' Source : {upload_firmware_source_path}') print(f' Target : {upload_firmware_target_name}') print(f' Port : {upload_port} @ {upload_speed} baudrate') print(f' Timeout : {upload_timeout}') @@ -271,14 +271,14 @@ def _RollbackUpload(FirmwareFile): # WARNING! The serial port must be closed here because the serial transfer that follow needs it! # Upload firmware file - debugPrint(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'") + debugPrint(f"Copy '{upload_firmware_source_path}' --> '{upload_firmware_target_name}'") protocol = MarlinBinaryProtocol.Protocol(upload_port, upload_speed, upload_blocksize, float(upload_error_ratio), int(upload_timeout)) #echologger = MarlinBinaryProtocol.EchoProtocol(protocol) protocol.connect() # Mark the rollback (delete broken transfer) from this point on rollback = True filetransfer = MarlinBinaryProtocol.FileTransferProtocol(protocol) - transferOK = filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test) + transferOK = filetransfer.copy(upload_firmware_source_path, upload_firmware_target_name, upload_compression, upload_test) protocol.disconnect() # Notify upload completed