<?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: Reduce source code size for Kinetis Series MKL03 in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Reduce-source-code-size-for-Kinetis-Series-MKL03/m-p/816848#M882</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="310542" data-username="tomazlov" href="https://community.nxp.com/people/tomazlov"&gt;Tomaz Lovrencic&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to disable “printf()”， also don't include &amp;lt;stdio.h&amp;gt;, then the size of bare board project is almost 2k,&lt;/P&gt;&lt;P&gt;and you can also reduce the codes in drivers that don't use.&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/76735i76967A92455D04A0/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;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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>Tue, 23 Oct 2018 04:13:37 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2018-10-23T04:13:37Z</dc:date>
    <item>
      <title>Reduce source code size for Kinetis Series MKL03</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Reduce-source-code-size-for-Kinetis-Series-MKL03/m-p/816847#M881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In our design we are using Kinetis MKL03Z8 with only 8KB of flash. We have been able to&amp;nbsp;program needed application from peripheral examples on test board FRDM-KL03Z (LPUART and I2C + using VLLS modes) but firmware is to large to fit into 8KB. I also try barebone SDK&amp;nbsp;(v2.3.1) minimalistic example&amp;nbsp;("&lt;EM&gt;demo_apps-&amp;gt;hello_world&lt;/EM&gt;")&amp;nbsp; inside MCUExpresso, but I could not get below 9KB PROGRAM_FLASH, even with optimization level for size (&lt;EM&gt;-Os&lt;/EM&gt;). How can i further reduce&amp;nbsp;program size (I assume examples have some ballast) or where I get driver/example files (e.g. MWE) with smallest footprint possible for LPUART, I2C master peripheral to fit into 8KB region space?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 08:02:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Reduce-source-code-size-for-Kinetis-Series-MKL03/m-p/816847#M881</guid>
      <dc:creator>tomazlov</dc:creator>
      <dc:date>2018-10-22T08:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce source code size for Kinetis Series MKL03</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Reduce-source-code-size-for-Kinetis-Series-MKL03/m-p/816848#M882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="310542" data-username="tomazlov" href="https://community.nxp.com/people/tomazlov"&gt;Tomaz Lovrencic&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to disable “printf()”， also don't include &amp;lt;stdio.h&amp;gt;, then the size of bare board project is almost 2k,&lt;/P&gt;&lt;P&gt;and you can also reduce the codes in drivers that don't use.&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/76735i76967A92455D04A0/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;Hope it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&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>Tue, 23 Oct 2018 04:13:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Reduce-source-code-size-for-Kinetis-Series-MKL03/m-p/816848#M882</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2018-10-23T04:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reduce source code size for Kinetis Series MKL03</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Reduce-source-code-size-for-Kinetis-Series-MKL03/m-p/816849#M883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alice_Yang, thanks for the suggestion. If anyone will find this useful, I ended up with these modification steps (also including Alice_Yang suggestion), which greatly improves code size&amp;nbsp;of the examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- use &lt;EM&gt;baremetal&lt;/EM&gt; example and manually pasting only needed driver/other files,&lt;/P&gt;&lt;P&gt;- use &lt;EM&gt;Redlib(none)&lt;/EM&gt; semihosting option,&lt;/P&gt;&lt;P&gt;- exclude &lt;EM&gt;&amp;lt;stdio.h&amp;gt;&lt;/EM&gt; and &lt;EM&gt;printf()&lt;/EM&gt; functions. For production stage use LPUART_WriteBlocking() for strings and LPUART_WriteByte() for bytes with &lt;EM&gt;LPUART_IRQHandler()&lt;/EM&gt; for RX,&lt;/P&gt;&lt;P&gt;- remove preprocessor compiler directives: DEBUG, PRINTF_FLOAT_ENABLE, CR_INTEGER_PRINTF, PRINTF_ADVANCED_ENABLE. Instead use NDEBUG which supresses &lt;EM&gt;asserts&lt;/EM&gt; and &lt;EM&gt;printfs&lt;/EM&gt; throughout the whole project,&lt;/P&gt;&lt;P&gt;- set optimization level&amp;nbsp;for &lt;EM&gt;size (-Os)&lt;/EM&gt;,&lt;/P&gt;&lt;P&gt;- debug level to&lt;EM&gt; None&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way I managed to get down to 6KB including needed peripheral drivers and my code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2018 06:40:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Reduce-source-code-size-for-Kinetis-Series-MKL03/m-p/816849#M883</guid>
      <dc:creator>tomazlov</dc:creator>
      <dc:date>2018-11-08T06:40:40Z</dc:date>
    </item>
  </channel>
</rss>

