<?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中的主题 printf() using ITM</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/printf-using-ITM/m-p/602598#M32235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to make use of printf() statements for debugging. Since the code involves multiple interrupts, I want to use retargetting to UART instead of using semihosting (as recommended at &lt;A href="https://community.nxp.com/thread/389156"&gt;What is Semihosting?&lt;/A&gt;). I am using Redlib nohost library. I am using the &lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;LPCOpen Chip library only and not the board library.&amp;nbsp;I have added the&amp;nbsp;&lt;SPAN&gt;retarget_itm.c file available at-&amp;nbsp;&lt;A href="https://community.nxp.com/thread/389028"&gt;How to use ITM Printf&lt;/A&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some queries regarding the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Can ITM be used both with and without semihosting? If yes, then how does it happen? (since it requires that the&amp;nbsp;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;redlib semihost or redlib or newlib nohost library be used.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;2. &lt;SPAN&gt;How is printf() mapped to the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;__sys_write() function defined in the retarget_itm.c?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;3.&amp;nbsp;T&lt;SPAN&gt;he&amp;nbsp;__sys_write() function in retarget_itm.c is not being called when I use printf statements. However, the program gets compiled. Please let me know what might be the issue.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Prachi&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2017 07:09:03 GMT</pubDate>
    <dc:creator>prachipanse</dc:creator>
    <dc:date>2017-02-27T07:09:03Z</dc:date>
    <item>
      <title>printf() using ITM</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/printf-using-ITM/m-p/602598#M32235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to make use of printf() statements for debugging. Since the code involves multiple interrupts, I want to use retargetting to UART instead of using semihosting (as recommended at &lt;A href="https://community.nxp.com/thread/389156"&gt;What is Semihosting?&lt;/A&gt;). I am using Redlib nohost library. I am using the &lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;LPCOpen Chip library only and not the board library.&amp;nbsp;I have added the&amp;nbsp;&lt;SPAN&gt;retarget_itm.c file available at-&amp;nbsp;&lt;A href="https://community.nxp.com/thread/389028"&gt;How to use ITM Printf&lt;/A&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some queries regarding the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Can ITM be used both with and without semihosting? If yes, then how does it happen? (since it requires that the&amp;nbsp;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;redlib semihost or redlib or newlib nohost library be used.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;2. &lt;SPAN&gt;How is printf() mapped to the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;__sys_write() function defined in the retarget_itm.c?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;3.&amp;nbsp;T&lt;SPAN&gt;he&amp;nbsp;__sys_write() function in retarget_itm.c is not being called when I use printf statements. However, the program gets compiled. Please let me know what might be the issue.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Prachi&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 07:09:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/printf-using-ITM/m-p/602598#M32235</guid>
      <dc:creator>prachipanse</dc:creator>
      <dc:date>2017-02-27T07:09:03Z</dc:date>
    </item>
  </channel>
</rss>

