<?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のトピックSending strings using USB_Class_CDC_Send_Data</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-strings-using-USB-Class-CDC-Send-Data/m-p/541909#M5577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the USB CDC VCOM code found in KSDK 1.3.0 and I'm attempting to write a string to my terminal.&amp;nbsp; The call is simple:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;USB_Class_CDC_Send_Data(applicationHandle, DIC_BULK_IN_ENDPOINT, "Hello, World!", 13);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried casting (uint8_t*)"Hello, World!".&amp;nbsp; Both methods print some non ASCII characters:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="156413_156413.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122052i2D5FEB5A77995AD2/image-size/large?v=v2&amp;amp;px=999" role="button" title="156413_156413.PNG" alt="156413_156413.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37000iD0B26D4113F2528E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I played around with it and did this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t *buffer;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer = malloc(size);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(buffer, "Hello, World!", 13);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_Class_CDC_Send_Data(applicationHandle, DIC_BULK_IN_ENDPOINT, buffer, 13);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and it prints:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="156414_156414.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122053i7FBDA76BEA49963B/image-size/large?v=v2&amp;amp;px=999" role="button" title="156414_156414.PNG" alt="156414_156414.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37043i9D573A760CCCE6F9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't believe I should have to copy the buffer in order to print the message, so what am I doing wrong; or what is the SDK doing that's preventing me from simply printing out a specified byte sequence.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jul 2016 15:36:07 GMT</pubDate>
    <dc:creator>kevinlfw</dc:creator>
    <dc:date>2016-07-26T15:36:07Z</dc:date>
    <item>
      <title>Sending strings using USB_Class_CDC_Send_Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-strings-using-USB-Class-CDC-Send-Data/m-p/541909#M5577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the USB CDC VCOM code found in KSDK 1.3.0 and I'm attempting to write a string to my terminal.&amp;nbsp; The call is simple:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;USB_Class_CDC_Send_Data(applicationHandle, DIC_BULK_IN_ENDPOINT, "Hello, World!", 13);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried casting (uint8_t*)"Hello, World!".&amp;nbsp; Both methods print some non ASCII characters:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="156413_156413.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122052i2D5FEB5A77995AD2/image-size/large?v=v2&amp;amp;px=999" role="button" title="156413_156413.PNG" alt="156413_156413.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37000iD0B26D4113F2528E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I played around with it and did this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t *buffer;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer = malloc(size);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(buffer, "Hello, World!", 13);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_Class_CDC_Send_Data(applicationHandle, DIC_BULK_IN_ENDPOINT, buffer, 13);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and it prints:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="156414_156414.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122053i7FBDA76BEA49963B/image-size/large?v=v2&amp;amp;px=999" role="button" title="156414_156414.PNG" alt="156414_156414.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37043i9D573A760CCCE6F9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't believe I should have to copy the buffer in order to print the message, so what am I doing wrong; or what is the SDK doing that's preventing me from simply printing out a specified byte sequence.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 15:36:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-strings-using-USB-Class-CDC-Send-Data/m-p/541909#M5577</guid>
      <dc:creator>kevinlfw</dc:creator>
      <dc:date>2016-07-26T15:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sending strings using USB_Class_CDC_Send_Data</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-strings-using-USB-Class-CDC-Send-Data/m-p/541910#M5578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I apologize for the late response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This behaviour is expected and is correct.&lt;/P&gt;&lt;P&gt;If you refer to structure of the function, there is expected &lt;STRONG&gt;pointer on &lt;/STRONG&gt;buffer.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;uint8_t* app_buff,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14715248197356399" data-hasrefreshed="true" data-renderedposition="215.60000610351562_8_1192_128" jivemacro_uid="_14715248197356399"&gt;&lt;P&gt;usb_status USB_Class_CDC_Send_Data&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;cdc_handle_t cdc_handle,&lt;/P&gt;&lt;P&gt;uint8_t ep_num,&lt;/P&gt;&lt;P&gt;uint8_t* app_buff,&lt;/P&gt;&lt;P&gt;uint32_t size&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because - if you hand over &lt;STRONG&gt;text&lt;/STRONG&gt; parameter (instead of pointer on buffer), there will be displayed content which is on this address in hexa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this explains your question.&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>Thu, 18 Aug 2016 13:28:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Sending-strings-using-USB-Class-CDC-Send-Data/m-p/541910#M5578</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2016-08-18T13:28:27Z</dc:date>
    </item>
  </channel>
</rss>

