<?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 Problem returning double from a function. in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-returning-double-from-a-function/m-p/587406#M13320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am migrating an existing CW10.4 project to include USB with bootloader on a product.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting with the existing project, i have copied in P&amp;amp;E components, .lcf files etc from another product which already has USB working. This is now working as expected.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the new project is not returning a double correctly, whereas the existing project does.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as i can tell, all the project settings are the same, both use Codewarrior ARM C compiler etc.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached screenshots showing a difference in assembler between the two projects where the double is returned from a function. These functions are identical in source code.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There must be a setting somewhere i have missed...&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen on non-kinetis CW that you can specify if double is 32bit or 64bit, but can't find this for kinetis.&amp;nbsp; Could it be related to this?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jun 2016 08:46:33 GMT</pubDate>
    <dc:creator>leccy</dc:creator>
    <dc:date>2016-06-29T08:46:33Z</dc:date>
    <item>
      <title>Problem returning double from a function.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-returning-double-from-a-function/m-p/587406#M13320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am migrating an existing CW10.4 project to include USB with bootloader on a product.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting with the existing project, i have copied in P&amp;amp;E components, .lcf files etc from another product which already has USB working. This is now working as expected.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the new project is not returning a double correctly, whereas the existing project does.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as i can tell, all the project settings are the same, both use Codewarrior ARM C compiler etc.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached screenshots showing a difference in assembler between the two projects where the double is returned from a function. These functions are identical in source code.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There must be a setting somewhere i have missed...&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen on non-kinetis CW that you can specify if double is 32bit or 64bit, but can't find this for kinetis.&amp;nbsp; Could it be related to this?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2016 08:46:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-returning-double-from-a-function/m-p/587406#M13320</guid>
      <dc:creator>leccy</dc:creator>
      <dc:date>2016-06-29T08:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem returning double from a function.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-returning-double-from-a-function/m-p/587407#M13321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In "Double return fails.png",&lt;/P&gt;&lt;P&gt;the line bl $T (0x1d26c)&lt;/P&gt;&lt;P&gt;is the address of&amp;nbsp; "(FP_fastI_Thumb_LE_v7M.a _d_itod.o&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )"&lt;/P&gt;&lt;P&gt;So it would appear be calling a library integer to double function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2016 12:45:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-returning-double-from-a-function/m-p/587407#M13321</guid>
      <dc:creator>leccy</dc:creator>
      <dc:date>2016-06-29T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem returning double from a function.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-returning-double-from-a-function/m-p/587408#M13322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fixed this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had left out an include file which contained the function which was returning double in the file where the function was being called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This did not produce an error on compilation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Introducing the include file changes the assembler produced to correctly return double.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2016 10:28:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-returning-double-from-a-function/m-p/587408#M13322</guid>
      <dc:creator>leccy</dc:creator>
      <dc:date>2016-06-30T10:28:54Z</dc:date>
    </item>
  </channel>
</rss>

