Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Oct 2022 13:43:57 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Axel Rau <Axel.Rau@Chaos1.DE>
Cc:        hardware@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Accessing I2C-Bus via ELV USB-I2C
Message-ID:  <84c5bc0b-1c72-d50d-6289-ac91a0878bd1@selasky.org>
In-Reply-To: <017C6EBE-910E-43E7-AAF7-A3D9ECE85EFF@Chaos1.DE>
References:  <996df5c0-ffa7-f1bf-a9e2-6dd47d7b49e6@Chaos1.DE> <35D556D7-56EC-4295-93D6-80A4CFE6DCE9@Chaos1.DE> <37c55124-5cd5-6fd1-ca46-9265ebe47b18@selasky.org> <602324D8-515B-4061-8689-5638E9A82759@Chaos1.DE> <2cb6203f-03da-9a05-24a5-c851f1424503@selasky.org> <F81783C4-F79F-48A1-A5BE-25D997DF29DA@Chaos1.DE> <beafa2e5-17e7-491a-d104-a0ede1b69ce3@selasky.org> <490EBA38-E103-4DC1-8A42-E16A8279980D@Chaos1.DE> <017C6EBE-910E-43E7-AAF7-A3D9ECE85EFF@Chaos1.DE>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/4/22 12:03, Axel Rau wrote:
> 
> 
> Am 04.10.2022 um 10:39 schrieb Hans Petter Selasky <hps@selasky.org>:
>>
>> That looks normal.
>>
>> The DONE transaction transferred the SETUP packet, but still lists frame [0], but is not dumping the data, because it has already been sent. frame [0] is always the SETUP packet for control endpoints.
>>
> 
> So where should I dig further to find out why the read at 09:28:44.885162 shows only
> 'e:'  from the string, shown completely at 09:28:47.463632 (2nd block) ?
> 
> 09:28:44.878743 usbus1.3 SUBM-BULK-EP=00000001,SPD=FULL,NFR=1,SLEN=4,IVAL=0
>   frame[0] WRITE 1 bytes
>   0000  3F -- -- -- -- -- -- --  -- -- -- -- -- -- -- --  |?               |
>   flags 0x8 <PIPE_BOF|0>
>   status 0xca023 <OPEN|TRANSFERRING|STARTED|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 09:28:44.878816 usbus1.3 DONE-BULK-EP=00000001,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
>   frame[0] WRITE 1 bytes
>   flags 0x8 <PIPE_BOF|0>
>   status 0xca021 <OPEN|STARTED|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 09:28:44.885162 usbus1.3 DONE-BULK-EP=00000081,SPD=FULL,NFR=1,SLEN=4,IVAL=0,ERR=0
>   frame[0] READ 2 bytes
>   0000  65 3A -- -- -- -- -- --  -- -- -- -- -- -- -- --  |e:              |
>   flags 0xa <SHORT_XFER_OK|PIPE_BOF|0>
>   status 0xcb021 <OPEN|STARTED|SHORT_XFER_OK|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 09:28:44.885176 usbus1.3 SUBM-BULK-EP=00000081,SPD=FULL,NFR=1,SLEN=0,IVAL=0
>   frame[0] READ 1024 bytes
>   flags 0xa <SHORT_XFER_OK|PIPE_BOF|0>
>   status 0xeb023 <OPEN|TRANSFERRING|STARTED|SHORT_XFER_OK|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 09:28:44.888153 usbus1.3 DONE-BULK-EP=00000081,SPD=FULL,NFR=1,SLEN=24,IVAL=0,ERR=0
>   frame[0] READ 24 bytes
>   0000  31 31 35 32 30 30 20 62  69 74 2F 73 0D 0A 49 32  |115200 bit/s..I2|
>   0010  43 2D 43 6C 6F 63 6B 3A  -- -- -- -- -- -- -- --  |C-Clock:        |
>   flags 0xa <SHORT_XFER_OK|PIPE_BOF|0>
>   
> Here I get the right response:
> 
> 09:28:47.457426 usbus1.3 SUBM-BULK-EP=00000001,SPD=FULL,NFR=1,SLEN=4,IVAL=0
>   frame[0] WRITE 1 bytes
>   0000  3F -- -- -- -- -- -- --  -- -- -- -- -- -- -- --  |?               |
>   flags 0x8 <PIPE_BOF|0>
>   status 0xca023 <OPEN|TRANSFERRING|STARTED|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 09:28:47.457462 usbus1.3 DONE-BULK-EP=00000001,SPD=FULL,NFR=1,SLEN=0,IVAL=0,ERR=0
>   frame[0] WRITE 1 bytes
>   flags 0x8 <PIPE_BOF|0>
>   status 0xca021 <OPEN|STARTED|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 09:28:47.463632 usbus1.3 DONE-BULK-EP=00000081,SPD=FULL,NFR=1,SLEN=68,IVAL=0,ERR=0
>   frame[0] READ 66 bytes
>   0000  0D 0A 45 4C 56 20 55 53  42 2D 49 32 43 2D 49 6E  |..ELV USB-I2C-In|
>   0010  74 65 72 66 61 63 65 20  76 31 2E 38 20 28 43 61  |terface v1.8 (Ca|
>   0020  6C 3A 35 43 29 0D 0A 4C  61 73 74 20 41 64 72 65  |l:5C)..Last Adre|
>   0030  73 73 3A 30 78 30 30 0D  0A 42 61 75 64 72 61 74  |ss:0x00..Baudrat|
>   0040  65 3A -- -- -- -- -- --  -- -- -- -- -- -- -- --  |e:              |
>   flags 0xa <SHORT_XFER_OK|PIPE_BOF|0>
>   status 0xeb021 <OPEN|STARTED|SHORT_XFER_OK|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 09:28:47.463644 usbus1.3 SUBM-BULK-EP=00000081,SPD=FULL,NFR=1,SLEN=0,IVAL=0
>   frame[0] READ 1024 bytes
>   flags 0xa <SHORT_XFER_OK|PIPE_BOF|0>
>   status 0xcb023 <OPEN|TRANSFERRING|STARTED|SHORT_XFER_OK|BDMA_ENABLE|BDMA_SETUP|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
> 
> Axel
> ---
> PGP-Key: CDE74120  ☀  computing @ chaos claudius
>>
> 
> 
> ---
> PGP-Key: CDE74120  ☀  computing @ chaos claudius
> 


Did you clear the endpoint halt condition (for RX BULK endpoint and TX 
BULK endpoint), to reset the so-called USB data-toggle, before starting 
to communicate with the device? Else you risk loosing a USB packet?

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84c5bc0b-1c72-d50d-6289-ac91a0878bd1>