SAM3S USB Status IN TX - How do I know when to reply?

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

dougcl
Posts: 10
Joined: Tue Nov 04, 2014 5:09 pm

SAM3S USB Status IN TX - How do I know when to reply?

Wed Jul 01, 2015 7:31 am

Hi folks, following an OUT data stage, the host sends an IN token and waits for a zero length packet from the SAM3S. The trouble is, I'm not sure how I know that I have received the IN token. There is no interrupt for this, and nothing to poll (that I can see). Right now I am just blindly sending a ZLP after handling the setup RXSETUP and reading the data RX_DATA_BK0 (fig 38-5 on page 902 of the SAM3S datasheet: 6500E-ATARM-11-Feb-13). Does it matter if I censored-up a ZLP before the host sends an IN token? Seems like it would.

Thanks
Doug
dougcl
Posts: 10
Joined: Tue Nov 04, 2014 5:09 pm

Re: SAM3S USB Status IN TX - How do I know when to reply?

Mon Jul 06, 2015 11:00 pm

Hi folks, I didn't get an answer for this, but the question stemmed from the question of when to ACK the IN status stage that comes after OUT tokens. I found that the ACK worked after processing the OUT tokens without waiting for any indication that the status IN token was sent. There is one exception: SET_ADDRESS, and in that case the status IN token needs to be ACK'd before the OUT tokens are processed. It appears that in any case you don't have to wait for an indication of a status IN token. Just ACK in relation to OUT token processing. In the case of SET_ADDRESS, just assume the IN token has arrived after you ACK the the setup token. Otherwise assume the IN token has arrived after you have read and processed the OUT tokens. 
Bogdancev
Posts: 9
Joined: Sun Jul 13, 2014 3:13 pm

Re: SAM3S USB Status IN TX - How do I know when to reply?

Tue Aug 11, 2015 8:06 am

You know you have received IN token when UOTGHS_DEVEPTISRx.TXINI is set.

I have complete working example but from HOST perspective of view, a control transfer is described there in details. It might help you as getting help for SAM devices is very hard especially for USB part due to very bad documentation with many unclear places and errors (at least it was for me):

http://www.codeproject.com/Articles/897 ... ra-on-Ardu
dougcl
Posts: 10
Joined: Tue Nov 04, 2014 5:09 pm

Re: SAM3S USB Status IN TX - How do I know when to reply?

Sat Aug 15, 2015 12:34 am

Bogdancev wrote:You know you have received IN token when UOTGHS_DEVEPTISRx.TXINI is set.
Sorry, no UOTGHS on the SAM3S, but thanks for your attention.
Doug

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests