<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis Software Development Kit中的主题 Re: USB host cdc with modem not cdc_acm/cdc_data</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-host-cdc-with-modem-not-cdc-acm-cdc-data/m-p/511892#M5280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I'd like you to know that I have solved my problem in stepping in a lot in the KSDK USB library (4 long weeks...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So The probleme was simple to solve once I have understood how things "could" work and not "should" work.&lt;/P&gt;&lt;P&gt;The CDC Host driver is requesting two differents interfaces: one for the CDC ACM and one for the CDC Data.&lt;/P&gt;&lt;P&gt;So, in the DriverInfoTable there are two entries, with two differents callback. That's good enough for most USB devices but not for modems that generaly expose a lot of interfaces with class, subclass and protocol equal to 0xFF, that is, vendor specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 4 USB modems in here, and each one got specific interfaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First one got 2 CDC ACM and 2 CDC Data :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To solve carrying this modem I have updated the usb_host_cdc_acm_event callback to deal with it this way :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int the switch case USB_CONFIG_EVENT:&lt;/P&gt;&lt;P&gt;Simply, recast the dev_hanle to a dev_instance_t* and the intf_handle to a usb_device_interface_struct_t*&lt;/P&gt;&lt;P&gt;then test that this is my product : if (dev_ptr-&amp;gt;dev_descriptor.idVendor[1] == 0x1e &amp;amp;&amp;amp;&amp;nbsp; dev_ptr-&amp;gt;dev_descriptor.idVendor[0] == 0x2d)&lt;/P&gt;&lt;P&gt;and test that this is the first interface : if (intf-&amp;gt;lpinterfaceDesc-&amp;gt;bInterfaceNumber == 0) {&lt;/P&gt;&lt;P&gt;if so, I set the acm_intf_handle and that's enought for the acm part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next I have updated the usb_host_cdc_data_event callback to also react on the good interface. Same cast, same test except on the requested interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And everything is ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 3 other modems got some vendor specific class, and specifically, they all have only one interface that handle the 3 requested endpoints (ctrl, in and out).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To deal with those modems I have added an entry in the DriverInfoTable like this :&lt;/P&gt;&lt;P&gt;// QUECTEL UC15&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0xC6,0x05},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0x90,0x90},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFF, 0xFF, 0xFF, 0, mycallback&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;same for SIERRA MC8092 and HUAWEI MU709S, but this is not enought. I had to update the class_interface_map driver, allocate a fake ACM controller, pepper, salt, mix everything et voilà ! It works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS : I don't think I'll go to SDK 2.0 since everything has changed ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2016 13:23:26 GMT</pubDate>
    <dc:creator>alainbridel</dc:creator>
    <dc:date>2016-06-07T13:23:26Z</dc:date>
    <item>
      <title>USB host cdc with modem not cdc_acm/cdc_data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-host-cdc-with-modem-not-cdc-acm-cdc-data/m-p/511890#M5278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with FRDM-KL26 that we have "boosted" with the KL26256.&lt;/P&gt;&lt;P&gt;I'm working with KSDK 1.3 and Keil IDE.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the provided FRDM-KL46Z usb host CDC sample.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything is working perfectly when I attach a real USB CDC ACM compliant device. I have tested with a home made CDC device and a commercial modem from gemalto (BGS5T).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I have tryied to attach another modem that is not CDC ACM compliant (quectel UC15). This modem expose 5 interfaces with 0xFF in both class, sub class and protocol.&lt;/P&gt;&lt;P&gt;The modem "should" work using the fourth interface that expose three endpoints : an int in, a bulk out and a bulk in.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the modem to be recognized I have added in cdc_serial.c a driver info to match the VID/PID (05C6, 9090).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The USB modem is then well recognized but only for its cdc_acm interface and not the cdc_data interface. So, data_init class is never called and nothing is working.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is :&lt;/P&gt;&lt;P&gt;How can I define a cdc peripheral that in the same interface expose two different usb classes ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SDK 1.3 doesn't seem to support this kind of architecture.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thnks,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 10:26:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-host-cdc-with-modem-not-cdc-acm-cdc-data/m-p/511890#M5278</guid>
      <dc:creator>alainbridel</dc:creator>
      <dc:date>2016-05-10T10:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: USB host cdc with modem not cdc_acm/cdc_data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-host-cdc-with-modem-not-cdc-acm-cdc-data/m-p/511891#M5279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alain, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are you defining your DriverInfoTable? Remember that current example logic is using one callback for Control Interface and other one for Data interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are you checking that "device is recognized correctly"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 00:53:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-host-cdc-with-modem-not-cdc-acm-cdc-data/m-p/511891#M5279</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-06-07T00:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: USB host cdc with modem not cdc_acm/cdc_data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-host-cdc-with-modem-not-cdc-acm-cdc-data/m-p/511892#M5280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I'd like you to know that I have solved my problem in stepping in a lot in the KSDK USB library (4 long weeks...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So The probleme was simple to solve once I have understood how things "could" work and not "should" work.&lt;/P&gt;&lt;P&gt;The CDC Host driver is requesting two differents interfaces: one for the CDC ACM and one for the CDC Data.&lt;/P&gt;&lt;P&gt;So, in the DriverInfoTable there are two entries, with two differents callback. That's good enough for most USB devices but not for modems that generaly expose a lot of interfaces with class, subclass and protocol equal to 0xFF, that is, vendor specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 4 USB modems in here, and each one got specific interfaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First one got 2 CDC ACM and 2 CDC Data :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To solve carrying this modem I have updated the usb_host_cdc_acm_event callback to deal with it this way :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int the switch case USB_CONFIG_EVENT:&lt;/P&gt;&lt;P&gt;Simply, recast the dev_hanle to a dev_instance_t* and the intf_handle to a usb_device_interface_struct_t*&lt;/P&gt;&lt;P&gt;then test that this is my product : if (dev_ptr-&amp;gt;dev_descriptor.idVendor[1] == 0x1e &amp;amp;&amp;amp;&amp;nbsp; dev_ptr-&amp;gt;dev_descriptor.idVendor[0] == 0x2d)&lt;/P&gt;&lt;P&gt;and test that this is the first interface : if (intf-&amp;gt;lpinterfaceDesc-&amp;gt;bInterfaceNumber == 0) {&lt;/P&gt;&lt;P&gt;if so, I set the acm_intf_handle and that's enought for the acm part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next I have updated the usb_host_cdc_data_event callback to also react on the good interface. Same cast, same test except on the requested interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And everything is ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 3 other modems got some vendor specific class, and specifically, they all have only one interface that handle the 3 requested endpoints (ctrl, in and out).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To deal with those modems I have added an entry in the DriverInfoTable like this :&lt;/P&gt;&lt;P&gt;// QUECTEL UC15&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0xC6,0x05},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {0x90,0x90},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFF, 0xFF, 0xFF, 0, mycallback&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;same for SIERRA MC8092 and HUAWEI MU709S, but this is not enought. I had to update the class_interface_map driver, allocate a fake ACM controller, pepper, salt, mix everything et voilà ! It works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS : I don't think I'll go to SDK 2.0 since everything has changed ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 13:23:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-host-cdc-with-modem-not-cdc-acm-cdc-data/m-p/511892#M5280</guid>
      <dc:creator>alainbridel</dc:creator>
      <dc:date>2016-06-07T13:23:26Z</dc:date>
    </item>
  </channel>
</rss>

