<?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: How to use printf in NHS3100 project? in NFC</title>
    <link>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754455#M3353</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;It looks like you forgot to change the library setting. Under the LPCXpresso IDE, check:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Project &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Tool Settings &amp;gt; MCU Linker &amp;gt; Managed Linker script &amp;gt; Library&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should be set to &lt;EM&gt;Redlib (semihost)&lt;/EM&gt;. Take care to change it for the correct (and all) build configurations (listed on top).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also take into account that using semihost carries some disadvantages:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Firmware image size increases by ~10K&lt;/LI&gt;&lt;LI&gt;Using a printf statement is very slow: the ARM will halt, waiting for the&amp;nbsp;PC to read out the string output by printf. Only after that execution continues.&lt;/LI&gt;&lt;LI&gt;This also means that you must at all times have a physical connection. Without the SWD cable, the IC will halt and stay there perpetually&lt;/LI&gt;&lt;LI&gt;Plus, you can't use it in combination with the low power mode "Deep Power down", or go to Power-off.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We recommend using the &lt;EM&gt;uarttx&lt;/EM&gt; module to insert traces in a more unobtrusive way. That said, using semihosting still remains an easy way to try out the different functionalities the chip can offer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;BR /&gt;Dries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2018 10:54:58 GMT</pubDate>
    <dc:creator>driesmoors</dc:creator>
    <dc:date>2018-03-16T10:54:58Z</dc:date>
    <item>
      <title>How to use printf in NHS3100 project?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754454#M3352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Sir,&lt;/DIV&gt;&lt;DIV&gt;I read "LPCXpresso_IDE_User_Guide.pdf" which talks about printf as below:&lt;BR /&gt;---------------------------&lt;BR /&gt;Semihosting C Project&lt;BR /&gt;• Creates a simple “Hello World” project, with the main() routine containing a printf() call, which will cause the text to be displayed within the Console View of the LPCXpresso IDE. This is implemented using “semihosting” functionality. For more details, please see the FAQ at&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fusing-printf" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/using-printf&lt;/A&gt;&lt;BR /&gt;---------------------------&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But when I click the link above, the content is NOT available and it is linked to another web address "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm-based-processors-and-mcus%2Flpc-cortex-m-mcus%3ALPC-ARM-CORTEX-M-MCUS" rel="nofollow" target="_blank"&gt;https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus:LPC-ARM-CORTEX-M-MCUS&lt;/A&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Could you advice how I can access the link "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fusing-printf" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/using-printf&lt;/A&gt;&lt;SPAN&gt;" for the content?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;I want to use printf function to trace the routine but I met problem.&lt;BR /&gt;For example, I tried as below:&lt;BR /&gt;---&lt;BR /&gt;#include&amp;lt;stdio.h&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;// ...&lt;/DIV&gt;&lt;DIV&gt;printf("LED Toggle\r\n");&lt;BR /&gt;--------------&lt;/DIV&gt;&lt;DIV&gt;But the compiling errors happened:&lt;BR /&gt;*******&lt;BR /&gt;12:43:23 **** Incremental Build of configuration Debug for project app_demo_dp_blinky ****&lt;BR /&gt;make -r all &lt;BR /&gt;Building file: ../src/mainblinky.c&lt;BR /&gt;Invoking: MCU C Compiler&lt;BR /&gt;arm-none-eabi-gcc -std=c99 -DDEBUG -D__CODE_RED -DCORE_M0PLUS -D__REDLIB__ -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_chip_nss" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_board_dp" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\app_demo_dp_blinky\inc" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_board_dp\inc" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_chip_nss\inc" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\mods" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\app_demo_dp_blinky\mods" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_board_dp\mods" -I"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_chip_nss\mods" -include"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_chip_nss\mods\chip_sel.h" -include"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_board_dp\mods\board_sel.h" -include"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\app_demo_dp_blinky\mods\app_sel.h" -O0 -g3 -pedantic -Wall -Wextra -Wconversion -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0plus -mthumb -D__REDLIB__ -specs=redlib.specs -MMD -MP -MF"src/mainblinky.d" -MT"src/mainblinky.o" -MT"src/mainblinky.d" -o "src/mainblinky.o" "../src/mainblinky.c"&lt;BR /&gt;Finished building: ../src/mainblinky.c&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Building target: app_demo_dp_blinky.axf&lt;BR /&gt;Invoking: MCU Linker&lt;BR /&gt;arm-none-eabi-gcc -nostdlib -L"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_board_dp\Debug" -L"C:\Users\Bitse\Documents\LPCXpresso_8.1.4_606\workspace\lib_chip_nss\Debug" -Xlinker -Map="app_demo_dp_blinky.map" -Xlinker --gc-sections -mcpu=cortex-m0plus -mthumb -T "app_demo_dp_blinky_Debug.ld" -o "app_demo_dp_blinky.axf"&amp;nbsp; ./src/crp.o ./src/mainblinky.o&amp;nbsp;&amp;nbsp; -llib_board_dp -llib_chip_nss&lt;BR /&gt;c:/nxp/lpcxpresso_8.1.4_606/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(fpprintf.o): In function `printf':&lt;BR /&gt;fpprintf.c:(.text.printf+0x38): undefined reference to `__sys_write'&lt;BR /&gt;c:/nxp/lpcxpresso_8.1.4_606/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(_deferredlazyseek.o): In function `__flsbuf':&lt;BR /&gt;_deferredlazyseek.c:(.text.__flsbuf+0x88): undefined reference to `__sys_istty'&lt;BR /&gt;c:/nxp/lpcxpresso_8.1.4_606/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(_writebuf.o): In function `_Cwritebuf':&lt;BR /&gt;_writebuf.c:(.text._Cwritebuf+0x16): undefined reference to `__sys_flen'&lt;BR /&gt;_writebuf.c:(.text._Cwritebuf+0x26): undefined reference to `__sys_seek'&lt;BR /&gt;_writebuf.c:(.text._Cwritebuf+0x3c): undefined reference to `__sys_write'&lt;BR /&gt;c:/nxp/lpcxpresso_8.1.4_606/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(alloc.o): In function `_Csys_alloc':&lt;BR /&gt;alloc.c:(.text._Csys_alloc+0xe): undefined reference to `__sys_write'&lt;BR /&gt;alloc.c:(.text._Csys_alloc+0x12): undefined reference to `__sys_appexit'&lt;BR /&gt;c:/nxp/lpcxpresso_8.1.4_606/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv6-m\libcr_c.a(fseek.o): In function `fseek':&lt;BR /&gt;fseek.c:(.text.fseek+0x18): undefined reference to `__sys_istty'&lt;BR /&gt;fseek.c:(.text.fseek+0x3c): undefined reference to `__sys_flen'&lt;BR /&gt;collect2.exe: error: ld returned 1 exit status&lt;BR /&gt;make: *** [app_demo_dp_blinky.axf] Error 1&lt;BR /&gt;12:43:24 Build Finished (took 856ms)&lt;BR /&gt;***************&lt;/DIV&gt;&lt;DIV&gt;Sorry I am a new comer for NXP NHS3100 and LPCXpresso development.&lt;BR /&gt;Look forward to your guide.&lt;BR /&gt;Many thanks,&lt;BR /&gt;Arna&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 04:56:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754454#M3352</guid>
      <dc:creator>aresmarser</dc:creator>
      <dc:date>2018-03-14T04:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use printf in NHS3100 project?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754455#M3353</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;It looks like you forgot to change the library setting. Under the LPCXpresso IDE, check:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Project &amp;gt; Properties &amp;gt; C/C++ Build &amp;gt; Settings &amp;gt; Tool Settings &amp;gt; MCU Linker &amp;gt; Managed Linker script &amp;gt; Library&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should be set to &lt;EM&gt;Redlib (semihost)&lt;/EM&gt;. Take care to change it for the correct (and all) build configurations (listed on top).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also take into account that using semihost carries some disadvantages:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Firmware image size increases by ~10K&lt;/LI&gt;&lt;LI&gt;Using a printf statement is very slow: the ARM will halt, waiting for the&amp;nbsp;PC to read out the string output by printf. Only after that execution continues.&lt;/LI&gt;&lt;LI&gt;This also means that you must at all times have a physical connection. Without the SWD cable, the IC will halt and stay there perpetually&lt;/LI&gt;&lt;LI&gt;Plus, you can't use it in combination with the low power mode "Deep Power down", or go to Power-off.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We recommend using the &lt;EM&gt;uarttx&lt;/EM&gt; module to insert traces in a more unobtrusive way. That said, using semihosting still remains an easy way to try out the different functionalities the chip can offer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;BR /&gt;Dries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 10:54:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754455#M3353</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2018-03-16T10:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use printf in NHS3100 project?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754456#M3354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Dries&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for the answer.&lt;/P&gt;&lt;P&gt;I can now use printf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, as you suggestion, "&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;We recommend using the &lt;/SPAN&gt;&lt;EM style="background-color: transparent; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #51626f; font-family: &amp;amp;quot; helvetica neue&amp;amp;quot;,helvetica,arial,&amp;amp;quot;lucida grande&amp;amp;quot;,sans-serif; font-size: 15px; font-style: italic; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none #51626f;"&gt;uarttx&lt;/EM&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #51626f; font-family: 'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; module to insert traces in a more unobtrusive way&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;Could you advice some document or guide to how to add trace log in my project?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Arna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 03:59:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754456#M3354</guid>
      <dc:creator>aresmarser</dc:creator>
      <dc:date>2018-03-19T03:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use printf in NHS3100 project?</title>
      <link>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754457#M3355</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;Have a look at the doxygen generated documentation about this: &lt;EM&gt;docs/FirmwareDevelopmentDocumentation/index.html&lt;/EM&gt;, then from the left pane &lt;EM&gt;Modules &amp;gt; Modules &lt;/EM&gt;(weird, I know)&lt;EM&gt; &amp;gt;&amp;nbsp;uarttx: Uart Tx-only module&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Dries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 08:39:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/How-to-use-printf-in-NHS3100-project/m-p/754457#M3355</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2018-03-22T08:39:00Z</dc:date>
    </item>
  </channel>
</rss>

