Teensy 3.1 / MK20DX256VLH7 support

ChibiOS public support forum for topics related to the Freescale Kinetis family of micro-controllers.

Moderator: utzig

flabbergast
Posts: 71
Joined: Sat Aug 22, 2015 1:22 pm

Re: Teensy 3.1 / MK20DX256VLH7 support

Postby flabbergast » Fri Nov 06, 2015 2:16 pm

I've used wireshark before, and I learned that the trouble is usually caused by something *before* the last request, usually just one transaction before - if it fails to do what the host expects, the host sends another request, but the microcontroller side is already messed up by then.
So my guess would be that that the troublesome request is actually SET CONTROL LINE STATE, and the usb_serial.c code, line 349, does not actually do what the PC expects should happen. Although by looking at the code, it looks OK, so I am probably wrong.

jstruebel
Posts: 19
Joined: Sat Oct 17, 2015 5:59 am
Has thanked: 2 times
Been thanked: 3 times
Contact:

Re: Teensy 3.1 / MK20DX256VLH7 support

Postby jstruebel » Sun Dec 27, 2015 7:46 am

I finally had some time to investigate this issue with the serial_usb on Windows. It turns out the issue was with the DATA0/1 fields in the RX BDT. The Kinetis USB device will not generate an RX interrupt if the DATA0/1 field does not match what is received on the USB. The driver would simply toggle that field which would work fine for a single buffer, but because of the EVEN/ODD ping-pong that the Kinetis performs with the buffers, it would get out of sync with the driver whenever a USB transaction had an odd number of RX data packets. This happened for the SET_LINE_STATE message which meant that the data for the following SET_LINE_CODING message wasn't being seen in the driver. It also was missing some acks from the host. It seems to ignore the DATA0/1 field for the setup packet data so those were always seen by the driver. I fixed the driver and submitted a pull request to flabbergast at https://github.com/flabbergast/ChibiOS/pull/1

Jonathan

flabbergast
Posts: 71
Joined: Sat Aug 22, 2015 1:22 pm

Re: Teensy 3.1 / MK20DX256VLH7 support

Postby flabbergast » Sun Dec 27, 2015 7:14 pm

Thanks, that's a really nice catch! I wouldn't be able to find this out myself.


Return to “Kinetis Support”

Who is online

Users browsing this forum: No registered users and 8 guests