<?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 sprintf works with LPC1343 but cause compile failure with LPC1345 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/sprintf-works-with-LPC1343-but-cause-compile-failure-with/m-p/525263#M7899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CC58 on Wed Jan 23 16:52:37 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Below sprintf works in LPCexpresso project for LPC1343, but gets below compile error in LPC1345 project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume it related to the differing libs each processor uses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(I'm using&amp;nbsp; LPCXpresso v4.2.0, but just tried v5.0.12 and it fails too)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a fix for this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf((char *)(test)," %d \r\n", len);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;compile error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Invoking: MCU Linker&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arm-none-eabi-gcc -nostdlib -L"C:\Users\cc\LPC_tempster1345\CMSISv2p10_LPC13Uxx\Debug" -L"C:\Users\cc\LPC_tempster1345\LPC13Uxx_DriverLib\Debug" -Xlinker -Map="ROM_USB_msc.map" -Xlinker --gc-sections -mcpu=cortex-m3 -mthumb -T "ROM_USB_msc_Debug.ld" -o"ROM_USB_msc.axf"&amp;nbsp; ./src/DiskImg.o ./src/cr_startup_lpc13u.o ./src/lpc13uxx_usbd_msc_mem.o ./src/main.o ./src/mem_lpc13uxx_usbdesc.o&amp;nbsp;&amp;nbsp; -lCMSISv2p10_LPC13Uxx -lLPC13Uxx_DriverLib&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(_deferredlazyseek.o): In function `__flsbuf':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_deferredlazyseek.c:(.text.(float, long, short, bool, float __restrict)+0x96): undefined reference to `__sys_istty'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(_writebuf.o): In function `_Cwritebuf':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_writebuf.c:(.text._Cwritebuf+0x18): undefined reference to `__sys_flen'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_writebuf.c:(.text._Cwritebuf+0x2e): undefined reference to `__sys_seek'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_writebuf.c:(.text._Cwritebuf+0x56): undefined reference to `__sys_write'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(alloc.o): In function `malloc':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text.malloc+0x78): undefined reference to `_sbrk'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text.malloc+0x9c): undefined reference to `_sbrk'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(alloc.o): In function `_Csys_alloc':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text._Csys_alloc+0xe): undefined reference to `__sys_write'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text._Csys_alloc+0x12): undefined reference to `__sys_appexit'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(fseek.o): In function `fseek':&lt;/SPAN&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: *** [ROM_USB_msc.axf] Error 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:54:29 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:54:29Z</dc:date>
    <item>
      <title>sprintf works with LPC1343 but cause compile failure with LPC1345</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/sprintf-works-with-LPC1343-but-cause-compile-failure-with/m-p/525263#M7899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CC58 on Wed Jan 23 16:52:37 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Below sprintf works in LPCexpresso project for LPC1343, but gets below compile error in LPC1345 project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume it related to the differing libs each processor uses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(I'm using&amp;nbsp; LPCXpresso v4.2.0, but just tried v5.0.12 and it fails too)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a fix for this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf((char *)(test)," %d \r\n", len);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;compile error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Invoking: MCU Linker&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arm-none-eabi-gcc -nostdlib -L"C:\Users\cc\LPC_tempster1345\CMSISv2p10_LPC13Uxx\Debug" -L"C:\Users\cc\LPC_tempster1345\LPC13Uxx_DriverLib\Debug" -Xlinker -Map="ROM_USB_msc.map" -Xlinker --gc-sections -mcpu=cortex-m3 -mthumb -T "ROM_USB_msc_Debug.ld" -o"ROM_USB_msc.axf"&amp;nbsp; ./src/DiskImg.o ./src/cr_startup_lpc13u.o ./src/lpc13uxx_usbd_msc_mem.o ./src/main.o ./src/mem_lpc13uxx_usbdesc.o&amp;nbsp;&amp;nbsp; -lCMSISv2p10_LPC13Uxx -lLPC13Uxx_DriverLib&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(_deferredlazyseek.o): In function `__flsbuf':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_deferredlazyseek.c:(.text.(float, long, short, bool, float __restrict)+0x96): undefined reference to `__sys_istty'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(_writebuf.o): In function `_Cwritebuf':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_writebuf.c:(.text._Cwritebuf+0x18): undefined reference to `__sys_flen'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_writebuf.c:(.text._Cwritebuf+0x2e): undefined reference to `__sys_seek'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_writebuf.c:(.text._Cwritebuf+0x56): undefined reference to `__sys_write'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(alloc.o): In function `malloc':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text.malloc+0x78): undefined reference to `_sbrk'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text.malloc+0x9c): undefined reference to `_sbrk'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(alloc.o): In function `_Csys_alloc':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text._Csys_alloc+0xe): undefined reference to `__sys_write'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alloc.c:(.text._Csys_alloc+0x12): undefined reference to `__sys_appexit'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;c:/nxp/lpcxpresso_4.2.0_264/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/lib/thumb2\libcr_c.a(fseek.o): In function `fseek':&lt;/SPAN&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: *** [ROM_USB_msc.axf] Error 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:54:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/sprintf-works-with-LPC1343-but-cause-compile-failure-with/m-p/525263#M7899</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf works with LPC1343 but cause compile failure with LPC1345</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/sprintf-works-with-LPC1343-but-cause-compile-failure-with/m-p/525264#M7900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Wouter on Thu Jan 24 04:22:49 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are not linking against the right C library. for sprintf you'll need atleast the nohost variant(and for semihosting the semihost variant). See:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fsupport.code-red-tech.com%2FCodeRedWiki%2FLibraryVariants" rel="nofollow" target="_blank"&gt;http://support.code-red-tech.com/CodeRedWiki/LibraryVariants&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fsupport.code-red-tech.com%2FCodeRedWiki%2FSwitchingCLibrary" rel="nofollow" target="_blank"&gt;http://support.code-red-tech.com/CodeRedWiki/SwitchingCLibrary&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wouter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:54:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/sprintf-works-with-LPC1343-but-cause-compile-failure-with/m-p/525264#M7900</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: sprintf works with LPC1343 but cause compile failure with LPC1345</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/sprintf-works-with-LPC1343-but-cause-compile-failure-with/m-p/525265#M7901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CC58 on Thu Jan 24 07:58:33 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for quick response and info I needed.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Change of MCU Linker from Redlib(none) to Redlib(semihost) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;allowed clean compile using sprintf.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:54:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/sprintf-works-with-LPC1343-but-cause-compile-failure-with/m-p/525265#M7901</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:54:30Z</dc:date>
    </item>
  </channel>
</rss>

