-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed DTR/RTS bootloader #27
Conversation
…connecting after clock switching, reseting again the device.
Sorry for the late reply! This is a good catch! I don't have any hardware that supports the DTR/RTS pin toggle to invoke the bootloader, so I never noticed the clock switching wasn't working properly. Did you ever notice problems with this @bradjc ? (He implemented the feature originally). Code looks good to me 👍 |
Fixed auto DTR/RTS bootloader on clock switch
Concerning the bug in the CP2104: did you find away around this? And do you know if the CP2102 has the same problem? |
I have been looking into that and the last spec of the RS232 standard apparently says that when opening a connection, RTS and DTR should be kept low (if not using hardware flow control). So it is not a bug on linux/windows, it is actually a non-updated driver what makes it work in mac. I tried making another custom board with the FT232RQ (it is a fairly new FTDI, smaller that the older ones that everyone used to use), and it is acting the same. Whenever a serial connection is opened, RTS and DTR is pulled low by the FTDI/CP2104, and is kept that way unless pulled up again with the setDTR/setRTS. Using a custom python script I can communicate no problem, I just call setDTR/setRTS on connect, but with putty or any other serial console it doesn't work. |
I'm not sure how many people are actually using this feature, and if they do, maybe they don't know that uploading should go a lot faster. When you say 'I can communicate no problem', you're talking about debug over serial coming from the chip. Not uploading with the bootloader, right? Because if the specs say RTS and DTR need to be low when opening the port (and we can't change the speed on the driver/pc side without closing and opening), that would mean we can never do the clock switching properly. The chip would get reset every time the driver on the pc side opens the port. |
I cannot find the RS232 reference, but there are many people with the same problem in other devices, look at this thread for example: http://ubuntuforums.org/showthread.php?t=1436247 |
It was firing twice, when connecting and reconnecting after clock switching, resetting again the device.With this fix it works fine in mac, but in Linux apparently there is a bug in the drivers for the usb-to-serial chip that we use (CP2104), causing a reset on the RST line whenever a serial connection is opened.