AnsweredAssumed Answered

USB Host with CDC ACM, how do I change interfaces?

Question asked by Shaun James on Aug 29, 2012
Latest reply on Mar 3, 2013 by Andras Lipoth

Hi All,

 

I've been trying to talk to a 3G modem using MQX3.8 with the cdc_serial demo.

 

The trouble that I have been having is that after the modem is attached, the data interface is selected.  I want to select the control interface so that I can issue AT commands to the modem.  Here is what I get from the console when the modem is attached:

 

----- CDC control interface attach Event -----

State = attached  Class = 2  SubClass = 2  Protocol = 1

----- CDC data interface attach event -----

State = attached  Class = 10  SubClass = 0  Protocol = 0

----- CDC control interface selected -----

----- Device installed -----

----- CDC data interface selected -----

 

At this point, the example code then issues an "fopen()" to "tty0:" which translates to a "_io_cdc_serial_open()".  As far as I can tell, I need to select the control interface with "_usb_hostdev_select_interface()" before using fopen() as it is only possible to select one interface at a time - once the data interface is selected I cannot talk to the control interface.  Have I got this right or have I missed something?  Anyway, doing this causes exceptions or unhandled interrupts.

 

Incidentally, the data interface of the modem does not echo characters back.  I'm not surprised at that but I notice that the demo description seems to infere that I should get echo's "straight out of the box" so to speak.

 

I'd appreciate any help here or at least confirmation that I'm on the right track.

 

Thanks,  Shaun

Outcomes