<?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>LPCXpresso IDE中的主题 Re: SPRINTF help??</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552992#M12544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by deBoogle on Wed Aug 22 06:48:01 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I didnt see the sticky thread, but i will go hunting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;much appreciate all your input guys.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;deBoogle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:12:39 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:12:39Z</dc:date>
    <item>
      <title>SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552984#M12536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by deBoogle on Mon Aug 20 13:06:19 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know there are a few threads on here regarding the sprintf function, but I'm not sure I am getting it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to convert an integer to a string and i seem to remember using sprintf or snprintf to do this so... I include stdio.h&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and then as a test:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;uint8_t i = 50;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;char buffer [20];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf(buffer, "%d", i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but i get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;make: *** [TEST1.axf] Error 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I now its probably a schoolboy error, but any help would be appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, at the moment I am trying to avoid using the printf to UART mod, for two reasons 1) simplifying porting to other devices and 2) i may eventually want to use floats and I read that may not be possible with the printf to uart mod.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;deBoogle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552984#M12536</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552985#M12537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Mon Aug 20 13:37:59 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;I want to convert an integer to a string...&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;So itoa :confused:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, did you read this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://support.code-red-tech.com/CodeRedWiki/redlib_itoa&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sample: &lt;/SPAN&gt;&lt;A href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://knowledgebase.nxp.com/showthread.php?t=3263&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW: Your problem is no the syntax :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although I prefer &lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
sprintf(&amp;amp;buffer[0], "%d", i);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;to show the pointer to the array &lt;SPAN class="lia-unicode-emoji" title=":winking_face:"&gt;&lt;LI-EMOJI id="lia_winking-face" title=":winking_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
sprintf(buffer, "%d", i);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;is working also &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552985#M12537</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552986#M12538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by deBoogle on Mon Aug 20 14:20:31 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I was always warned away from itoa due to it being non-standard C.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but thank you for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;deBoogle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552986#M12538</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552987#M12539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Mon Aug 20 14:47:01 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: deBoogle&lt;/STRONG&gt;&lt;BR /&gt;I was always warned away from itoa due to it being non-standard C.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OMG :eek:,&amp;nbsp; a non-standard C library function :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So sprintf is huge and itoa non standard; last option: write your own little integer to string function and add it to your standard library :rolleyes:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552987#M12539</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552988#M12540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by frame on Tue Aug 21 00:53:07 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;OMG :eek:,&amp;nbsp; a non-standard C library function :eek:&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If memory serves me well, itoa ist (most) often implemented as macro, so it's not even a function...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;So sprintf is huge and itoa non standard; last option: write your own&amp;nbsp; little integer to string function and add it to your standard library :rolleyes:&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is true, and should be quite simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But back to the start:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;make: *** [TEST1.axf] Error 1&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That can't be all of the error message. Was it an "undefined reference" ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552988#M12540</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552989#M12541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by deBoogle on Tue Aug 21 12:07:28 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Frame, Zero,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes indeed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fseek.c:(.text.fseek+0x1c): undefined reference to `__sys_istty'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fseek.c:(.text.fseek+0x3e): undefined reference to `__sys_flen'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;collect2: ld returned 1 exit status&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;make: *** [TEST1.axf] Error 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have no idea what this means.&amp;nbsp; I can only guess I am missing an include (although stdio and stdlib have been included).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552989#M12541</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552990#M12542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Tue Aug 21 12:35:20 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a semihosting problem :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bacbhcee.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552990#M12542</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552991#M12543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by whitecoe on Tue Aug 21 12:38:27 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you try doing a search using the &lt;/SPAN&gt;&lt;A href="http://http://knowledgebase.nxp.com/showthread.php?t=2182"&gt;sticky post at the top of the forum&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using this you'll see that Code Red have an FAQ on &lt;/SPAN&gt;&lt;A href="http://http://support.code-red-tech.com/CodeRedWiki/UndefinedReference"&gt;Undefined References&lt;/A&gt;&lt;SPAN&gt; that covers this specific error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTH!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552991#M12543</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: SPRINTF help??</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552992#M12544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by deBoogle on Wed Aug 22 06:48:01 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I didnt see the sticky thread, but i will go hunting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;much appreciate all your input guys.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;deBoogle&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:12:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPRINTF-help/m-p/552992#M12544</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:12:39Z</dc:date>
    </item>
  </channel>
</rss>

