<?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 find Free RAM in MQX 3.8? in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162938#M1374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;_mem_get_free&lt;/P&gt;&lt;P&gt;_mem_get_free_from&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you get an error add these files to the lwmem section of the PSP project&lt;/P&gt;&lt;P&gt;(Use this recommendation at your own risk since I don't know why Freescale hasn't included these in the PSP projects. I have not see any adverse affects myself.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwm_gfre.c&lt;/P&gt;&lt;P&gt;lwm_gfri.c&lt;/P&gt;&lt;P&gt;lwm_gfrf.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These files are located in the \mqx\source\lwmem folder. For example the default install on my machine is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Program Files\Freescale\Freescale MQX 3.8\mqx\source\lwmem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my application I have a shell command that dumps a bunch of system information. In it I've used the functions like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1352135275270310" jivemacro_uid="_1352135275270310"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Static RAM Usage:&amp;nbsp;&amp;nbsp; %d Bytes\r\n", (uint32_t)_mqx_get_initialization()-&amp;gt;START_OF_KERNEL_MEMORY - 0x1FFF0000);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("&amp;nbsp; Peak RAM Usage:&amp;nbsp;&amp;nbsp; %d Bytes(%d%%)\r\n", (uint32_t)_mem_get_highwater() - 0x1FFF0000, ((uint32_t)_mem_get_highwater() - 0x1FFF0000)/0x51E);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Current RAM Free:&amp;nbsp;&amp;nbsp; %d Bytes(%d%%)\r\n", _mem_get_free(), _mem_get_free()/0x51E);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The magic numbers used above (0x1FFF0000 and 0x51E) are the base memory address (0x1FFF0000) and ram size (0x51E) for the Kinetis K20/K60 chips. Change them to match your system. Mine looks like this when running:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static RAM Usage:&amp;nbsp;&amp;nbsp; 23712 Bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp; Peak RAM Usage:&amp;nbsp;&amp;nbsp; 98500 Bytes(75%)&lt;/P&gt;&lt;P&gt;Current RAM Free:&amp;nbsp;&amp;nbsp; 35468 Bytes(27%)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:09:05 GMT</pubDate>
    <dc:creator>BryGuyH</dc:creator>
    <dc:date>2020-10-29T09:09:05Z</dc:date>
    <item>
      <title>How to find Free RAM in MQX 3.8?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162936#M1372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to MQX RTOS infact RTOS itself.&lt;/P&gt;&lt;P&gt;Can anyone please tell me if there is any way to find free RAM space in MQX?&lt;/P&gt;&lt;P&gt;Something similar to "free" in linux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Nov 2012 07:34:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162936#M1372</guid>
      <dc:creator>mariappanramasa</dc:creator>
      <dc:date>2012-11-04T07:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to find Free RAM in MQX 3.8?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162937#M1373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello mariappanramasamy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's _tad_stack_usage() function in tad file which you can find in MQX/source/tad. Or another option is TAD (Task Aware Debugging) which shows stack usage in IDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information about TAD (5th chapter) : &lt;A href="http://cache.freescale.com/files/32bit/doc/app_note/AN3905.pdf" title="http://cache.freescale.com/files/32bit/doc/app_note/AN3905.pdf"&gt;http://cache.freescale.com/files/32bit/doc/app_note/AN3905.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There are more documents where TAD is described for different IDE's. These are located in MQX/doc folder. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 06:53:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162937#M1373</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-11-05T06:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find Free RAM in MQX 3.8?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162938#M1374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;_mem_get_free&lt;/P&gt;&lt;P&gt;_mem_get_free_from&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you get an error add these files to the lwmem section of the PSP project&lt;/P&gt;&lt;P&gt;(Use this recommendation at your own risk since I don't know why Freescale hasn't included these in the PSP projects. I have not see any adverse affects myself.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lwm_gfre.c&lt;/P&gt;&lt;P&gt;lwm_gfri.c&lt;/P&gt;&lt;P&gt;lwm_gfrf.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These files are located in the \mqx\source\lwmem folder. For example the default install on my machine is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Program Files\Freescale\Freescale MQX 3.8\mqx\source\lwmem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my application I have a shell command that dumps a bunch of system information. In it I've used the functions like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1352135275270310" jivemacro_uid="_1352135275270310"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Static RAM Usage:&amp;nbsp;&amp;nbsp; %d Bytes\r\n", (uint32_t)_mqx_get_initialization()-&amp;gt;START_OF_KERNEL_MEMORY - 0x1FFF0000);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("&amp;nbsp; Peak RAM Usage:&amp;nbsp;&amp;nbsp; %d Bytes(%d%%)\r\n", (uint32_t)_mem_get_highwater() - 0x1FFF0000, ((uint32_t)_mem_get_highwater() - 0x1FFF0000)/0x51E);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Current RAM Free:&amp;nbsp;&amp;nbsp; %d Bytes(%d%%)\r\n", _mem_get_free(), _mem_get_free()/0x51E);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The magic numbers used above (0x1FFF0000 and 0x51E) are the base memory address (0x1FFF0000) and ram size (0x51E) for the Kinetis K20/K60 chips. Change them to match your system. Mine looks like this when running:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static RAM Usage:&amp;nbsp;&amp;nbsp; 23712 Bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp; Peak RAM Usage:&amp;nbsp;&amp;nbsp; 98500 Bytes(75%)&lt;/P&gt;&lt;P&gt;Current RAM Free:&amp;nbsp;&amp;nbsp; 35468 Bytes(27%)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:09:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162938#M1374</guid>
      <dc:creator>BryGuyH</dc:creator>
      <dc:date>2020-10-29T09:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to find Free RAM in MQX 3.8?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162939#M1375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks bryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I totally missed _mem_get_free functions.:smileysilly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2012 08:39:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-to-find-Free-RAM-in-MQX-3-8/m-p/162939#M1375</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-11-06T08:39:48Z</dc:date>
    </item>
  </channel>
</rss>

