<?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 FAQsのトピックHow to use ITM Printf</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/How-to-use-ITM-Printf/m-p/470538#M61</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Updated:&lt;/STRONG&gt; Now also compatible with the newlib nohost library.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;ITM Overview&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;As part of its SWO Trace functionality, LPCXpresso IDE v8.0.0 introduced the ability to make use of the ITM : The Instrumentation Trace Macrocell (ITM) block provides a mechanism for sending data from your target to the debugger via the SWO trade stream. This communication is achieved though a memory-mapped register interface. Data written to any of 32 stimulus registers is forwarded to the SWO stream. Unlike other SWO functionality, using the ITM stimulus ports requires changes to your code and so should not be considered non-intrusive.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;Using the ITM to handle printf and scanf&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; LPCXpresso IDE v8.0.0 only supports ITM via stimulus port 0. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #303030;"&gt;Scanf functionality is achieved via a special global variable, which allows the debugger to send characters from the console to the target (using the trace interface). The debugger writes data to the global variable named ITM_RxBuffer to be picked up by scanf.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #303030;"&gt;To use this functionality with an LPC Open project you need to:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Include the attached file (retarget_itm.c) in your project.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Ensure you are using the redlib semihost or redlib or newlib nohost library.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Then simply add calls to printf and scanf to your code.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;If you just linking against the LPCOpen Chip library, then this is all you need to do. However if you are also linking against an LPCOpen board library then you will likely see build errors of the form: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;CODE style="font-family: monospace, serif;"&gt;../src/retarget.h:224: multiple definition of `__sys_write'&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;CODE&gt;../src/retarget.h:240: multiple definition of `__sys_readc'&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;locating the file board.h and enable the line: #define DEBUG_SEMIHOSTING, or&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;locating the source file board.c within the LPCOpen board library and comment out the line: #include "retarget.h&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;SWO ITM console view&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Data written to the ITM stimulus port 0 is presented in this view (as below) . The view shows the ITM console for the active debug session. Text entered into this console is sent to the target if a suitable receiving buffer exists (specifically the global int32_t ITM_RxBuffer).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; that once the target is terminated the view is cleared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2 style="font-family: Lato, sans-serif; color: #e66e08; font-size: 18px; background: 0 50% #ffffff;"&gt;&lt;SPAN class="inline inline-left"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="147897_147897.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121271iE0D693935D9360E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="147897_147897.png" alt="147897_147897.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="itmConsole_3.preview.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/52240i54AF4607DB1F2A60/image-size/large?v=v2&amp;amp;px=999" role="button" title="itmConsole_3.preview.png" alt="itmConsole_3.preview.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/H2&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Within this view, there are the standard start and stop buttons.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;When ITM trace is started, and data sent from the target will be displayed in this view.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;When ITM trace is stopped, any data sent from the target will not be captured.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; choosing to display ITM trace data has no impact on the performance of code running on the target MCU.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;In addition to the standalone ITM Console view, the ITM console is also displayed as part of the standard console viewer . It can be displayed by selecting the “Display Selected Console” button and choosing the console named "&amp;lt;your project&amp;gt; ITM Console". This view persists after the target is terminated, unlike the standalone ITM console view.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; the standard console viewer switches automatically between consoles to show consoles that are being written to. This switching can be confusing as the ITM console is easily lost among the other consoles displayed there. It is easier to keep track of the standalone ITM console.&lt;/SPAN&gt;&lt;SPAN style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;"&gt;&lt;SPAN class="inline inline-left"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;"&gt;&lt;SPAN class="inline inline-left"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="147898_147898.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121272i8E864D04501C6376/image-size/large?v=v2&amp;amp;px=999" role="button" title="147898_147898.png" alt="147898_147898.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="itmRegularConsoleViewAnno.preview.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/52032iD56E2986A7D8F20C/image-size/large?v=v2&amp;amp;px=999" role="button" title="itmRegularConsoleViewAnno.preview.png" alt="itmRegularConsoleViewAnno.preview.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;H2&gt;&lt;/H2&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;ITM vs Semihosting&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;ITM printf and semihosting printf may seem to offer similar features however there are significant differences between these two schemes.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;A semihosted event halts the MCU and needs support from the debug tools to handle the semihosted operation.&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Without debug tools attached, a semihosted event &lt;STRONG&gt;will permanently halt&lt;/STRONG&gt; the MCU.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Semihosting events will not be lost, since the MCU will be halted until the event is processed.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Semihosting is supported on all LPC MCUs.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;An ITM event sends data to a port and does not cause the MCU to halt.&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Without debug tools attached, an ITM event &lt;STRONG&gt;will not halt&lt;/STRONG&gt; the MCU, it will simply be ignored.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;ITM operations could be left within production code, thereby allowing logging information to be captured simply by connecting debug tools to a running MCU.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;ITM is only available on LPC MCUs using Cortex-M3 and Cortex-M4 cores.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Within the LPCXpresso IDE version 8.0, ITM operations only support printf and scanf functionality.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;For further information please see the following FAQs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389084" data-objecttype="1" href="https://community.nxp.com/thread/389084"&gt;Overview of Trace support in LPCXpresso IDE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389156" data-objecttype="1" href="https://community.nxp.com/thread/389156"&gt;What is Semihosting?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389104" data-objecttype="1" href="https://community.nxp.com/thread/389104"&gt;Switching the selected C library&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389140" data-objecttype="1" href="https://community.nxp.com/thread/389140"&gt;Using printf()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339131"&gt;retarget_itm.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Mar 2016 19:33:49 GMT</pubDate>
    <dc:creator>lpcware-support</dc:creator>
    <dc:date>2016-03-31T19:33:49Z</dc:date>
    <item>
      <title>How to use ITM Printf</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/How-to-use-ITM-Printf/m-p/470538#M61</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Updated:&lt;/STRONG&gt; Now also compatible with the newlib nohost library.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;ITM Overview&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;As part of its SWO Trace functionality, LPCXpresso IDE v8.0.0 introduced the ability to make use of the ITM : The Instrumentation Trace Macrocell (ITM) block provides a mechanism for sending data from your target to the debugger via the SWO trade stream. This communication is achieved though a memory-mapped register interface. Data written to any of 32 stimulus registers is forwarded to the SWO stream. Unlike other SWO functionality, using the ITM stimulus ports requires changes to your code and so should not be considered non-intrusive.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;Using the ITM to handle printf and scanf&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; LPCXpresso IDE v8.0.0 only supports ITM via stimulus port 0. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #303030;"&gt;Scanf functionality is achieved via a special global variable, which allows the debugger to send characters from the console to the target (using the trace interface). The debugger writes data to the global variable named ITM_RxBuffer to be picked up by scanf.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #303030;"&gt;To use this functionality with an LPC Open project you need to:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Include the attached file (retarget_itm.c) in your project.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Ensure you are using the redlib semihost or redlib or newlib nohost library.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Then simply add calls to printf and scanf to your code.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;If you just linking against the LPCOpen Chip library, then this is all you need to do. However if you are also linking against an LPCOpen board library then you will likely see build errors of the form: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;CODE style="font-family: monospace, serif;"&gt;../src/retarget.h:224: multiple definition of `__sys_write'&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;CODE&gt;../src/retarget.h:240: multiple definition of `__sys_readc'&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;locating the file board.h and enable the line: #define DEBUG_SEMIHOSTING, or&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;locating the source file board.c within the LPCOpen board library and comment out the line: #include "retarget.h&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;SWO ITM console view&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Data written to the ITM stimulus port 0 is presented in this view (as below) . The view shows the ITM console for the active debug session. Text entered into this console is sent to the target if a suitable receiving buffer exists (specifically the global int32_t ITM_RxBuffer).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; that once the target is terminated the view is cleared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;H2 style="font-family: Lato, sans-serif; color: #e66e08; font-size: 18px; background: 0 50% #ffffff;"&gt;&lt;SPAN class="inline inline-left"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="147897_147897.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121271iE0D693935D9360E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="147897_147897.png" alt="147897_147897.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="itmConsole_3.preview.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/52240i54AF4607DB1F2A60/image-size/large?v=v2&amp;amp;px=999" role="button" title="itmConsole_3.preview.png" alt="itmConsole_3.preview.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/H2&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Within this view, there are the standard start and stop buttons.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;When ITM trace is started, and data sent from the target will be displayed in this view.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;When ITM trace is stopped, any data sent from the target will not be captured.&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; choosing to display ITM trace data has no impact on the performance of code running on the target MCU.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;In addition to the standalone ITM Console view, the ITM console is also displayed as part of the standard console viewer . It can be displayed by selecting the “Display Selected Console” button and choosing the console named "&amp;lt;your project&amp;gt; ITM Console". This view persists after the target is terminated, unlike the standalone ITM console view.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; the standard console viewer switches automatically between consoles to show consoles that are being written to. This switching can be confusing as the ITM console is easily lost among the other consoles displayed there. It is easier to keep track of the standalone ITM console.&lt;/SPAN&gt;&lt;SPAN style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;"&gt;&lt;SPAN class="inline inline-left"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;"&gt;&lt;SPAN class="inline inline-left"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="147898_147898.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121272i8E864D04501C6376/image-size/large?v=v2&amp;amp;px=999" role="button" title="147898_147898.png" alt="147898_147898.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="itmRegularConsoleViewAnno.preview.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/52032iD56E2986A7D8F20C/image-size/large?v=v2&amp;amp;px=999" role="button" title="itmRegularConsoleViewAnno.preview.png" alt="itmRegularConsoleViewAnno.preview.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;H2&gt;&lt;/H2&gt;&lt;H2&gt;&lt;SPAN style="color: #eb7a3d;"&gt;ITM vs Semihosting&lt;/SPAN&gt;&lt;/H2&gt;&lt;HR style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;" /&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;ITM printf and semihosting printf may seem to offer similar features however there are significant differences between these two schemes.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;A semihosted event halts the MCU and needs support from the debug tools to handle the semihosted operation.&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Without debug tools attached, a semihosted event &lt;STRONG&gt;will permanently halt&lt;/STRONG&gt; the MCU.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Semihosting events will not be lost, since the MCU will be halted until the event is processed.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Semihosting is supported on all LPC MCUs.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;An ITM event sends data to a port and does not cause the MCU to halt.&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Without debug tools attached, an ITM event &lt;STRONG&gt;will not halt&lt;/STRONG&gt; the MCU, it will simply be ignored.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;ITM operations could be left within production code, thereby allowing logging information to be captured simply by connecting debug tools to a running MCU.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;ITM is only available on LPC MCUs using Cortex-M3 and Cortex-M4 cores.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #303030;"&gt;Within the LPCXpresso IDE version 8.0, ITM operations only support printf and scanf functionality.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;For further information please see the following FAQs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389084" data-objecttype="1" href="https://community.nxp.com/thread/389084"&gt;Overview of Trace support in LPCXpresso IDE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389156" data-objecttype="1" href="https://community.nxp.com/thread/389156"&gt;What is Semihosting?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389104" data-objecttype="1" href="https://community.nxp.com/thread/389104"&gt;Switching the selected C library&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389140" data-objecttype="1" href="https://community.nxp.com/thread/389140"&gt;Using printf()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339131"&gt;retarget_itm.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 19:33:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/How-to-use-ITM-Printf/m-p/470538#M61</guid>
      <dc:creator>lpcware-support</dc:creator>
      <dc:date>2016-03-31T19:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ITM Printf</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/How-to-use-ITM-Printf/m-p/1588994#M204</link>
      <description>&lt;P&gt;ITM is also available on Cortex M33, M7, and... right?&lt;BR /&gt;Would be great if you could update the list above.&lt;BR /&gt;Also, link to source is broken...&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 17:04:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/How-to-use-ITM-Printf/m-p/1588994#M204</guid>
      <dc:creator>davenadler</dc:creator>
      <dc:date>2023-01-27T17:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ITM Printf</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/How-to-use-ITM-Printf/m-p/1698644#M208</link>
      <description>&lt;P&gt;I confirm, the link to source is broken ...&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 13:02:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/How-to-use-ITM-Printf/m-p/1698644#M208</guid>
      <dc:creator>mimlo</dc:creator>
      <dc:date>2023-08-03T13:02:30Z</dc:date>
    </item>
  </channel>
</rss>

