<?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 to calculate the Code size in the program in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610796#M23846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Con Verse,&lt;/P&gt;&lt;P&gt;I added:&lt;/P&gt;&lt;P&gt;    __application_size = SIZEOF(.text) + SIZEOF(.data);&lt;/P&gt;&lt;P&gt;into the section_tail.ldt script but the value that I get for the combined size of the .text &amp;amp; .data sections is not what is reported by the linker during the compile/link. Is there a better way/place to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Mar 2017 23:41:10 GMT</pubDate>
    <dc:creator>gregwilson-lind</dc:creator>
    <dc:date>2017-03-27T23:41:10Z</dc:date>
    <item>
      <title>How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610788#M23838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to do a CRC on my code to check if a code update worked. To do that in the program #I need to find out the size of the .text and .data saved in the Flash. I haven't been able to find any symbols that I can use to figure out the total size so far. Does anyone know of any symbols that are available to the program that will allow the total size of the code and data in the Flash to be calculated?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 21:49:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610788#M23838</guid>
      <dc:creator>gregwilson-lind</dc:creator>
      <dc:date>2017-03-22T21:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610789#M23839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which toolchain are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 22:16:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610789#M23839</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2017-03-22T22:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610790#M23840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LPCXpresso, so GCC I guess.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 22:21:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610790#M23840</guid>
      <dc:creator>gregwilson-lind</dc:creator>
      <dc:date>2017-03-22T22:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610791#M23841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you look n the startup file and linker script there are a bunch of symbols defined that should give you the details you need. Sorry I'm not near my tools at the moment, so can't give you the symbol names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 23:00:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610791#M23841</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2017-03-22T23:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610792#M23842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found some symbols that were not working, turns out I needed to treat them as variable names and take their addresses. All is working now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variables are:&lt;/P&gt;&lt;P&gt;__exidx_start or __exidx_end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;the end of the .text section.&lt;/P&gt;&lt;P&gt;__start_data_RAM2&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;the start of my initialized RAM data&lt;/P&gt;&lt;P&gt;__end_data_RAM2&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;the end of my initialized RAM data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the total length of .text and .data in Flash is the address of __exidx_start + the distance between the start &amp;amp; end of the RAM2 addresses.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 23:10:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610792#M23842</guid>
      <dc:creator>gregwilson-lind</dc:creator>
      <dc:date>2017-03-22T23:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610793#M23843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In loader file I added&amp;nbsp;&lt;/P&gt;&lt;P&gt;__application_size = SIZEOF(.text) + SIZEOF(.data);&lt;/P&gt;&lt;P&gt;after definition of .text and .data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warning,&lt;/P&gt;&lt;P&gt;in LpcXpresso you should &lt;STRONG&gt;uncheck&lt;/STRONG&gt; &lt;EM&gt;Manage Linker Script&lt;/EM&gt;, located in&lt;/P&gt;&lt;P&gt;proprierties -&amp;gt; C/C++ Build -&amp;gt; Tool Settings -&amp;gt; MCU Linker -&amp;gt; Managed linker script&lt;/P&gt;&lt;P&gt;and link your own linker file in &lt;EM&gt;Linker Script&lt;/EM&gt; text box&amp;nbsp;&lt;/P&gt;&lt;P&gt;(you can copy the default one and edit it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In code I used variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern unsigned long __application_size;&lt;/P&gt;&lt;P&gt;#define APPLICATION_SIZE (uint32_t) (&amp;amp;__application_size);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and function&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint32_t getApplication_size(void)&lt;BR /&gt;{&lt;BR /&gt;return APPLICATION_SIZE;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works for you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 14:47:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610793#M23843</guid>
      <dc:creator>walterbuttazzo</dc:creator>
      <dc:date>2017-03-24T14:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610794#M23844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Walter,&lt;/P&gt;&lt;P&gt;Your solution works just fine and is cleaner than mine. I wasn't thinking of modifying the linker, just using what was already provided.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 15:47:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610794#M23844</guid>
      <dc:creator>gregwilson-lind</dc:creator>
      <dc:date>2017-03-24T15:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610795#M23845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do not switch off managed linker scripts. Use the Frremarker linker script templates to add just the bits you want. That makes you changes future proof, and means you can move to other parts much more easily. See&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/389006"&gt;https://community.nxp.com/thread/389006&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:06:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610795#M23845</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2017-03-24T20:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610796#M23846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Con Verse,&lt;/P&gt;&lt;P&gt;I added:&lt;/P&gt;&lt;P&gt;    __application_size = SIZEOF(.text) + SIZEOF(.data);&lt;/P&gt;&lt;P&gt;into the section_tail.ldt script but the value that I get for the combined size of the .text &amp;amp; .data sections is not what is reported by the linker during the compile/link. Is there a better way/place to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 23:41:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610796#M23846</guid>
      <dc:creator>gregwilson-lind</dc:creator>
      <dc:date>2017-03-27T23:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the Code size in the program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610797#M23847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that is the correct place to place the addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, your application probably consists of more that just .text and .data.. Depending on your target and its memory configuration, there are other sections where code and data may be placed, such as .data_RAM2 etc.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2017 08:15:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-calculate-the-Code-size-in-the-program/m-p/610797#M23847</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2017-03-28T08:15:50Z</dc:date>
    </item>
  </channel>
</rss>

