<?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: printf compiles into something bizarre in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/printf-compiles-into-something-bizarre/m-p/270199#M10140</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind. Didn't copy the ROM sections containing the print strings to RAM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jan 2014 20:09:55 GMT</pubDate>
    <dc:creator>seandonohue</dc:creator>
    <dc:date>2014-01-31T20:09:55Z</dc:date>
    <item>
      <title>printf compiles into something bizarre</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/printf-compiles-into-something-bizarre/m-p/270198#M10139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to add printf functionality on LINFlex_1 on an MPC5675K. I have written the stub functions InitializeUART, ReadUARTN, and WriteUARTN, but these are never called. No warnings or errors either. When I look at what is compiled from the EWL C library, it makes no sense to me. This is the program flow after calling printf("rbInit"):&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;printformat.c&lt;/P&gt;&lt;P&gt;line 114&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __pformatter&lt;/P&gt;&lt;P&gt;line 95&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;line 113&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; va_start&lt;/P&gt;&lt;P&gt;line 114&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __pformatter&lt;/P&gt;&lt;P&gt;line 113&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; va_start&lt;/P&gt;&lt;P&gt;line 114&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __pformatter&lt;/P&gt;&lt;P&gt;line 113&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; va_start&lt;/P&gt;&lt;P&gt;line 114&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __pformatter&lt;/P&gt;&lt;P&gt;line 1906&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;runtime.c&lt;/P&gt;&lt;P&gt;__create_frame_and_save_gpr_21&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;printformat.c&lt;/P&gt;&lt;P&gt;line 2138&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num_chars = ... &lt;/P&gt;&lt;P&gt;line 1932&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chars_written = 0&lt;/P&gt;&lt;P&gt;line 2377&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *buff_ptr = '%'&lt;/P&gt;&lt;P&gt;line 1934&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(*format_ptr) {&lt;/P&gt;&lt;P&gt;line 2479&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (chars_written)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;runtime.c&lt;/P&gt;&lt;P&gt;__restore_gpr_21_exit&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And finally back to main. num_chars is never updated, buffers seem to be filled with all 0's, and many lines of code are just never executed or compiled. What is going on here? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 17:07:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/printf-compiles-into-something-bizarre/m-p/270198#M10139</guid>
      <dc:creator>seandonohue</dc:creator>
      <dc:date>2014-01-31T17:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: printf compiles into something bizarre</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/printf-compiles-into-something-bizarre/m-p/270199#M10140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind. Didn't copy the ROM sections containing the print strings to RAM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 20:09:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/printf-compiles-into-something-bizarre/m-p/270199#M10140</guid>
      <dc:creator>seandonohue</dc:creator>
      <dc:date>2014-01-31T20:09:55Z</dc:date>
    </item>
  </channel>
</rss>

