Re: ch341

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 12, 2016 at 10:19 AM, Johan Hovold <johan@xxxxxxxxxx> wrote:
> On Mon, Dec 12, 2016 at 08:03:03AM -0800, Russell Senior wrote:
>> On Mon, Dec 12, 2016 at 7:54 AM, Johan Hovold <johan@xxxxxxxxxx> wrote:
>> > On Mon, Dec 12, 2016 at 07:51:59AM -0800, Russell Senior wrote:
>> >> On Mon, Dec 12, 2016 at 7:40 AM, Johan Hovold <johan@xxxxxxxxxx> wrote:
>> >> > On Mon, Dec 12, 2016 at 07:09:34AM -0800, Russell Senior wrote:
>> >> >> On Mon, Dec 12, 2016 at 1:54 AM, Johan Hovold <johan@xxxxxxxxxx> wrote:
>> >> >>
>> >> >> > Ok, so maybe your device simply does not support changing the line
>> >> >> > settings more than once. That is, the initial settings chosen are used
>> >> >> > until re-connected. This would seem to be in accordance with a comment
>> >> >> > found in one of the out-of-tree drivers floating around (and which at
>> >> >> > least I hoped would no longer be an issue with the new way of changing
>> >> >> > the settings).
>> >> >> >
>> >> >> > If you connect the ch340 you have in loopback mode, with the removed
>> >> >> > initial LCR write that fixed the 5-bit behaviour, can you get that
>> >> >> > behaviour back by setting 5-bit word size after opening the port? (This
>> >> >> > was what I was going for with my original question above.).
>> >> >>
>> >> >> With minicom configured with 5N1 (that is, 5-bit mode), loopback looks
>> >> >> normal.  I type an 'a' and I get and 'a' back.  Likewise, I type an
>> >> >> 'A' and I get an 'A' back.  I used a saved .minicom.dfl file to
>> >> >> configure the port.
>> >> >
>> >> > Ok, so that seems to confirm the suspicion that changing settings after
>> >> > the initial configuration is failing (even though the device does indeed
>> >> > support 5-bit mode).
>> >> >
>> >> > Could you try to verify if that applies to the baud rate as well? That
>> >> > is, can you switch between say 9600 and 115200 after opening the port
>> >> > and verify that against the pl2303?
>> >> >
>> >> > Still using usb-linus with the first LCR write removed.
>> >>
>> >> I can change the baud rate on the ch341 and make it not work with the
>> >> pl2303 (e.g. I send an 'A' from the pl2030 and get an 0xff on the
>> >> ch341, and vice versa), then harmonize the baud rate again and it
>> >> works again.  Changing baud rate seems to work.
>> >
>> > That's good. And just to confirm: you managed to get characters through
>> > at both rates?
>>
>> Yes, indeed.
>>
>> When the baud rates match (tested 9600 and 115200), characters arrive
>> as expected in both directions.
>
> Can you try also the below diagnostics patch on top of usb-next (not
> usb-linus this time)?
>
> It seems we should be able to revert to setting the divisors and lcr
> directly for all CH340 devices, while using the new method for CH341
> only (which requires it).
>
> Just want to make sure that keeping a common init sequence would still
> work first.
>
> Note that I don't expect you to be able to change word size, but
> hopefully a default 8N1 will work while the baud rate would be
> configurable.

If both sides (ch341 and pl2303) are configured 8N1, your new patch
works.  When both sides are configured for the same baud rate, it
works.  Changing ch341 to a different baud rate from the pl2303 is
stops working, which implies that baud rate changes are working.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux