Add UART upload forwarding
This commit is contained in:
parent
62371455fe
commit
61d36a8f90
2 changed files with 24 additions and 0 deletions
|
@ -37,6 +37,24 @@ upload_port = COM4
|
||||||
board_upload.speed = ${env:fuses_bootloader.board_bootloader.speed}
|
board_upload.speed = ${env:fuses_bootloader.board_bootloader.speed}
|
||||||
|
|
||||||
|
|
||||||
|
[env:Upload_UART_Forwarded]
|
||||||
|
; Serial bootloader protocol
|
||||||
|
upload_protocol = custom
|
||||||
|
; Serial upload port
|
||||||
|
upload_port = COM5
|
||||||
|
; Get upload baud rate defined in the fuses_bootloader environment
|
||||||
|
board_upload.speed = ${env:fuses_bootloader.board_bootloader.speed}
|
||||||
|
upload_flags =
|
||||||
|
-C$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
|
||||||
|
-p$BOARD_MCU
|
||||||
|
-P${env:Upload_UART.upload_port}
|
||||||
|
-carduino
|
||||||
|
-v
|
||||||
|
-V
|
||||||
|
-D
|
||||||
|
upload_command = python switchDevice.py && avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
|
||||||
|
|
||||||
|
|
||||||
; Run the following command to upload with this environment
|
; Run the following command to upload with this environment
|
||||||
; pio run -e Upload_ISP -t upload
|
; pio run -e Upload_ISP -t upload
|
||||||
[env:Upload_ISP]
|
[env:Upload_ISP]
|
||||||
|
|
6
Devices/Console/Firmware/switchDevice.py
Normal file
6
Devices/Console/Firmware/switchDevice.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import serial
|
||||||
|
import time
|
||||||
|
ser = serial.Serial("COM5")
|
||||||
|
ser.write(b's')
|
||||||
|
ser.close()
|
||||||
|
time.sleep(1)
|
Reference in a new issue