Skip to contentSkip to conversation

USB device for AT91RM9200

U-Boot-Users larytet.54154763 at bloglines.com 1 participant 1 message Jul 24, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to add USB device support to the AT91RM9200. I use Atmel evaluation board.

I downloaded USB framework and a couple of examples
from the Atmel WEB site and I coded simple enumeration process. Unfortunately it does not work.

I see that I get a setup request from the host

80
06 00 01 00 00 40 00

Device answers with 64 bytes of the device descriptor

12 01 10 01 02 00 00 08 E1 18 1B 00 10 01 01 02 03 01

Host immediately
resets the device (bus reset), I see bit AT91C_UDP_ENDBUSRES and reset end point 0 (EP0).

After that host sends "set address"

00 05 2D 00 00 00 00
00

Device sets the address (UDP_FADDR and UDP_GLBSTATE) and attempts to send zero length packet (ZLP).

When I send ZLP I set AT91C_UDP_TXPKTRDY bit
and wait for bit AT91C_UDP_TXCOMP. AT91C_UDP_TXCOMP remains zero forever.

I tried to answer first setup with ZLP and ZLP itself works just fine
- the chip is able to generate at least 5 ZLP packets without problems.

I tried also to break out from the loop waiting TXCOMP and continue as normal, no matter what. In this case host (Linux fedora 7) trys 4 times to send "get descriptor" (i answer the request every time as i did in the first round) and "set address" (i try to answer with zlp) and gives up.

It appears that
sending of the packets (DATA_IN transactions) does not work after host issued reset.

The following is a memory dump of the USB device when i am in the loop waiting for TXCOMP

fffb0000 : 0x000205c6 132550 ....

fffb0004
: 0x00000000 0 ....

fffb0008 : 0x00000100 256 ....

fffb000c : 0x00000000 0 ....

fffb0010 : 0x00000000
0 ....

fffb0014 : 0x00000000 0 ....

fffb0018 : 0x00001200

        4608  ....

fffb001c : 0x00003b01 15105 .;..

fffb0020 : 0x00000000

           0  ....

fffb0024 : 0x00000000 0 ....

fffb0028 : 0x00000000

           0  ....

fffb002c : 0x00000000 0 ....

fffb0030 : 0x00080804

      526340  ....

fffb0034 : 0x00000000 0 ....

fffb0038 : 0x00000000

           0  ....

fffb003c : 0x00000000 0 ....

fffb0040 : 0x00000000

           0  ....

fffb0044 : 0x00000000 0 ....

fffb0048 : 0x00000000

           0  ....

fffb004c : 0x00000000 0 ....

fffb0050 : 0x00000000

           0  ....

fffb0054 : 0x0000009a 154 ....

fffb0058 : 0x000000cd

         205  ....

fffb005c : 0x000000af 175 ....

fffb0060 : 0x000000ca

         202  ....

fffb0064 : 0x00000001 1 ....

fffb0068 : 0x00000001

           1  ....

fffb006c : 0x00000001 1 ....

fffb0070 : 0x00000000

           0  ....

fffb0074 : 0x00000000 0 ....

any tip/help
is greatly appreciated