<?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: sprintf on KDS3.2.0 in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766037#M9692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;got it, will look into it over the next day and report back my findings.&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Nov 2017 06:50:18 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2017-11-10T06:50:18Z</dc:date>
    <item>
      <title>sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766034#M9689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using KDS3.2.0 and KSDK 2.0 for K66F development.&lt;/P&gt;&lt;P&gt;I can use PRINTF to output debug message..&lt;/P&gt;&lt;P&gt;When I use sprintf and have the following problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sprintf(&amp;amp;LCD_character[d_position], "DDD"); ---Works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; sprintf(&amp;amp;LCD_character[d_position], &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff; font-size: small;"&gt;"%s_"&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;, temp_char); ---Not working, get the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;`_sbrk' referenced in section `.text._sbrk_r' of c:/fsl32/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv7e-m/fpu\libg_s.a(lib_a-sbrkr.o): defined in discarded section `.text' of ./utilities/fsl_sbrk.o (symbol from plugin)&lt;/P&gt;&lt;P&gt;`errno' referenced in section `.text._sbrk_r' of c:/fsl32/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv7e-m/fpu\libg_s.a(lib_a-sbrkr.o): defined in discarded section `.text' of ./middleware/lwip_2.0.0/port/sys_arch.o (symbol from plugin)&lt;/P&gt;&lt;P&gt;collect2.exe: error: ld returned 1 exit status&lt;/P&gt;&lt;P&gt;makefile:103: recipe for target 'iNetVu7710_V50_FW.elf' failed&lt;/P&gt;&lt;P&gt;make: *** [iNetVu7710_V50_FW.elf] Error 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the way that Erich provided to change "caddr_t _sbrk(&lt;SPAN style="text-decoration: underline;"&gt;int&lt;/SPAN&gt; &lt;SPAN style="text-decoration: underline;"&gt;incr&lt;/SPAN&gt;)" in fsl_sbrk.c to&lt;/P&gt;&lt;P&gt;void _sbrk(void){}&lt;/P&gt;&lt;P&gt;It didn't fix the problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody to help me to fix this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 16:29:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766034#M9689</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2017-11-09T16:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766035#M9690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;could you provide an example with all the necessary types/variables?&lt;/P&gt;&lt;P&gt;I have tried the following&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; LCD_character&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;32&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; d_position &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;temp_char&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;test&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="token function"&gt;sprintf&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;LCD_character&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;d_position&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DDD"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="token function"&gt;sprintf&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;LCD_character&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;d_position&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"%s_"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; temp_char&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and it worked on my end without issues?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 19:44:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766035#M9690</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2017-11-09T19:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766036#M9691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the attached project...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Christie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 20:44:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766036#M9691</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2017-11-09T20:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766037#M9692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;got it, will look into it over the next day and report back my findings.&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Nov 2017 06:50:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766037#M9692</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2017-11-10T06:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766038#M9693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christie,&lt;/P&gt;&lt;P&gt;I have identified the problem: it is related to -flto linker optimization. See &lt;A class="" href="https://mcuoneclipse.com/2017/11/12/solving-problem-with-gnu-linker-and-referenced-in-section-defined-in-discarded-section-error-message/" title="https://mcuoneclipse.com/2017/11/12/solving-problem-with-gnu-linker-and-referenced-in-section-defined-in-discarded-section-error-message/"&gt;Solving Problem with GNU Linker and “referenced in section, defined in discarded section ” Error Message | MCU on Eclips…&lt;/A&gt;&amp;nbsp; for a description and the solution to work around this.&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>Sun, 12 Nov 2017 19:36:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766038#M9693</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2017-11-12T19:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766039#M9694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works. Thank you for your help...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is "-flto" optimization doing?&amp;nbsp;Can I just turn off this because I tried it works fine without "-flto" ON?&lt;/P&gt;&lt;P&gt;If I check "use float with nano printf", it works as well...&lt;/P&gt;&lt;P&gt;Could you tell me if there is any relationship? Which way should I use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 18:41:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766039#M9694</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2017-11-13T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766040#M9695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christie,&lt;/P&gt;&lt;P&gt;-flto does optmizations across compilation units (modules), something the compiler is not able to do. Basically it tries to remove/inline things as much as possible from a 'global' application point of view. It is known (at least to me) that sometimes it is too agressive like in this case. It is not related to the printf option, but of course if you use different libraries, it has an other angle of optimizations.&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>Mon, 13 Nov 2017 19:01:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766040#M9695</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2017-11-13T19:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf on KDS3.2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766041#M9696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Erich.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 19:22:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/sprintf-on-KDS3-2-0/m-p/766041#M9696</guid>
      <dc:creator>a8Chcx</dc:creator>
      <dc:date>2017-11-13T19:22:06Z</dc:date>
    </item>
  </channel>
</rss>

