<?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: How am I supposed to use the USB component on an MKL26z32 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608061#M35888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bernd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uTasker KL26 framework = &lt;STRONG&gt;6'362&lt;/STRONG&gt; bytes of Flash (scheduler, general system drivers, etc.)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB mouse&lt;/STRONG&gt; = &lt;STRONG&gt;13'531&lt;/STRONG&gt; bytes of Flash (FS USB driver + HID mouse class and operation)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB-CDC application&lt;/STRONG&gt; = &lt;STRONG&gt;14'083&lt;/STRONG&gt; bytes of Flash (FS USB driver + CDC class and operation)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB-CDC application and HID MOUSE&lt;/STRONG&gt; (composite) = &lt;STRONG&gt;14'563&lt;/STRONG&gt; bytes of Flash (FS USB driver + CDC class and operation + HID class and mouse operation)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB-CDC application and HID MOUSE and keyboard&lt;/STRONG&gt; (composite) = &lt;STRONG&gt;15'431&lt;/STRONG&gt; bytes of Flash (FS USB driver + CDC class and operation + HID class and mouse + keyboard operation)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tested on the Teensy LC and Freedom boards (setup for 32k/4k memory)&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTEENSY_LC.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TEENSY_LC.html&lt;/A&gt;&lt;SPAN&gt; / &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KL26Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL26Z.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Built with make file (GCC with -Os)&lt;/EM&gt; [also builds with KDS, CW, S32 Design Studio, IAR, Keil, Atollic, Rowley, Green Hills, CooCox]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flash consumption (on 32k/4k part) is not a problem generally but the SRAM &lt;EM&gt;may&lt;/EM&gt; be a little tight together with further application requirements. The NXP examples probably are not designed for efficiency and potentially will be worse for SRAM consumption ((?) the more critical part) because larger Flash/RAM chips are available that are more interesting for sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above references are industrially proven in various products (&amp;gt; 5 years) and thus robust, efficient, documented and can be simulated in the uTasker Kinetis simulator for further analysis, extension etc. With professional personal support if desired or &lt;STRONG&gt;FREE&lt;/STRONG&gt; if not (but still with basic supported in this forum).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;BR /&gt;&lt;SPAN&gt;Kinetis for professionals: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2016 12:09:43 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2016-10-27T12:09:43Z</dc:date>
    <item>
      <title>How am I supposed to use the USB component on an MKL26z32</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608060#M35887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How am I supposed to use the USB peripheral on an MKL26z32 when the generated code for an empty(!) project with USB HID in Kinetis Design studio already overflows the available Flash of 32k by 3k?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I generated an empty project in KDS and after building that "empty" project for the first time it generated 10k code and after enabling -Os and -flto it was still 8k.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I added the usb hid device component, configured it for "mouse" and it overflowed the available flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the purpose of the USB-Peripheral in the KL26z32 if it can't be used with Kinetis IDE software? What are my Options now? Should I spend the time to learn the lowest levels of USB communication and write my own USB driver from scratch, thereby reducing the needed size from 35k to probably less than 5k? Or maybe has someone else already written a bare bones minimal driver for this peripheral together with a simple demo app, preferrably completely IDE-agnostic (plain and simple makefile project)? Does something like that exist?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 09:29:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608060#M35887</guid>
      <dc:creator>prof7bit</dc:creator>
      <dc:date>2016-10-27T09:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: How am I supposed to use the USB component on an MKL26z32</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608061#M35888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bernd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uTasker KL26 framework = &lt;STRONG&gt;6'362&lt;/STRONG&gt; bytes of Flash (scheduler, general system drivers, etc.)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB mouse&lt;/STRONG&gt; = &lt;STRONG&gt;13'531&lt;/STRONG&gt; bytes of Flash (FS USB driver + HID mouse class and operation)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB-CDC application&lt;/STRONG&gt; = &lt;STRONG&gt;14'083&lt;/STRONG&gt; bytes of Flash (FS USB driver + CDC class and operation)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB-CDC application and HID MOUSE&lt;/STRONG&gt; (composite) = &lt;STRONG&gt;14'563&lt;/STRONG&gt; bytes of Flash (FS USB driver + CDC class and operation + HID class and mouse operation)&lt;BR /&gt;uTasker KL26 framework with &lt;STRONG&gt;USB-CDC application and HID MOUSE and keyboard&lt;/STRONG&gt; (composite) = &lt;STRONG&gt;15'431&lt;/STRONG&gt; bytes of Flash (FS USB driver + CDC class and operation + HID class and mouse + keyboard operation)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tested on the Teensy LC and Freedom boards (setup for 32k/4k memory)&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTEENSY_LC.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TEENSY_LC.html&lt;/A&gt;&lt;SPAN&gt; / &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KL26Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL26Z.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Built with make file (GCC with -Os)&lt;/EM&gt; [also builds with KDS, CW, S32 Design Studio, IAR, Keil, Atollic, Rowley, Green Hills, CooCox]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Flash consumption (on 32k/4k part) is not a problem generally but the SRAM &lt;EM&gt;may&lt;/EM&gt; be a little tight together with further application requirements. The NXP examples probably are not designed for efficiency and potentially will be worse for SRAM consumption ((?) the more critical part) because larger Flash/RAM chips are available that are more interesting for sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above references are industrially proven in various products (&amp;gt; 5 years) and thus robust, efficient, documented and can be simulated in the uTasker Kinetis simulator for further analysis, extension etc. With professional personal support if desired or &lt;STRONG&gt;FREE&lt;/STRONG&gt; if not (but still with basic supported in this forum).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;BR /&gt;&lt;SPAN&gt;Kinetis for professionals: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 12:09:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608061#M35888</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-10-27T12:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: How am I supposed to use the USB component on an MKL26z32</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608062#M35889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bernd Kreuss&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure that you clean up your project before you rebuild it with the optimization settings (right click in project folder-&amp;gt;Clean Project). I make a simple usb-mouse project without optimizations and it was 35K but after enabling -Os, cleaning it up, and rebuilding it, the size reduce to 20K.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6302i25821D3BC5065712/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jorge Alcala&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>Wed, 02 Nov 2016 21:31:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608062#M35889</guid>
      <dc:creator>jorge_a_vazquez</dc:creator>
      <dc:date>2016-11-02T21:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How am I supposed to use the USB component on an MKL26z32</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608063#M35890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can now answer my own question, and maybe others might find this helpful too. There is a way to use the USB in lightweight bare metal projects if one does not use any of the Kinetis SDK and Design Studio/PE components. If all the tons of abstraction layers and indirections and support for features one does not want to use are left out then a working bare metal generic USB HID device driver can be written from scratch in a very straightforward and astonishingly simple way that will result in an USB-enabled hello world project with less than 2500 Bytes :smileyalert: flash requirements.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2016-11-16_09h59_36.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/10418iABA931389C6BB21F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2016-11-16_09h59_36.png" alt="2016-11-16_09h59_36.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took Kevin Cuzner's excellent work here &lt;A class="link-titled" href="http://kevincuzner.com/2014/12/12/teensy-3-1-bare-metal-writing-a-usb-driver/" title="http://kevincuzner.com/2014/12/12/teensy-3-1-bare-metal-writing-a-usb-driver/"&gt;Teensy 3.1 bare metal: Writing a USB driver | Projects &amp;amp; Libraries&lt;/A&gt; as a starting point, ported it to the KL25z FRDM board I had lying around here (It should later be possible to port this to the KL26 easily), refactored and rewrote parts of it and added a bidirectional endpoint 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main obstacles I encountered were the miserable and incomplete documentation of the Kinetis USB periperal and a complete lack of any official example code (code that demonstrates the usage of the peripheral itself and not code that merely demonstrates the incredible ability of Freescale engineers to build monstrous Layers upon Layers upon Layers of convoluted abstraction and indirection that becomes evermore obfuscated and bloated with every new version), so quite some reverse engineering and trial and error had to be done to understand the USB peripheral and still not all questions are answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting example project I have published here: &lt;A class="link-titled" href="https://github.com/prof7bit/frdm-kl25z-minimal-usb-hid" title="https://github.com/prof7bit/frdm-kl25z-minimal-usb-hid"&gt;GitHub - prof7bit/frdm-kl25z-minimal-usb-hid: minimal USB HID implementation for FRDM-KL25Z demo board&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2016 09:42:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-am-I-supposed-to-use-the-USB-component-on-an-MKL26z32/m-p/608063#M35890</guid>
      <dc:creator>prof7bit</dc:creator>
      <dc:date>2016-11-16T09:42:30Z</dc:date>
    </item>
  </channel>
</rss>

