Atmel website | ARM Community | AVR freaks | Technical Support
Banner
Welcome to AT91SAM Community Forum
http://www.at91.com/samphpbb/

:solved:AT91 USB CDC - dev visible on PC, no datatransfer
http://www.at91.com/samphpbb/viewtopic.php?f=15&t=18971
Page 1 of 1

Author:  alexatat91 [ Sun Feb 14, 2010 8:53 am ]
Post subject:  :solved:AT91 USB CDC - dev visible on PC, no datatransfer

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

Author:  alexatat91 [ Sun Feb 14, 2010 8:56 am ]
Post subject:  Re: AT91 USB CDC Driver - device visible on PC, no datatransfer

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

Author:  mjbcswitzerland [ Sun Feb 14, 2010 3:18 pm ]
Post subject:  Re: AT91 USB CDC Driver - device visible on PC, no datatransfer

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

Author:  alexatat91 [ Sun Feb 14, 2010 6:07 pm ]
Post subject:  Re: :solved:AT91 USB CDC - dev visible on PC, no datatransfer

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

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/