AnsweredAssumed Answered

MKL27Z64 USB EP1 IN/OUT data tansfer

Question asked by Josip Haluska on Apr 8, 2020
Latest reply on Apr 10, 2020 by Mark Butcher

Hi,

I am working on program based on my own USB stack. It is CDC composite device, updated to AN12597 (USB to Multi VCOM on K32L2 Series MCU) where one bidirectional EP is used per VCOM, without interrupt IN endpoint.

 

It is configurable and test is done with using only 1 bidirectional endpoint EP1. Device is correctly enumerated on Windows. Windows program open port, send 16 byte command and receive 128 byte result, and repeat the same 16 byte command / 128 byte result sequence without closing port. Second 16 byte command / 128 byte result is stopped after sending first 64 bytes of result (EP1 token done is missing). Maybe I missed something related to DATA0/1 ODD/EVEN handshake. {TD} is token done, Data[] and Odd[] with two numbers (before/after) )is value toggling. EP1 sending 128 bytes of result from 0x20001DA0 address in 64 byte packets (2 packets terminated by ZLP). Log is here...

 

{TD} St 00010000 EP1 Dir 0 Odd 0 BDT 400FE020 Ds 00100004 PID 01 [OUT] {16} BDT 400FE020 Ds 00400088 Data[2]01 Odd[2]01 | Buf 16/512
-------- Command > Result --------
EP1 Adr 20001DA0 Len 128 -> 64 Odd[3]0 BDT 400FE030 Data[3]0 Ds 00400088 Data[3]01 Odd[3]01 | Left Adr 20001DE0 Len 64
{TD} St 00011000 EP1 Dir 1 Odd 0 BDT 400FE030 Ds 00400024 PID 09 [IN]
EP1 Adr 20001DE0 Len 64 -> 64 Odd[3]1 BDT 400FE038 Data[3]1 Ds 004000C8 Data[3]10 Odd[3]10 | Left Adr 20001E20 Len 0
{TD} St 00011100 EP1 Dir 1 Odd 1 BDT 400FE038 Ds 00400064 PID 09 [IN]
EP1 Adr 20001E20 Len 0 -> 0 Odd[3]0 BDT 400FE030 Data[3]0 Ds 00000088 Data[3]01 Odd[3]01 | Done
{TD} St 00011000 EP1 Dir 1 Odd 0 BDT 400FE030 Ds 00000024 PID 09 [IN]
{TD} St 00010100 EP1 Dir 0 Odd 1 BDT 400FE028 Ds 00100044 PID 01 [OUT] {16} BDT 400FE028 Ds 004000C8 Data[2]10 Odd[2]10 | Buf 16/512
-------- Command > Result --------
EP1 Adr 20001DA0 Len 128 -> 64 Odd[3]1 BDT 400FE038 Data[3]1 Ds 004000C8 Data[3]10 Odd[3]10 | Left Adr 20001DE0 Len 64

 

Regards,

Josip

Outcomes