<?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 Generic HID Device Example Code - Why is this &amp;quot;send&amp;quot; embedded in the receive function? in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-Why-is-this-quot-send-quot/m-p/807445#M989</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I debug the project and find below code:&lt;/P&gt;&lt;P&gt;usb_status_t USB_DeviceLpc3511IpRecv(usb_device_controller_handle controllerHandle,&lt;BR /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t endpointAddress,&lt;BR /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t *buffer,&lt;BR /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t length)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return USB_DeviceLpc3511IpSend(controllerHandle, endpointAddress, buffer, length);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;In fact, the USB_DeviceLpc3511IpSend() function doesn't mean the USB device send data to USB host.&lt;/P&gt;&lt;P&gt;The data direction based on the endpoint is IN or OUT.&lt;/P&gt;&lt;P&gt;From the previous code, the endpoint direction is OUT, which means the USB host send data to USB slave.&lt;/P&gt;&lt;P&gt;The USB_DeviceLpc3511IpSend() function name does add the confusion.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;While, the actual function called here to receive data from USB Host(PC).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Sep 2018 06:14:18 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2018-09-29T06:14:18Z</dc:date>
    <item>
      <title>USB Generic HID Device Example Code - Why is this "send" embedded in the receive function?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-Why-is-this-quot-send-quot/m-p/807444#M988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I'm using the LPCXpresso54608 SDK for MCUXpresso.&amp;nbsp; In particular, I'm running the generic HID device with FreeRTOS example code (&lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="11497" data-containertype="14" data-objectid="484970" data-objecttype="1" href="https://community.nxp.com/thread/484970" style="color: #3d9ce7; background-color: #ffffff; border: 0px; font-size: 14px; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;link to my code/setup&lt;/A&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The purpose of the code is to echo data sent from a PC program back to the PC.&amp;nbsp; This all works as intended, but now I'm trying to modify it for my specific application needs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;In the function "USB_DeviceHidGenericCallback", the switch/case called after receiving a USB message includes a call to "USB_DeviceHidSend" which performs the echo function ... so far so good.&amp;nbsp; After that, within the same switch/case "USB_DeviceHidRecv" which eventually calls "USB_DeviceLpc3511IpRecv" which is the device specific call for the&amp;nbsp;&lt;SPAN&gt;LPCXpresso54608 development board ... again, so far so good.&amp;nbsp; But then, within "&lt;SPAN style="background-color: #ffffff;"&gt;USB_DeviceLpc3511IpRecv", the only function is to call "USB_DeviceLpc3511IpSend".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #005032;"&gt;usb_status_t&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; &lt;STRONG style="background: silver;"&gt;USB_DeviceLpc3511IpRecv&lt;/STRONG&gt;(usb_device_controller_handle controllerHandle,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: black;"&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #005032;"&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; endpointAddress,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: black;"&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #005032;"&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; *buffer,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: black;"&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #005032;"&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; length)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black; font-family: 'courier new', courier, monospace;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #7f0055;"&gt;return&lt;/STRONG&gt;&lt;SPAN style="color: black;"&gt; USB_DeviceLpc3511IpSend(controllerHandle, endpointAddress, buffer, length);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: #3f7f5f; font-family: 'courier new', courier, monospace;"&gt;// Example code echo data???&amp;nbsp; NBG&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: #3f7f5f; font-family: 'courier new', courier, monospace;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; return kStatus_USB_Success;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px; color: black; font-family: 'courier new', courier, monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;My initial thought was that this was simply an accidental redundant means of echoing the received data, but when it is called, no data is received by the PC.&amp;nbsp; I attempted to replace the call with a return of the enumerated value for a successful USB operation, but then the ENTIRE PROGRAM STOPPED FUNCTIONING AND I HAVE NO IDEA WHY!!!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;If anyone knows what the purpose is for the send within the receive shown above, please let me know.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thank you in advance!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 22:53:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-Why-is-this-quot-send-quot/m-p/807444#M988</guid>
      <dc:creator>nbgatgi</dc:creator>
      <dc:date>2018-09-28T22:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: USB Generic HID Device Example Code - Why is this "send" embedded in the receive function?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-Why-is-this-quot-send-quot/m-p/807445#M989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I debug the project and find below code:&lt;/P&gt;&lt;P&gt;usb_status_t USB_DeviceLpc3511IpRecv(usb_device_controller_handle controllerHandle,&lt;BR /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t endpointAddress,&lt;BR /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t *buffer,&lt;BR /&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t length)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return USB_DeviceLpc3511IpSend(controllerHandle, endpointAddress, buffer, length);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;In fact, the USB_DeviceLpc3511IpSend() function doesn't mean the USB device send data to USB host.&lt;/P&gt;&lt;P&gt;The data direction based on the endpoint is IN or OUT.&lt;/P&gt;&lt;P&gt;From the previous code, the endpoint direction is OUT, which means the USB host send data to USB slave.&lt;/P&gt;&lt;P&gt;The USB_DeviceLpc3511IpSend() function name does add the confusion.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;While, the actual function called here to receive data from USB Host(PC).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Sep 2018 06:14:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-Why-is-this-quot-send-quot/m-p/807445#M989</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-09-29T06:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: USB Generic HID Device Example Code - Why is this "send" embedded in the receive function?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-Why-is-this-quot-send-quot/m-p/807446#M990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your reply didn't really answer the question.&amp;nbsp; What is the functional purpose of the SEND in this context?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 18:34:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-Why-is-this-quot-send-quot/m-p/807446#M990</guid>
      <dc:creator>nbgatgi</dc:creator>
      <dc:date>2018-10-26T18:34:57Z</dc:date>
    </item>
  </channel>
</rss>

