Help needed on touch1200
to enter bootloader on different host platforms and MCU ports
#15306
-
Hi, I was pointed by @robert-hh and @andrewleech to the existence of the touch 1200 bps maner of activating a boards bootloader, I have a few boards that should support this in the standard builds, but I have been struggling to find how to reliably triggers this from different host platforms.
My Questions are :
My current code is : try:
with serial.Serial(
port=mcu.serialport,
baudrate=1200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
rtscts=True,
) as connection:
print("Connection established")
connection.rts = True
connection.dtr = False
time.sleep(0.4)
except serial.SerialException as e:
log.exception(e)
raise MPFlashError("pySerial error: " + str(e) + "\n") from e
except Exception as e:
log.exception(e)
raise MPFlashError("Error: " + str(e) + "\n") from e see : touch1200.py |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is what I use on Mac OS: #!/usr/bin/env python3
# reset uc on given serial port by toggling rate to 1200
# -*- coding: utf-8 -*-
import sys
import time
import serial
com = serial.Serial(sys.argv[1], 1200, dsrdtr=True)
com.dtr = False
com.rts = False
time.sleep(0.2)
com.close()
time.sleep(4) I nicked this code from someone on the Raspberry Pi forum, but the version I can find there is one in one of my posts. On RP2040, you know that the reset has worked because you get a new R/w disk called RPI-RP2 attached |
Beta Was this translation helpful? Give feedback.
This is what I use on Mac OS:
I nicked this code from someone on the Raspberry Pi forum, but the version I can find there is one in one of my posts.
On RP2040, you know that the reset has worked because you get a new R/w disk called RPI-RP2 attached