<?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: Determining Free RAM on K60 programmatically in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Determining-Free-RAM-on-K60-programmatically/m-p/281010#M10358</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scot,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add those label to a Kinetis linker file (.ld).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the linker file you will see the RAM memory segments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (rwx) : ORIGIN = 0x1FFF0000, LENGTH = 64K&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Lower SRAM */&lt;/P&gt;&lt;P&gt;m_data2&amp;nbsp;&amp;nbsp;&amp;nbsp; (rwx) : ORIGIN = 0x20000000, LENGTH = 64K&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Upper SRAM */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can declare the labels:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_LOWER_RAMBAR = 0x1FFF0000;&lt;/P&gt;&lt;P&gt;_UPPER_RAMBAR = 0x20000000;&lt;/P&gt;&lt;P&gt;_LOWER_RAMSIZE = 64K;&lt;/P&gt;&lt;P&gt;_UPPER_RAMSIZE = 64K;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this you can substract the size of the RAM from the size to get the amount of free RAM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_FREE_LOWER_RAM_SIZE = _LOWER_RAMSIZE - SIZEOF(.data)&lt;/P&gt;&lt;P&gt;_FREE_UPPER_RAM_SIZE = _UPPER_RAMSIZE - SIZEOF(.user_data2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally to get the address where the free RAM starts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_LOWER_FREE_RAM_START = _LOWER_RAMBAR + _FREE_LOWER_RAM_SIZE;&lt;/P&gt;&lt;P&gt;_UPPER_FREE_RAM_START = _UPPER_RAMBAR + _FREE_UPPER_RAM_SIZE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Hope this helps!&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Mar 2014 14:20:13 GMT</pubDate>
    <dc:creator>Carlos_Musich</dc:creator>
    <dc:date>2014-03-10T14:20:13Z</dc:date>
    <item>
      <title>Determining Free RAM on K60 programmatically</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Determining-Free-RAM-on-K60-programmatically/m-p/281009#M10357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the K60. How to I programmatically determine the amount of free ram? (on ColdFire processors I used __RAM_BARSIZE, __RAMBAR)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2014 21:50:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Determining-Free-RAM-on-K60-programmatically/m-p/281009#M10357</guid>
      <dc:creator>mon3al</dc:creator>
      <dc:date>2014-03-06T21:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Determining Free RAM on K60 programmatically</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Determining-Free-RAM-on-K60-programmatically/m-p/281010#M10358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scot,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add those label to a Kinetis linker file (.ld).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the linker file you will see the RAM memory segments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (rwx) : ORIGIN = 0x1FFF0000, LENGTH = 64K&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Lower SRAM */&lt;/P&gt;&lt;P&gt;m_data2&amp;nbsp;&amp;nbsp;&amp;nbsp; (rwx) : ORIGIN = 0x20000000, LENGTH = 64K&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Upper SRAM */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can declare the labels:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_LOWER_RAMBAR = 0x1FFF0000;&lt;/P&gt;&lt;P&gt;_UPPER_RAMBAR = 0x20000000;&lt;/P&gt;&lt;P&gt;_LOWER_RAMSIZE = 64K;&lt;/P&gt;&lt;P&gt;_UPPER_RAMSIZE = 64K;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this you can substract the size of the RAM from the size to get the amount of free RAM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_FREE_LOWER_RAM_SIZE = _LOWER_RAMSIZE - SIZEOF(.data)&lt;/P&gt;&lt;P&gt;_FREE_UPPER_RAM_SIZE = _UPPER_RAMSIZE - SIZEOF(.user_data2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally to get the address where the free RAM starts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_LOWER_FREE_RAM_START = _LOWER_RAMBAR + _FREE_LOWER_RAM_SIZE;&lt;/P&gt;&lt;P&gt;_UPPER_FREE_RAM_START = _UPPER_RAMBAR + _FREE_UPPER_RAM_SIZE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Hope this helps!&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 14:20:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Determining-Free-RAM-on-K60-programmatically/m-p/281010#M10358</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2014-03-10T14:20:13Z</dc:date>
    </item>
  </channel>
</rss>

