<?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: Trouble with HOST HID examples in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266125#M8604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, i forget say that i´m working with TWR-K20D72M Tower kit complete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 May 2013 15:36:26 GMT</pubDate>
    <dc:creator>robertofrechill</dc:creator>
    <dc:date>2013-05-30T15:36:26Z</dc:date>
    <item>
      <title>Trouble with HOST HID examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266124#M8603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! I´m working with Bare metal USB Stack 4.1.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´m debbugging this HOST HID examples in Codewarrior 10.3 and it doesn´t work! :smileysad:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first appears the message:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;USB HID Mouse&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Waiting for USB Mouse to be attached...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then, when i plug a mouse, the message: '&lt;STRONG&gt;' ISR is entered on vector number 0x3" &lt;/STRONG&gt;and it repit forever while device is plugging. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody could help me with this? thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 15:35:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266124#M8603</guid>
      <dc:creator>robertofrechill</dc:creator>
      <dc:date>2013-05-30T15:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with HOST HID examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266125#M8604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, i forget say that i´m working with TWR-K20D72M Tower kit complete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 15:36:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266125#M8604</guid>
      <dc:creator>robertofrechill</dc:creator>
      <dc:date>2013-05-30T15:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with HOST HID examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266126#M8605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. Did you try with a different mouse?&lt;/P&gt;&lt;P&gt;just to see if the problem is general or maybe triggered by some devices&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 19:10:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266126#M8605</guid>
      <dc:creator>mauroansaloni</dc:creator>
      <dc:date>2013-05-30T19:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with HOST HID examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266127#M8606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For what it's worth... I don't think it's related to the hardware.&amp;nbsp; This hidmouse example works with USB stack 4.0.3, just not the latest OS-less 4.1.1 (I'm seeing the same Hard Fault on the TWR-K20D50M).&amp;nbsp; F&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;or what it's worth...according to the vector table (in vectors.c), that vector number corresponds to "ivINT_Hard_Fault".&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may help to study the differences between the two stacks to see what key thing might have changed and caused this.&amp;nbsp; I'm interested to investigate this as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rich&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 19:37:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266127#M8606</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2013-05-30T19:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with HOST HID examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266128#M8607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found where the issue was and was able to get this working.&amp;nbsp; Navigate to the driver/khci_kinetis.c file and comment out line 49: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;49:&amp;nbsp; //#define _BDT_RESERVED_SECTION_&amp;nbsp; // TBD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may not be the best solution, but it should get you up and going for your hid mouse example (this _BDT_RESERVED_SECTION_&amp;nbsp; was previously undefined in 4.0.3 and appeared to be the key difference for me).&amp;nbsp; It now works on my end on the TWR-K20D50M.&amp;nbsp; Also, since the modification is to the low-level driver code which is shared by the other USB classes on your machine, you might want to make a note of this in case this breaks other USB apps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any luck with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 21:52:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266128#M8607</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2013-05-30T21:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with HOST HID examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266129#M8608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That define is used to control if a global variable is reserved for the bdt USB buffer, or if the memory for the buffer shall by allocated dynamically (e.g. malloc()).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you using the Freescale (non-gcc) ARM compiler?&lt;/P&gt;&lt;P&gt;If that define is defined, then this code is active:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;#ifdef __CWCC__&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;#pragma define_section usb_bdt ".usb_bdt" RW&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;__declspec(usb_bdt) uint_8_ptr bdt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It means that there needs to be a memory area allocated in the linker file for the USB bdt block, otherwise it will fail.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;Obviously this is missing in the example :-(.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my applications I don't want depend on malloc() for the buffer, so I use a static variable. But then it depends on the linker/compiler how to allocate this variable. The problem is that it needs to be aligned at a 512 byte boundary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;With ARM gcc this can be done in the source with&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;__attribute__((__aligned__(512))) uint8 bdt[512];&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;but not with the Freescale Kinetis compiler. To my knowledge you cannot align a variable in the source. This needs to be done in the linker file.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;So I would say a better fix would be this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* Global variables */&lt;/P&gt;&lt;P&gt;#ifndef __CWCC__ /* Freescale (non-gcc) Kinetis compiler. If the macro below is enabled, the bdt buffer needs to be defined in the linker file */&lt;/P&gt;&lt;P&gt;&amp;nbsp; #define _BDT_RESERVED_SECTION_ /* if defined, we use a static buffer (instead of malloc()), on a 512 byte boundary */&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps to clarify the issue. I have passed this to the USB stack team.&lt;BR /&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 06:51:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266129#M8608</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2013-05-31T06:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with HOST HID examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266130#M8609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys! I fixed the problem!! the solutions are comment out this lines of driver/khci_kinetis.c file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;49:&amp;nbsp; //#define _BDT_RESERVED_SECTION_&amp;nbsp; // TBD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;.......&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;592://#if!(defined _BDT_RESERVED_SECTION_) /* &amp;lt;&amp;lt; EST */&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;594://#endif /* &amp;lt;&amp;lt; EST */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 09:52:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trouble-with-HOST-HID-examples/m-p/266130#M8609</guid>
      <dc:creator>robertofrechill</dc:creator>
      <dc:date>2013-05-31T09:52:29Z</dc:date>
    </item>
  </channel>
</rss>

