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: :solved:AT91 USB CDC - dev visible on PC, no datatransfer
PostPosted: Sun Feb 14, 2010 8:53 am 
Offline

Joined: Fri Oct 13, 2006 9:08 am
Posts: 3
Hi all,

I followed the Application Note 'AT91 USB CDC Driver Implementation' (which should results in a virtual comport).
I made some minor changes to the code, compiled and flashed.
The AT91 CDC ideed shows up on the pc (in my case linux):

Quote:
kernel: [99854.452041] usb 1-2: new full speed USB device using uhci_hcd
and address 114
kernel: [99854.627426] usb 1-2: configuration #1 chosen from 1 choice
kernel: [99854.631041] usb 1-2: New USB device found, idVendor=03eb,
idProduct=6119
kernel: [99854.631057] usb 1-2: New USB device strings: Mfr=0,
Product=1, SerialNumber=0
kernel: [99854.631065] usb 1-2: Product: AT91USBSerial


but does not conect to a virtual com port (/dev/ttyUSBx).

usbserial driver is up and running:

Code:
lsmod | grep -i usbserial zeigt:

results in:
usbserial 26472 2 ftdi_sio,pl2303

another

Code:
modprobe usbserial vendor=0x03EB product=0x6119


does not change anything, still:

Code:
lsmod | grep -i usbserial zeigt:

results in:
usbserial 26472 2 ftdi_sio,pl2303

which are my other usb devices. Should not the AT91USB device show up here?


On microcontroller-side, the USB startup code runs through:

Code:
//=== Device is not configured
if (USBD_GetState() < USBD_STATE_CONFIGURED){

USBD_Connect();
while (USBD_GetState() < USBD_STATE_CONFIGURED);
      }


Afterwards, I can write data following the Application note.
The first call to

Code:
CDCDSerialDriver_Write(usb_dbuff, DATABUFFERSIZE, 0, 0);


returns USBD_STATUS_SUCCESS.
All subsequent calls return USBD_STATUS_LOCKED.

I guess this is, because the connection to the PC driver is not up and the first datablock therefore can not be send to PC.

What ame I doing wrong?

Alex


Last edited by alexatat91 on Sun Feb 14, 2010 5:48 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: AT91 USB CDC Driver - device visible on PC, no datatransfer
PostPosted: Sun Feb 14, 2010 8:56 am 
Offline

Joined: Fri Oct 13, 2006 9:08 am
Posts: 3
sorry for the bad formatting. Is it normal to see the color map in huge, while the textfield is tiny?
In addition, the forum code twice lost all my text when hitting preview or submit...
alex


Top
 Profile  
 
 Post subject: Re: AT91 USB CDC Driver - device visible on PC, no datatransfer
PostPosted: Sun Feb 14, 2010 3:18 pm 
Offline

Joined: Thu Mar 02, 2006 1:32 pm
Posts: 127
Location: Switzerland
Hi Alex

I can't help in questions concerning operation under Linux but you could also look at the following: http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF and http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF

This is the uTasker CDC implementation for the SAM7 and includes command line operation via a USB CDC based terminal, RS232<->USB converter mode as well as SW upload mode (as described in the demo document). The uTasker simulator also allows this to be simulated (as also described), which makes USB testing and development easier.

It uses the standard Windows usbser.sys but I have no idea what it would use under Linux but expect that it should basically operate with whatever equivalent is available.

Regards

Mark

www.uTasker.com


Top
 Profile  
 
 Post subject: Re: :solved:AT91 USB CDC - dev visible on PC, no datatransfer
PostPosted: Sun Feb 14, 2010 6:07 pm 
Offline

Joined: Fri Oct 13, 2006 9:08 am
Posts: 3
I solved the problem following:
http://www.schimmelnetz.de/projekte/iTU4l/usb.html

The point was that the other devices already used usbserial and therefore the driver did not reload.

rmmod both other modules
rmmod usbserial
modprobe usbserial vendor=0x03EB product=0x6119

results in
Quote:
Feb 14 16:28:25 laptop kernel: [128505.088597] usbserial_generic 2-1:1.1: device disconnected
Feb 14 16:38:01 laptop kernel: [129081.456044] usb 2-1: new full speed USB device using uhci_hcd and address 48
Feb 14 16:38:02 laptop kernel: [129081.636979] usb 2-1: configuration #1 chosen from 1 choice
Feb 14 16:38:02 laptop kernel: [129081.641722] usbserial_generic: probe of 2-1:1.0 failed with error -5
Feb 14 16:38:02 laptop kernel: [129081.641889] usbserial_generic 2-1:1.1: generic converter detected
Feb 14 16:38:02 laptop kernel: [129081.642017] usb 2-1: generic converter now attached to ttyUSB0
Feb 14 16:38:02 laptop kernel: [129081.642311] usb 2-1: New USB device found, idVendor=03eb, idProduct=6119
Feb 14 16:38:02 laptop kernel: [129081.642321] usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
Feb 14 16:38:02 laptop kernel: [129081.642329] usb 2-1: Product: AT91USBSerial

Note line six 'generic converter now attached to ttyUSB0'.

Alex


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 0 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: