<?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>CodeWarrior Development Toolsのトピックprintf and undefined reference to 'InitializeUART'</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/printf-and-undefined-reference-to-InitializeUART/m-p/301606#M647</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I created a project with Console I/O radio button checked and added source to the project that called &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. I’m using CodeWarrior v10.5.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;The linker reported that &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;ReadUARTN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, and &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;WriteUARTN &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;were undefined and referenced in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart_console_io.c &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;which is part of &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;libuart.a&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;There are few discussions that ask the question how to use &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf() &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;with CodeWarrior.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;There are few discussions that report &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART() &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;undefined.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I didn't find any good 'how to' answers to connect &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; with a UART.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I searched the CodeWarrior directory tree for the function &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. I found it declared in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;/sys/UART.h&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. I found in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;ew/EWL_C/src/sys/uart_console_io.c &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;a call to &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;So...now I know where the source is located that makes the call to &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, but not the definition of the function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I found in a USB host example, files &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;sci.&amp;lt;c,h&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. These files are part of the example and define &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;'InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;', &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;'ReadUARTN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;', and '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;WriteUARTN'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. Curious.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;However, if one looks at a CodeWarrior example 'hello world' for a specific processor, say k60, one finds in the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;drivers &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;subfolder the directory &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;as well as &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf.c &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;in the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;common&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; folder. This appears to be an older example, because it defines its own uart drivers and its own &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. No mention of &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I then found &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; defined in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;/lib/wizard/ColdFire/uart_support.c&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;In &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;MCU/ARM_GCC_Support/UART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; is &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;readme.txt&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; that states one needs to add UART support to wizard created projects. The document that is supposed to help is &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;MCU/Help/PDF/Targeting Microcontrollers.pdf&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. There is very little discussion on UARTs in this document. There are only two target boards available, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;TWR-K60N512&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; and &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;TWR-KL25Z18&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. The source for these boards does not include definitions for &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitalizeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Calibri, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;In &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;MCU/lib/wizard_data/ColdFire&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; is the original &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart_support.c&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, which defines &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;ReadUARTN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, and &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;WriteUARTN.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Thus, there appears to be two ways to resolve &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;undefined reference to InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, write your own (borrow and modify) version of &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart_support.c&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; or start with an example that supplies its own &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;An alternative is to replace all &lt;SPAN style="font-family: 'courier new', courier;"&gt;printf&lt;/SPAN&gt;()s with &lt;SPAN style="font-family: 'courier new', courier;"&gt;sprintf&lt;/SPAN&gt;()s then call &lt;SPAN style="font-family: 'courier new', courier;"&gt;puts&lt;/SPAN&gt;(). But&lt;SPAN style="font-family: 'courier new', courier;"&gt; puts()&lt;/SPAN&gt; (as does &lt;SPAN style="font-family: 'courier new', courier;"&gt;putchar()&lt;/SPAN&gt;) results in the same undefined&lt;SPAN style="font-family: 'courier new', courier;"&gt; InitializeUART&lt;/SPAN&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Did I miss something?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Mar 2014 18:29:02 GMT</pubDate>
    <dc:creator>Keith4DSmith</dc:creator>
    <dc:date>2014-03-21T18:29:02Z</dc:date>
    <item>
      <title>printf and undefined reference to 'InitializeUART'</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/printf-and-undefined-reference-to-InitializeUART/m-p/301606#M647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I created a project with Console I/O radio button checked and added source to the project that called &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. I’m using CodeWarrior v10.5.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;The linker reported that &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;ReadUARTN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, and &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;WriteUARTN &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;were undefined and referenced in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart_console_io.c &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;which is part of &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;libuart.a&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;There are few discussions that ask the question how to use &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf() &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;with CodeWarrior.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;There are few discussions that report &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART() &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;undefined.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I didn't find any good 'how to' answers to connect &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; with a UART.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I searched the CodeWarrior directory tree for the function &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. I found it declared in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;/sys/UART.h&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. I found in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;ew/EWL_C/src/sys/uart_console_io.c &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;a call to &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;So...now I know where the source is located that makes the call to &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, but not the definition of the function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I found in a USB host example, files &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;sci.&amp;lt;c,h&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. These files are part of the example and define &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;'InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;', &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;'ReadUARTN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;', and '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;WriteUARTN'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. Curious.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;However, if one looks at a CodeWarrior example 'hello world' for a specific processor, say k60, one finds in the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;drivers &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;subfolder the directory &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;as well as &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf.c &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;in the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;common&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; folder. This appears to be an older example, because it defines its own uart drivers and its own &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. No mention of &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I then found &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; defined in &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;/lib/wizard/ColdFire/uart_support.c&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;In &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;MCU/ARM_GCC_Support/UART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; is &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;readme.txt&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; that states one needs to add UART support to wizard created projects. The document that is supposed to help is &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;MCU/Help/PDF/Targeting Microcontrollers.pdf&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. There is very little discussion on UARTs in this document. There are only two target boards available, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;TWR-K60N512&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; and &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;TWR-KL25Z18&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;. The source for these boards does not include definitions for &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitalizeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Calibri, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;In &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;MCU/lib/wizard_data/ColdFire&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; is the original &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart_support.c&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, which defines &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;ReadUARTN&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, and &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;WriteUARTN.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Thus, there appears to be two ways to resolve &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;undefined reference to InitializeUART&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;, write your own (borrow and modify) version of &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;uart_support.c&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; or start with an example that supplies its own &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New';"&gt;printf()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;An alternative is to replace all &lt;SPAN style="font-family: 'courier new', courier;"&gt;printf&lt;/SPAN&gt;()s with &lt;SPAN style="font-family: 'courier new', courier;"&gt;sprintf&lt;/SPAN&gt;()s then call &lt;SPAN style="font-family: 'courier new', courier;"&gt;puts&lt;/SPAN&gt;(). But&lt;SPAN style="font-family: 'courier new', courier;"&gt; puts()&lt;/SPAN&gt; (as does &lt;SPAN style="font-family: 'courier new', courier;"&gt;putchar()&lt;/SPAN&gt;) results in the same undefined&lt;SPAN style="font-family: 'courier new', courier;"&gt; InitializeUART&lt;/SPAN&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Did I miss something?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 18:29:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/printf-and-undefined-reference-to-InitializeUART/m-p/301606#M647</guid>
      <dc:creator>Keith4DSmith</dc:creator>
      <dc:date>2014-03-21T18:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: printf and undefined reference to 'InitializeUART'</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/printf-and-undefined-reference-to-InitializeUART/m-p/301607#M648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Keith:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically all you summarize is correct. As there are many devices with different pinouts and configuration, you need to add the low level UART support for your projects. An easy way to do this is to use the ConsoleIO component provided with Processor Expert, and if you do not want to use Processor Expert you could simply "steal" the generated functions. The next tutorial by our colleague Erich Styger will provide you the tricks to achieve this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/" title="http://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/"&gt;Tutorial: Printf() with (and without) Processor Expert | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, it is a good option to avoid using such console functions (printf, getchar and the like). In such case the next tutorial might be also useful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/10/14/tutorial-printf-and-hello-world-with-the-freedom-kl25z-board/" title="http://mcuoneclipse.com/2012/10/14/tutorial-printf-and-hello-world-with-the-freedom-kl25z-board/"&gt;Tutorial: printf() and “Hello World!” with the Freedom KL25Z Board | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 03:12:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/printf-and-undefined-reference-to-InitializeUART/m-p/301607#M648</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2014-03-27T03:12:35Z</dc:date>
    </item>
  </channel>
</rss>

