Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: RXSETUP interrupt received with data length 0 after a STALL
PostPosted: Fri Jan 13, 2012 1:24 am 
Offline

Joined: Tue Jan 10, 2012 12:43 am
Posts: 3
First off, I spent 1/2 a day searching for an answer to this through forums, FAQs, erratas and just plain google and I could not find an answer. I am however new to the at91 and if this has been covered somewhere I do apologise.

I am using the Adeno Win CE BSP for the AT91SAM9G20-EK and I am having an issue when I try and utilise the board as a Mass Storage Device.

The problem I am seeing is that I am getting an interrupt on Endpoint 0 (UDP_ISR bit 0 is set) signalling that Setup data was received (UDP_CSR0 bit 2 is set) but the length is 0 (UDP_CSR0 bits 16 - 23 are all clear).

The sequence of events that lead up to this is:
  • Enumeration takes place and is successful.
  • The host issues a 'Read Format Capacities' command to endpoint 2. (This is a Mass Storage command)
  • The device acknowledges the command and sets the FORCE STALL bit of both the in and out bulk transfer endpoints (UDP_CSR1 bit 5 and UDP_CSR2 bit 5 are both set) so that the device responds with a stall packet. (Everything to here is as it should be and all is swell)
  • The host then issues a 'Clear Feature - Halt Endpoint' request on endpoint 0. (A standard flash drive gets to this point, acknowledges this and continues happily)
  • The device receives the interrupt on Endpoint 0 with the rxsetup bit set but data length is 0. (This is the problem!)
  • The device stalls Endpoint 0.

The device does eventually recover from this, but it adds a considerable delay to the mounting of the Mass Storage Device.

I can see on my USB protocol analyser (which is a proper hardware based protocol analyser) that the host is sending the correct 8 bytes for the 'Clear Feature - Halt Endpoint' request on endpoint 0 and the device is responding with a stall on Endpoint 0.

If I ignore the length and read out 8 bytes, the data from the UDP_FDR0 register is rubbish.


Top
 Profile  
 
 Post subject: Re: RXSETUP interrupt received with data length 0 after a ST
PostPosted: Sun Jan 22, 2012 11:55 pm 
Offline

Joined: Tue Jan 10, 2012 12:43 am
Posts: 3
50 views 0 replies.

Does this mean I am the only one having this sort of difficulty with the USB port or that nobody else has tried to use the USB port in this way?


Top
 Profile  
 
 Post subject: Re: RXSETUP interrupt received with data length 0 after a ST
PostPosted: Mon Jan 23, 2012 3:05 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Perhaps it illustrates how popular WinCE is? It is not clear from the title of the post, or the general forum it is posted to that this is a WinCE question. Or it could be the GoogleBot.

So, have you tried the 9G20-EK usb-device-massstorage-project-at91sam9g20-ek-xxx package? Unless I'm mistaken this should run on a system unencumbered with any OS.

I'am also pretty sure you can contract support directly with Adeno for their BSP, or Atmel FAE's if the aforementioned package doesn't work.


Top
 Profile  
 
 Post subject: Re: RXSETUP interrupt received with data length 0 after a ST
PostPosted: Mon Jan 30, 2012 6:37 am 
Offline

Joined: Tue Jan 10, 2012 12:43 am
Posts: 3
Quote:
Perhaps it illustrates how popular WinCE is?


Yes I am getting that impression. This is however not an OS related question but rather one relating to this chip.

Quote:
So, have you tried the 9G20-EK usb-device-massstorage-project-at91sam9g20-ek-xxx package?


Yes, and this package works. I am trying to port it across now as a Win CE driver.

I have taken this up with Atmel and they have been useless. They are quick to answer but constantly ask for more irrelevant data just wasting my time.

The problem to me is clearly a problem with the Atmel processor (trust me, I have ruled all other possibilities out). Under certain circumstances, a 0 length RXSETUP packet can be received. This is rather annoying as the processor has by this stage already acknowledged the message to the host, so the message is lost. My question to Atmel was under what circumstances can this happen and what can be done to avoid it? I would imagine as it is 100% reproducible and because I sent them steps and code this should be rather easy for them to answer but apparently not.

I posted here hoping someone may have ran into this issue and found a solution but that doesn't appear to be the case. If I come to any conclusions I will post them here for future reference.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: