Using CDC Class device with Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using CDC Class device with Linux

Jump to solution
5,274 Views
Nouchi
Senior Contributor II

Hello,

 

I'm using MQX3.5.1 CDC virtual com exemple program with M52259demo board, working fine with windows, and I would like to know how to use it with ubuntu system.

I'm looking for exemples.

 

Emmanuel

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
2,005 Views
Nouchi
Senior Contributor II

Hello,

 

I found a solution to makes my M52259DEMO Kit to be recognized as ttyACM0, by changing a definition in g_config_descriptor table:

 

//#define CIC_PROTOCOL_CODE                NO_CLASS_SPECIFIC_PROTOCOL#define CIC_PROTOCOL_CODE                AT_250_PROTOCOL

It seems Linux USB enumerator needs some protocol definition.

This change doesn't affect behaviour with windows.

I performed some successful test with hyperterminal and minicom

 

 

View solution in original post

0 Kudos
Reply
5 Replies
2,005 Views
Nouchi
Senior Contributor II

Hello,

 

I add some logs informations.

When I plug M52259demo USB<->232 bridge I've got :

 

[  780.570063] usb 9-1: new full speed USB device using ohci_hcd and address 2
[  780.806436] usb 9-1: configuration #1 chosen from 1 choice

 and nothing else, no device created.

 

I tried to plug FTDI chip:

 

[ 1157.490823] usb 2-5.4: new full speed USB device using ehci_hcd and address 7
[ 1157.607627] usb 2-5.4: configuration #1 chosen from 1 choice
[ 1157.610725] ftdi_sio 2-5.4:1.0: FTDI USB Serial Device converter detected
[ 1157.610921] usb 2-5.4: Detected FT232RL
[ 1157.610927] usb 2-5.4: Number of endpoints 2
[ 1157.610933] usb 2-5.4: Endpoint 1 MaxPacketSize 64
[ 1157.610940] usb 2-5.4: Endpoint 2 MaxPacketSize 64
[ 1157.610945] usb 2-5.4: Setting MaxPacketSize 64
[ 1157.611531] usb 2-5.4: FTDI USB Serial Device converter now attached to ttyUSB0

I can see ftdi_sio module loaded and ttyUSB0 device added, so what is missing to get new tty device with USB-232 bridge demo?

I also tried to load usbserial  module vith VID=0x2504 & PID=0x0300 without any success.

 

 

0 Kudos
Reply
2,005 Views
JuroV
NXP Employee
NXP Employee

If you say that new module is dynamically loaded, then you should be able to use new port. What happens when fopen-ing it?

0 Kudos
Reply
2,005 Views
Nouchi
Senior Contributor II

Hello,

 

I can't do fopen, because there's no ttyUSB device created, because no module loaded.

lsusb gives:

 

Bus 009 Device 005: ID 2504:0300

 We can see there's no identification string, seem's to be weird?

 

With an FTDI and TI TUSB device it gives :

 

Bus 008 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 009 Device 003: ID 0451:3410 Texas Instruments, Inc. TUSB3410 Microcontroller

 

Only, usbserial ftd_sio and TI module were loaded.

 

lsmod
ftdi_sio               37981  0
ti_usb_3410_5052       26227  0
usbserial              39067  2 ti_usb_3410_5052,ftdi_sio

 

With FTDI devices it load ftdi_sio module, with TI TUSB chip it load ti_usb_3410_5052 module

 

Which (generic?)module should be loaded with usbserial?

 

 

Emmanuel

 

 

 

 

0 Kudos
Reply
2,004 Views
Nouchi
Senior Contributor II

lsusb -v

 

Bus 009 Device 002: ID 2504:0300  Device Descriptor:  bLength                18  bDescriptorType         1  bcdUSB               2.00  bDeviceClass            2 Communications  bDeviceSubClass         0   bDeviceProtocol         0   bMaxPacketSize0        64  idVendor           0x2504   idProduct          0x0300   bcdDevice            0.02  iManufacturer           1   iProduct                2   iSerial                 0   bNumConfigurations      1  Configuration Descriptor:    bLength                 9    bDescriptorType         2    wTotalLength           67    bNumInterfaces          2    bConfigurationValue     1    iConfiguration          0     bmAttributes         0xc0      Self Powered    MaxPower              100mA    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        0      bAlternateSetting       0      bNumEndpoints           1      bInterfaceClass         2 Communications      bInterfaceSubClass      2 Abstract (modem)      bInterfaceProtocol      0 None      iInterface              0       CDC Header:        bcdCDC               1.10      CDC Call Management:        bmCapabilities       0x01          call management        bDataInterface          1      CDC ACM:        bmCapabilities       0x06          sends break          line coding and serial state      CDC Union:        bMasterInterface        0        bSlaveInterface         1       Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x81  EP 1 IN        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0010  1x 16 bytes        bInterval              10    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       0      bNumEndpoints           2      bInterfaceClass        10 CDC Data      bInterfaceSubClass      0 Unused      bInterfaceProtocol      0       iInterface              0       Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x82  EP 2 IN        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0040  1x 64 bytes        bInterval               0      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0040  1x 64 bytes        bInterval               0can't get device qualifier: Operation not permittedcan't get debug descriptor: Operation not permittedcannot read device status, Operation not permitted (1)

 

 

0 Kudos
Reply
2,006 Views
Nouchi
Senior Contributor II

Hello,

 

I found a solution to makes my M52259DEMO Kit to be recognized as ttyACM0, by changing a definition in g_config_descriptor table:

 

//#define CIC_PROTOCOL_CODE                NO_CLASS_SPECIFIC_PROTOCOL#define CIC_PROTOCOL_CODE                AT_250_PROTOCOL

It seems Linux USB enumerator needs some protocol definition.

This change doesn't affect behaviour with windows.

I performed some successful test with hyperterminal and minicom

 

 

0 Kudos
Reply