<?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>MCUXpresso IDE中的主题 Re: Newlib heap and stack usage monitoring?</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983987#M4993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;The problem is that FreeRTOS heap &amp;amp; stack view is also disabled when using heap 3 (newlib malloc/free) so there is no way to monitor heap usage!&lt;/STRONG&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/101957i44993B3AFD907827/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;FreeRTOS TAD at least displays a message that tells why the view is disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see a point in disabling the standard Heap monitoring with freeRTOS. &lt;STRONG&gt;FreeRTOS memory management does not affect the way newlib allocates memory&lt;/STRONG&gt; so even if I use HEAP4 with FreeRTOS newlib is still using standard malloc/free. With monitoring disabled I can't see how much heap newlib and my C++ code is using. I know I can easily override new/delete in cr_cpp_config.cpp but that does not affect newlib or third party libraries written in C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to enable standard heap monitoring when FreeRTOS is used?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jan 2020 14:07:16 GMT</pubDate>
    <dc:creator>keijolänsikunna</dc:creator>
    <dc:date>2020-01-09T14:07:16Z</dc:date>
    <item>
      <title>Newlib heap and stack usage monitoring?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983985#M4991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I create a C++ project and do a simple dynamic allocation I can see the heap usage changing. If I do the same in a project with FreeRTOS the view gives me nothing. &lt;STRONG&gt;I did my tests in the main() before FreeRTOS scheduler was started. So FreeRTOS was not doing anything with stack or heap.&lt;/STRONG&gt; The project is is set up to use MCUXpresso style stack and heap placement and I have checked that that the required symbols are present (_pvHeapStart, _pvHeapLimit, __end_of_heap).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can't monitor stack usage through the standard MCUXpresso heap and stack monitoring with FreeRTOS.&lt;/P&gt;&lt;P&gt;But why doesn't heap monitoring work? I would like to configure freertos to use heap3.&amp;nbsp; Then freertos uses newlib malloc/free for allocation and FreeRTOS plugin can't show me heap usage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I set breakpoints before and after allocation I can see __end_of_heap changing in the global variable view so things get updated but there is no easy way to monitor heap usage.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2020 09:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983985#M4991</guid>
      <dc:creator>keijolänsikunna</dc:creator>
      <dc:date>2020-01-08T09:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Newlib heap and stack usage monitoring?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983986#M4992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, I confirm that the Heap and Stack Usage view is disabled during RTOS debugging session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, there's a dedicated Heap Usage (FreeRTOS) view that does exactly what you ask. Simply open the view by going to FreeRTOS =&amp;gt; Heap Usage. Please note that you'll have to instruct the view with regards to the type of heap you use inside the app. I suggest you open Help =&amp;gt; MCUXpresso IDE User Guide and then browse to Heap Usage View under the FreeRTOS debug guide for more details.&amp;nbsp;&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/101953i3B1728278A0086D8/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;Greetings,&lt;BR /&gt;MCUXpresso IDE Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2020 13:15:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983986#M4992</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2020-01-09T13:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Newlib heap and stack usage monitoring?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983987#M4993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;The problem is that FreeRTOS heap &amp;amp; stack view is also disabled when using heap 3 (newlib malloc/free) so there is no way to monitor heap usage!&lt;/STRONG&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/101957i44993B3AFD907827/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;FreeRTOS TAD at least displays a message that tells why the view is disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see a point in disabling the standard Heap monitoring with freeRTOS. &lt;STRONG&gt;FreeRTOS memory management does not affect the way newlib allocates memory&lt;/STRONG&gt; so even if I use HEAP4 with FreeRTOS newlib is still using standard malloc/free. With monitoring disabled I can't see how much heap newlib and my C++ code is using. I know I can easily override new/delete in cr_cpp_config.cpp but that does not affect newlib or third party libraries written in C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to enable standard heap monitoring when FreeRTOS is used?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2020 14:07:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983987#M4993</guid>
      <dc:creator>keijolänsikunna</dc:creator>
      <dc:date>2020-01-09T14:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Newlib heap and stack usage monitoring?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983988#M4994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keijo,&lt;/P&gt;&lt;P&gt;I faced the same thing. My solution is to monitor the heap is using the expressions view, with following expressions:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Used:&lt;BR /&gt;((unsigned int)__end_of_heap)-((unsigned int)&amp;amp;_pvHeapStart)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Free:&lt;BR /&gt;((unsigned int)&amp;amp;_pvHeapLimit)-((unsigned int)__end_of_heap)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Heap size:&lt;BR /&gt;(unsigned int)&amp;amp;_pvHeapLimit-(unsigned int)&amp;amp;_pvHeapStart&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/104655iDED343A21584A883/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;I agree that the view should be able to handle FreeRTOS case, but until then the above way works for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2020 16:46:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Newlib-heap-and-stack-usage-monitoring/m-p/983988#M4994</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2020-01-09T16:46:49Z</dc:date>
    </item>
  </channel>
</rss>

