<?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: dev_hid_generic_freertos_twrk65f180m with multiple end points</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491659#M4445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I answered half of my own question. The endpoint causing the USBDeviceGenericCallback() to be called can be found by:&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #0326cc;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endpointAddress = ((&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;usb_device_hid_struct_t&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; *)handle)-&amp;gt;&lt;/SPAN&gt;interfaceHandle&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;endpointList&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;endpoint&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;endpointAddress&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Apr 2016 23:41:27 GMT</pubDate>
    <dc:creator>kirkclendinning</dc:creator>
    <dc:date>2016-04-08T23:41:27Z</dc:date>
    <item>
      <title>dev_hid_generic_freertos_twrk65f180m with multiple end points</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491658#M4444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to add end points to the usb example, dev_hid_generic_freertos_twrk65f180m. I added end points to the descriptor and indeed, the TWR-K65F180M enumerates, correctly for all of the end points. However, when trying to send USB messages, only the first set of end points, 0x01 and 0x81 cause the USB_DeviceGenericCallback() method to be called. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, even if the USB_DeviceGenericCallback() were called for all of the end points, I don't see from its arguments class_handle_t handle, &lt;SPAN style="color: #006141;"&gt;uint32_t&lt;/SPAN&gt; event and &lt;SPAN style="color: #931a68;"&gt;void&lt;/SPAN&gt; *param, for which end point the call was made. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an HID example that I've missed, which illustrates more than a pair of end points? If not, perhaps someone with more insight into the Kinetis USB middleware stack could point me in the right direction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 20:55:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491658#M4444</guid>
      <dc:creator>kirkclendinning</dc:creator>
      <dc:date>2016-04-08T20:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: dev_hid_generic_freertos_twrk65f180m with multiple end points</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491659#M4445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I answered half of my own question. The endpoint causing the USBDeviceGenericCallback() to be called can be found by:&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #0326cc;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endpointAddress = ((&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;usb_device_hid_struct_t&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; *)handle)-&amp;gt;&lt;/SPAN&gt;interfaceHandle&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;endpointList&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;endpoint&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;endpointAddress&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 23:41:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491659#M4445</guid>
      <dc:creator>kirkclendinning</dc:creator>
      <dc:date>2016-04-08T23:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: dev_hid_generic_freertos_twrk65f180m with multiple end points</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491660#M4446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sadly, documentation for the FreeRTOS USB stack in SDK is woefully inadequate. If one simply wants to use a template and replace a few constants or rewrite a few methods, it's fine. But, if one wants to understand how the stack works, then too much time is required. The problem is that global macros used to choose between different running options are usually only documented by a comment. Let's take USB_DEVICE_CONFIG_USE_TASK as an example.&amp;nbsp; Here's the entry from usb_device_config.h. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco; color: #4f76cb;"&gt;/*! &lt;SPAN style="color: #91afcb;"&gt;@brief&lt;/SPAN&gt; Whether the device task is enabled. */&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;SPAN style="color: #931a68;"&gt;#define&lt;/SPAN&gt; USB_DEVICE_CONFIG_USE_TASK (0U)&lt;/P&gt;&lt;P style="font-size: 11px; font-family: Monaco;"&gt;&lt;/P&gt;&lt;P&gt;The default is for the task to be disabled. However, in the example, USB appears to work. So, what does this global do? Ah, as a desperate measure, let's check out the documentation. The USB Stack Device reference Manual gives a hint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="column"&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.000000pt; font-family: 'NimbusRomNo9L';"&gt;#define &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.000000pt; font-family: 'NimbusRomNo9L'; color: rgb(0.000000%, 0.000000%, 100.000000%);"&gt;USB_DEVICE_CONFIG_USE_TASK &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.000000pt; font-family: 'NimbusRomNo9L';"&gt;(0U) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.000000pt; font-family: 'NimbusRomNo9L'; font-style: italic;"&gt;Whether the device task is enabled. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The USB Stack User's Guide omits the Macros. The USB Stack Composite Device User's Guide adds:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="column"&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.000000pt; font-family: 'TimesNewRomanPSMT';"&gt;10. Poll the device task when the “USB_DEVICE_CONFIG_USE_TASK” is none-zero. Poll the &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.000000pt; font-family: 'TimesNewRomanPSMT';"&gt;HID keyboard and HID generic task when these tasks are implemented. &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="jive-pre"&gt;&lt;SPAN style="font-size: 9.000000pt; font-family: 'CourierNewPSMT';"&gt;#if USB_DEVICE_CONFIG_USE_TASK #if defined(USB_DEVICE_CONFIG_EHCI) &amp;amp;&amp;amp; (USB_DEVICE_CONFIG_EHCI &amp;gt; 0U) &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="jive-pre"&gt;&lt;SPAN style="font-size: 9.000000pt; font-family: 'CourierNewPSMT';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_DeviceEhciTaskFunction(g_UsbDeviceComposite.deviceHandle); #endif &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="jive-pre"&gt;&lt;SPAN style="font-size: 9.000000pt; font-family: 'CourierNewPSMT';"&gt;#if defined(USB_DEVICE_CONFIG_KHCI) &amp;amp;&amp;amp; (USB_DEVICE_CONFIG_KHCI &amp;gt; 0U) &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="jive-pre"&gt;&lt;SPAN style="font-size: 9.000000pt; font-family: 'CourierNewPSMT';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_DeviceKhciTaskFunction(g_UsbDeviceComposite.deviceHandle); #endif &lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.000000pt; font-family: 'CourierNewPSMT';"&gt;#endif &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which brings two more undefined macros into the mix. One would have thought that &lt;SPAN style="font-family: TimesNewRomanPSMT; font-size: 16px;"&gt;USB_DEVICE_CONFIG_USE_TASK would have needed to be 1 for the example to work, yet it appears just the opposite. The amount of time needed to wind through the example code is such that it might be quicker to simply write the usb driver one's self.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 23:03:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491660#M4446</guid>
      <dc:creator>kirkclendinning</dc:creator>
      <dc:date>2016-04-11T23:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: dev_hid_generic_freertos_twrk65f180m with multiple end points</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491661#M4447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;SPAN style="color: #303030;"&gt; Kirk.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;I apologize for the late response, but I consulted your issue with Application Team. Please refer to their answer below. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif; color: #303030;"&gt;Regarding the multiple pairs of endpoints enablement, I think you are using the HID generic class driver, for such standard class driver, only one pair of endpoint could be supported for sure. By no means, you could use a standard generic class driver to support a non-standard user case (multiple pairs of endpoints). Instead, you should use the usb_device_hid_generic_lite example, which has no standard class driver, so it is easy for you to add more endpoints support.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; color: #303030; font-size: 10pt;"&gt;&lt;STRONG&gt;USB_DEVICE_CONFIG_USE_TASK&lt;/STRONG&gt; is a configuration item, means it could be configured by the customers according to their requirements. So whatever it is 0 or 1, our default example should work fine always. You should not assume a mandatory 1 or 0 could work. And from the MACRO word itself, the meaning is very clear, it is a configuration item to choose if the task need to be used.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030; font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;&lt;STRONG&gt;USB_DEVICE_CONFIG_EHCI and USB_DEVICE_CONFIG_EHCI&lt;/STRONG&gt; are two configuration item too. In the USB device RM, the description is as below, it is simple but intuitive. Why do you mention it as undefined macros? Why “One would have thought that USB_DEVICE_CONFIG_USE_TASK would have needed to be 1 for the example to work”, the code logic is if you defined USB_DEVICE_CONFIG_USE_TASK, then some additional actions need to be performed; If the macro is not defined, then these actions are not needed. There is no explicit or implicit hint that this USB_DEVICE_CONFIG_USE_TASK need to be 1.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pic.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/906i2FBA827EE80D7D0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;I hope this helps. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Iva&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 14:54:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491661#M4447</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2016-05-18T14:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: dev_hid_generic_freertos_twrk65f180m with multiple end points</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491662#M4448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;two years later and same thing. it's crazy how much tribal knowledge you have to accumulate to write an app that uses the USB stack. I know NXP ported dean camera's LUFA for some other platforms, would be a heaven send if there were a well documented stack available for the I.MX since one of it's biggest selling points is multiple dual role usb ports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some of my biggest headaches:&lt;/P&gt;&lt;P&gt;all of the configuration settings you need to uncomment to enable usb stack drivers (USB_CONFIG_AUDIO, USB_DEVICE_CONFIG_KHCI)&lt;/P&gt;&lt;P&gt;if you move the default configuration files, they are silently recreated in source/generated&lt;/P&gt;&lt;P&gt;no simple documentation of the difference between the freeRTOS and regular OSA drivers (what does USB_DEVICE_CONFIG_USE_TASK do?)&lt;/P&gt;&lt;P&gt;no good instructions for writing your own class driver (i've been battling an issue for months where my host instance would stop receiving messages if i paused the debugger and anything came on usb while it was paused. It turns out, in my call to prime the receiver, I requested the&amp;nbsp;size of the receiving buffer rather than the size of of the maximum message the device could send. i only discovered this by copying example drivers line by line until something changed.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds from Iva response below that NXP doesn't really see how this is a problem on their end..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2019 07:56:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/dev-hid-generic-freertos-twrk65f180m-with-multiple-end-points/m-p/491662#M4448</guid>
      <dc:creator>benolayinka</dc:creator>
      <dc:date>2019-08-27T07:56:00Z</dc:date>
    </item>
  </channel>
</rss>

