<?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: CFV1 with CW6.1 floating point support for printf in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176466#M5735</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks a lot kef!&amp;nbsp; That did the trick.&lt;BR /&gt;&lt;BR /&gt;I had to also "#define LIBDEF_PRINTF_PREC 1" as well in order for it to compile.&amp;nbsp; That was fine as I needed the precision feature anyway.&lt;BR /&gt;&lt;BR /&gt;I also found that I did need the C_4i_CF_RegABI_MATH_MSL.a library instead of the default or I would get a link error for "frexp".&lt;BR /&gt;&lt;BR /&gt;Thanks again.&amp;nbsp; I hope this may be of use to others.&amp;nbsp; For a heads up though, adding the floating point support added about 8 kB to my code.&amp;nbsp; Ouch &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 05 Jan 2008 03:39:12 GMT</pubDate>
    <dc:creator>KAR</dc:creator>
    <dc:date>2008-01-05T03:39:12Z</dc:date>
    <item>
      <title>CFV1 with CW6.1 floating point support for printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176462#M5731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked at several posts talking about shrinking the footprint of printf-like functions by setting #define switches in header files.&amp;nbsp; There is also a "Tips &amp;amp; Tricks" segment about this discussed &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fabstract%2Fcorporate%2Fnewsletter_archives%2FNL_04-10-07.htm" rel="nofollow" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; I wish to do the opposite.&amp;nbsp; I want full floating point support for printf and scanf, but I'm running into problems making it happen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First of all, here is what I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CodeWarrior 6.1 Special Eddition (Under "Help-&amp;gt;About" it states the version is 5.9.0, Build 2404)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF51QE64 for my target MPU&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some other related threads that I have found useful are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fforums.freescale.com%2Ffreescale%2Fboard%2Fmessage%3Fboard.id%3DCWCFCOMM%26message.id%3D766%26query.id%3D77053%23M766" rel="nofollow" target="_blank"&gt;&lt;SPAN&gt;CW 6.3 for ColdFire and floating point&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fforums.freescale.com%2Ffreescale%2Fboard%2Fmessage%3Fboard.id%3DCWCOMM%26message.id%3D212%26query.id%3D77021%23M212" rel="nofollow" target="_blank"&gt;Simple Printf on CF question&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As it stands by default, I can compile printf functions with the "%f" term, but nothing will be displayed.&amp;nbsp; (I'm actually using sprintf and whatever putchar function I choose.)&amp;nbsp; Also, printf works fine for printing integer values (%d, etc.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried adding print.c from "C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\src" and modifying libdefs.h from "C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\lib\hc08c\include", but I getting a lot of errors.&amp;nbsp; Specifically in libdefs.h I include the switch "#define LIBDEF_PRINTF_FLOATING&amp;nbsp;&amp;nbsp; 1".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think others have had success with this process before, but maybe there is a quirk for the Coldfire V1 that I am not aware of.&amp;nbsp; I also wonder if I should be grabing printf.c from the HC08 source directory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for any guidance you can provide.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 05:14:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176462#M5731</guid>
      <dc:creator>KAR</dc:creator>
      <dc:date>2008-01-04T05:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: CFV1 with CW6.1 floating point support for printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176463#M5732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Be sure not to mix the tips for HC08 and for CF. The way to go for the CF V1 is to use another library,&lt;BR /&gt;I think the second thread you mentions tells you which one (sorry, I don't now thouse lib names out of my memory).&lt;BR /&gt;&lt;BR /&gt;Using the printf.c for the HC08 (the out of of lib/hc08c/src) or libdefs.h (out of lib/hc08c/include) is not applicable for the CF V1, instead use the provided MSL library for ColdFire.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;BTW: I still think that not using printf for small the devices is the right thing to do, so maybe a specialized float printing routing and a simple string to UART output is the way to go.&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 05:59:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176463#M5732</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-01-04T05:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: CFV1 with CW6.1 floating point support for printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176464#M5733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thank you for your reply CompilerGuru.&amp;nbsp; I thought the HC08 sources might not be completely compatible with the V1, but that was the only place I could find printf.c.&amp;nbsp; There isn't a subdirectory for that source for the V1 that I could find.&lt;BR /&gt;&lt;BR /&gt;The default libs that were added to my project are:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;fp_coldfire_nodiv.a&lt;BR /&gt;C_4i_CF_RegABI_MSL.a&lt;BR /&gt;C_4i_CF_RegABI_Runtime.a&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;I found information about the MSL from here:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;{install}\Help\PDF\ColdFireV1_Build_Tools_Reference.pdf&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;Then under "ColdFire V1 Tools --&amp;gt; Using MSL Libraries".&amp;nbsp; I replaced the C_4i_CF_RegABI_MSL.a with the C_4i_CF_RegABI_MATH_MSL.a choice because it contained floating point manipulation.&amp;nbsp; This didn't change anything.&amp;nbsp; I then tried replacing the other two libraries with the various other available libraries without any luck.&amp;nbsp; Is there a specific one I need to choose?&amp;nbsp; Is there anything special I need to do besides changing the libraries in the project and recompiling?&lt;BR /&gt;&lt;BR /&gt;I understand that printf functions are bloated and I am not concerned in this application.&amp;nbsp; I just wanted to save a little time instead of writing any specialized functions.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Kevin&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2008 21:37:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176464#M5733</guid>
      <dc:creator>KAR</dc:creator>
      <dc:date>2008-01-04T21:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: CFV1 with CW6.1 floating point support for printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176465#M5734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Did you see these files:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;{install|}\ColdFire_Support\msl\MSL_C\MSL_Common\Src\printf.c&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;{install|}\ColdFire_Support\msl\MSL_C\MSL_Common\Src\printf_tiny_IO.c&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I don't know what's the right way. I added printf_tiny_IO.c to the project and defined&lt;/DIV&gt;&lt;DIV&gt;#define LIBDEF_PRINTF_FLOATING 1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;also I had to unsuppress code for Ten() routine, there's a #if 0 at line 197.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Jan 2008 01:40:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176465#M5734</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-01-05T01:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: CFV1 with CW6.1 floating point support for printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176466#M5735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks a lot kef!&amp;nbsp; That did the trick.&lt;BR /&gt;&lt;BR /&gt;I had to also "#define LIBDEF_PRINTF_PREC 1" as well in order for it to compile.&amp;nbsp; That was fine as I needed the precision feature anyway.&lt;BR /&gt;&lt;BR /&gt;I also found that I did need the C_4i_CF_RegABI_MATH_MSL.a library instead of the default or I would get a link error for "frexp".&lt;BR /&gt;&lt;BR /&gt;Thanks again.&amp;nbsp; I hope this may be of use to others.&amp;nbsp; For a heads up though, adding the floating point support added about 8 kB to my code.&amp;nbsp; Ouch &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Jan 2008 03:39:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176466#M5735</guid>
      <dc:creator>KAR</dc:creator>
      <dc:date>2008-01-05T03:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: CFV1 with CW6.1 floating point support for printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176467#M5736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;You are right, LIBDEF_PRINTF_PREC 1 is necessary to make it compileable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Jan 2008 17:45:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CFV1-with-CW6-1-floating-point-support-for-printf/m-p/176467#M5736</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-01-05T17:45:21Z</dc:date>
    </item>
  </channel>
</rss>

