<?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>Kinetis Software Development KitのトピックFreeRTOS stack size and printing</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-stack-size-and-printing/m-p/649808#M7010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a motor control project using freertos to do some debug printing. I would print some float variables in a debug task. I created a new project with the same code just in a different location for the same board and my printf in my freertos debug task would print a few characters then stop. I have looked over both project compile and linker settings and they are the same. After some debugging I found that increasing the stack size of my debug task from 100 to 200 fixed the print issue.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure why the original project with a 100 stack size prints fine but the new one which in theory is exactly the same requires 200. I have float printing enabled. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jan 2017 01:40:33 GMT</pubDate>
    <dc:creator>rudasi</dc:creator>
    <dc:date>2017-01-28T01:40:33Z</dc:date>
    <item>
      <title>FreeRTOS stack size and printing</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-stack-size-and-printing/m-p/649808#M7010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a motor control project using freertos to do some debug printing. I would print some float variables in a debug task. I created a new project with the same code just in a different location for the same board and my printf in my freertos debug task would print a few characters then stop. I have looked over both project compile and linker settings and they are the same. After some debugging I found that increasing the stack size of my debug task from 100 to 200 fixed the print issue.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure why the original project with a 100 stack size prints fine but the new one which in theory is exactly the same requires 200. I have float printing enabled. Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2017 01:40:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-stack-size-and-printing/m-p/649808#M7010</guid>
      <dc:creator>rudasi</dc:creator>
      <dc:date>2017-01-28T01:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS stack size and printing</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-stack-size-and-printing/m-p/649809#M7011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on how the memory is being allocated, or the order in which the allocations are done, there is a chance you just got lucky and the issue existed in both cases, but only caused a problem in one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have &lt;A href="http://www.freertos.org/Stacks-and-stack-overflow-checking.html"&gt;stack overflow checking&lt;/A&gt; turned on?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2017 04:42:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-stack-size-and-printing/m-p/649809#M7011</guid>
      <dc:creator>FreeRTOS_org</dc:creator>
      <dc:date>2017-01-28T04:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS stack size and printing</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-stack-size-and-printing/m-p/649810#M7012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would have a look how much stack you have allocated, e.g. with the Eclipse FreeRTOS plugin (see &lt;A class="link-titled" href="https://mcuoneclipse.com/2016/07/06/freertos-kernel-awareness-for-eclipse-from-nxp/" title="https://mcuoneclipse.com/2016/07/06/freertos-kernel-awareness-for-eclipse-from-nxp/"&gt;FreeRTOS Kernel Awareness for Eclipse from NXP | MCU on Eclipse&lt;/A&gt;&amp;nbsp;). Depending on which library (newlib? newlib-nano?) the standard library and printf() requires dynamic memory in the non-FreeRTOS heap, and depending on the order of tasks and printf() usage the stack needed might be different. Additionally, depending on what you are using with printf(), it might not end up in a printf() call, see &lt;A class="link-titled" href="https://mcuoneclipse.com/2015/11/21/gnu-gcc-printf-and-builtin-optimizations/" title="https://mcuoneclipse.com/2015/11/21/gnu-gcc-printf-and-builtin-optimizations/"&gt;GNU gcc printf() and BuiltIn Optimizations | MCU on Eclipse&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Last but not least: using printf() usually is not a good idea anyway, see &lt;A class="link-titled" href="https://mcuoneclipse.com/2013/04/19/why-i-dont-like-printf/" title="https://mcuoneclipse.com/2013/04/19/why-i-dont-like-printf/"&gt;Why I don’t like printf() | MCU on Eclipse&lt;/A&gt; .&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>Sat, 28 Jan 2017 14:31:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-stack-size-and-printing/m-p/649810#M7012</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2017-01-28T14:31:25Z</dc:date>
    </item>
  </channel>
</rss>

