Closed niondir closed 6 years ago
I created a pull request. I hope it gets integrated.
Anyway, I have the feeling this lib is not maintained actively but seems to be the best alternative to deal with serial ports. I will continue to maintain a Fork on https://github.com/Lobaro/go-serial where even other features will get merged like the non-blocking operation. We deal a lot with embedded Hardware and serial ports and rely on a feature rich, cross OS serial lib.
hi @Niondir,
thanks for the PR, may I ask you to post an example that shows the problem solved by the PR? This will surely accelerate the integration.
Anyway, I have the feeling this lib is not maintained actively but seems to be the best alternative to deal with serial ports. I will continue to maintain a Fork on https://github.com/Lobaro/go-serial where even other features will get merged like the non-blocking operation.
I'm actively maintaining this library, together with other valuable contributors like @albenik or @jcw, but really a lot of people contributed. Sometimes I'm slow to merge new features or give feedback, that's true, unfortunately time is always a scarce resource. BTW I'm much more reactive for bugfixes.
This library is used inside the Arduino Create Agent and a regression may potentially affect hundreds of users, so my priority is about stability and cross-os compatibility that's why, usually, I need more time to carefully test new contributions that touches the core of the library (like for example #33).
I'm working also on a branch that adds an automated test-suite to check for regressions, that will surely give a boost in accepting new feature contributions.
Thanks for the quick response.
The example is what I wrote in "Observation" above and in the comment next to the fix.
The real world problem I'm solving is the following: DTR is used as the BOOT0 pin RTS is used as the RESET pin on a STM32l151CBA
To get into bootloader mode I need to set DTR=false
while resetting with a raising RTS flank: RTS=true (low) -> RTS=false (high)
This does not work with the current implementation since the DTR/BOOT pin is released when setting RTS, resulting in the chip starting into normal mode instead of bootloader mode.
In arduino-create-agent there is only one place where SetDTR(false)
is called in upload.go touchSerialPortAt1200bps(...)
. As far as I can see and what I have tested the PR should not affect the behavior at all.
Fixed by #36, thank you!
I found this comment:
But have the same problem for DTR, setting DTR does not work correctly when using
escapeCommFunction
.Observed behavior: Connect -> RTS = true (low) DTR = true (low) OKAY
SetDTR(false)
-> RTS = true (low) DTR = false (heigh) OKAYSetRTS(false)
-> RTS = false (heigh) DTR = true (low) ERROR: DTR toggledThis does not happen with the following fix, were one has better control over the state of the line:
Plus there is a typo in
dcbRTSControlDisbaleMask
->Disable