<?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>topic Re: USB_APP_CDC_SERIAL_STATE_NOTIF is non-functional in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-APP-CDC-SERIAL-STATE-NOTIF-is-non-functional/m-p/417784#M2055</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks for your report. I passed it to SW team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2015 07:53:53 GMT</pubDate>
    <dc:creator>ivadorazinova</dc:creator>
    <dc:date>2015-06-22T07:53:53Z</dc:date>
    <item>
      <title>USB_APP_CDC_SERIAL_STATE_NOTIF is non-functional</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-APP-CDC-SERIAL-STATE-NOTIF-is-non-functional/m-p/417783#M2054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the latest Freescale Kinetis Software Development Kit (Kinetis SDK 1.2.0) for USB CDC virtual COM port, I discovered that the &lt;STRONG&gt;USB_APP_CDC_SERIAL_STATE_NOTIF &lt;/STRONG&gt;operation in the example application &lt;EM&gt;USB_App_Class_Callback()&lt;/EM&gt; function (see virtual_com.c in the cdc/virtual_com demo_apps examples) is non-functional. When the USB host sends the appropriate request associated with changing the RTS or DTR signals, the "&lt;STRONG&gt;data&lt;/STRONG&gt;" pointer referenced is always a NULL. Without any data, it is very difficult for the user to "&lt;EM&gt;add your own code for serial_state notify event&lt;/EM&gt;" as stated in the code comments.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Investigating this, I determined that there appears to be a problem with the &lt;EM&gt;USB_Service_Cdc_Notif()&lt;/EM&gt; function in the &lt;STRONG&gt;usb_cdc.c&lt;/STRONG&gt; file. In this function, the callback call (lines 434 to 438) always initializes the &lt;STRONG&gt;"data" &lt;/STRONG&gt;and&lt;STRONG&gt; "size"&lt;/STRONG&gt; pointers to NULL being passed to the callback function (eventually calling the application's &lt;EM&gt;USB_App_Class_Callback()&lt;/EM&gt; function). I was able to get it to work by changing the following lines: (shown in bold)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD colspan="1" style=""&gt;&lt;SPAN style="text-decoration: underline;"&gt;Line&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD colspan="1" style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt; 433&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;uint8_t event_type = USB_APP_CDC_SERIAL_STATE_NOTIF;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt; 434&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;cdc_obj_ptr-&amp;gt;class_specific_callback.callback(event_type,&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt; 435&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;USB_REQ_VAL_INVALID,&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;STRONG&gt; 436&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style=""&gt;&lt;STRONG&gt;&amp;amp;event-&amp;gt;buffer_ptr,&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style=""&gt;// was NULL,&lt;STRONG&gt; DLK made this bug fix&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;STRONG&gt; 437&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;STRONG&gt;&amp;amp;event-&amp;gt;len,&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style=""&gt;// was NULL,&lt;STRONG&gt; DLK made this bug fix&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt; 438&lt;/TD&gt;&lt;TD style=""&gt;cdc_obj_ptr-&amp;gt;class_specific_callback.arg);&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With those changes, the 10 bytes of data now available is typically similar to the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: #3334ca; font-family: courier new,courier;"&gt;0xa1 0x20 0x00 0x00 0x00 0x00 0x02 0x00 &lt;SPAN style="text-decoration: underline;"&gt;0x0&lt;SPAN style="color: #e23d39; text-decoration: underline;"&gt;2&lt;/SPAN&gt;&lt;/SPAN&gt; 0x00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;with the two least significant bits of the next to last byte determined by the RTS and DTR settings from the USB host's communications application.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jun 2015 02:18:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-APP-CDC-SERIAL-STATE-NOTIF-is-non-functional/m-p/417783#M2054</guid>
      <dc:creator>dankarm</dc:creator>
      <dc:date>2015-06-21T02:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: USB_APP_CDC_SERIAL_STATE_NOTIF is non-functional</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-APP-CDC-SERIAL-STATE-NOTIF-is-non-functional/m-p/417784#M2055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks for your report. I passed it to SW team.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 07:53:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-APP-CDC-SERIAL-STATE-NOTIF-is-non-functional/m-p/417784#M2055</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2015-06-22T07:53:53Z</dc:date>
    </item>
  </channel>
</rss>

