<?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: KW41Z printf on startup file resets program in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291051#M60832</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/117331"&gt;@satsok_n&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;it really depends what you are using for the printf: UART? semihosting?&lt;/P&gt;&lt;P&gt;In both cases you will need to have the drivers behind it intialized and working. For example&amp;nbsp; you cannot access/use the UART if the peripheral is not clocked and pins are not muxed (done in main, not in the startup code).&lt;/P&gt;&lt;P&gt;If using semihosting you need to initialize the standard library (done at the end of the startup code).&lt;/P&gt;&lt;P&gt;So while you could use printf, it is really not good to use it, see &lt;A href="https://mcuoneclipse.com/2013/04/19/why-i-dont-like-printf/" target="_blank"&gt;https://mcuoneclipse.com/2013/04/19/why-i-dont-like-printf/&lt;/A&gt; because it uses lots of stack space and memory.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jun 2021 03:33:56 GMT</pubDate>
    <dc:creator>ErichStyger</dc:creator>
    <dc:date>2021-06-11T03:33:56Z</dc:date>
    <item>
      <title>KW41Z printf on startup file resets program</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1290913#M60829</link>
      <description>&lt;P&gt;I am trying to run some code in file&amp;nbsp;&lt;EM&gt;startup_mkw41z4.c &lt;/EM&gt;following this post&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2019/02/17/debugging-the-startup-code-with-eclipse-and-gdb/" target="_self"&gt;https://mcuoneclipse.com/2019/02/17/debugging-the-startup-code-with-eclipse-and-gdb/&lt;/A&gt;&lt;EM&gt;.&lt;/EM&gt;When I try to run some code in this file I manage to run first part and when I use printf it resets the program. If I remove printf the code runs normaly. Any suggestions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 20:50:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1290913#M60829</guid>
      <dc:creator>satsok_n</dc:creator>
      <dc:date>2021-06-10T20:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: KW41Z printf on startup file resets program</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1290978#M60831</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Before you use printf function, you should make sure you have initialized the uart.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 days after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 01:01:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1290978#M60831</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2021-06-11T01:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: KW41Z printf on startup file resets program</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291051#M60832</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/117331"&gt;@satsok_n&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;it really depends what you are using for the printf: UART? semihosting?&lt;/P&gt;&lt;P&gt;In both cases you will need to have the drivers behind it intialized and working. For example&amp;nbsp; you cannot access/use the UART if the peripheral is not clocked and pins are not muxed (done in main, not in the startup code).&lt;/P&gt;&lt;P&gt;If using semihosting you need to initialize the standard library (done at the end of the startup code).&lt;/P&gt;&lt;P&gt;So while you could use printf, it is really not good to use it, see &lt;A href="https://mcuoneclipse.com/2013/04/19/why-i-dont-like-printf/" target="_blank"&gt;https://mcuoneclipse.com/2013/04/19/why-i-dont-like-printf/&lt;/A&gt; because it uses lots of stack space and memory.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 03:33:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291051#M60832</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-06-11T03:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: KW41Z printf on startup file resets program</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291061#M60833</link>
      <description>&lt;P&gt;I used printf in order to export some variables to console and copy paste them in a text file. Can you suggest any other way to export data?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 04:03:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291061#M60833</guid>
      <dc:creator>satsok_n</dc:creator>
      <dc:date>2021-06-11T04:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: KW41Z printf on startup file resets program</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291068#M60834</link>
      <description>&lt;P&gt;a good way is to use SEGGER RTT (see &lt;A href="https://mcuoneclipse.com/2015/07/07/using-segger-real-time-terminal-rtt-with-eclipse/" target="_blank"&gt;https://mcuoneclipse.com/2015/07/07/using-segger-real-time-terminal-rtt-with-eclipse/&lt;/A&gt;) which is fast and you can easily export lots of data.&lt;/P&gt;&lt;P&gt;Another way is to export memory directly, see &lt;A href="https://mcuoneclipse.com/2012/05/04/dump-my-device-memory/" target="_blank"&gt;https://mcuoneclipse.com/2012/05/04/dump-my-device-memory/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Or if you want to do this for individual variables, you easily can do this with gdb and you can script it, see &lt;A href="https://mcuoneclipse.com/2020/04/13/dumping-variables-and-arrays-with-gdb-in-eclipse/" target="_blank"&gt;https://mcuoneclipse.com/2020/04/13/dumping-variables-and-arrays-with-gdb-in-eclipse/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 04:28:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291068#M60834</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-06-11T04:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: KW41Z printf on startup file resets program</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291385#M60837</link>
      <description>&lt;P&gt;Thanks a lot. This has been very helpful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 12:22:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KW41Z-printf-on-startup-file-resets-program/m-p/1291385#M60837</guid>
      <dc:creator>satsok_n</dc:creator>
      <dc:date>2021-06-11T12:22:41Z</dc:date>
    </item>
  </channel>
</rss>

