From a97ae51cc7d3fa4b8fa1180d71023964e495b304 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 11 Apr 2020 18:39:02 -0700 Subject: [PATCH] Archim: PIO upload on Windows, Arduino IDE LCD (#17405) Co-authored-by: Scott Lahteine --- Marlin/src/HAL/DUE/upload_extra_script.py | 18 ++++++++++++++++++ Marlin/src/HAL/DUE/usb/conf_usb.h | 4 ---- platformio.ini | 2 ++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 Marlin/src/HAL/DUE/upload_extra_script.py diff --git a/Marlin/src/HAL/DUE/upload_extra_script.py b/Marlin/src/HAL/DUE/upload_extra_script.py new file mode 100644 index 0000000000..06c2b914f5 --- /dev/null +++ b/Marlin/src/HAL/DUE/upload_extra_script.py @@ -0,0 +1,18 @@ +# +# Set upload_command +# +# Windows: bossac.exe +# Other: leave unchanged +# + +import platform +current_OS = platform.system() + +if current_OS == 'Windows': + + Import("env") + + # Use bossac.exe on Windows + env.Replace( + UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot" + ) diff --git a/Marlin/src/HAL/DUE/usb/conf_usb.h b/Marlin/src/HAL/DUE/usb/conf_usb.h index 8d5924d375..7beb9b0bba 100644 --- a/Marlin/src/HAL/DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/DUE/usb/conf_usb.h @@ -78,10 +78,6 @@ //! To define a Full speed device //#define USB_DEVICE_FULL_SPEED -#if MB(ARCHIM1) - #define USB_DEVICE_FULL_SPEED -#endif - //! To authorize the High speed #ifndef USB_DEVICE_FULL_SPEED #if (UC3A3||UC3A4) diff --git a/platformio.ini b/platformio.ini index d072ae4cc9..38e3065f20 100644 --- a/platformio.ini +++ b/platformio.ini @@ -214,6 +214,7 @@ board = due src_filter = ${common.default_src_filter} + build_flags = ${common.build_flags} -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSBCON +extra_scripts = Marlin/src/HAL/DUE/upload_extra_script.py [env:DUE_archim_debug] # Used when WATCHDOG_RESET_MANUAL is enabled @@ -223,6 +224,7 @@ src_filter = ${common.default_src_filter} + build_flags = ${common.build_flags} -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSBCON -funwind-tables -mpoke-function-name +extra_scripts = Marlin/src/HAL/DUE/upload_extra_script.py # # NXP LPC176x ARM Cortex-M3