<?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: Hard Fault on call to soft float routine in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245270#M6413</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain where you added the -mcpu=cortex-m4 for the linker? I'm trying to add this option to the linker flags (Xlinker [option]) but it gives error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Oct 2013 23:30:39 GMT</pubDate>
    <dc:creator>embeddedarchite</dc:creator>
    <dc:date>2013-10-25T23:30:39Z</dc:date>
    <item>
      <title>Hard Fault on call to soft float routine</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245267#M6410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm having some trouble with using floating point operations on a K10. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I'm compiling with gcc with -mcpu=cortex-m4 -mabi=aapcs -mthumb -msoft-float.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I get a Hard Fault exception on executing the blx instruction highlighted below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 74&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subfactor = LOOP_CYCLES*1e6/cpu_clockRate;&lt;/P&gt;&lt;P&gt;000008c2:&amp;nbsp;&amp;nbsp; movw r3, #61448 ; 0xf008&lt;/P&gt;&lt;P&gt;000008c6:&amp;nbsp;&amp;nbsp; movt r3, #8191&amp;nbsp; ; 0x1fff&lt;/P&gt;&lt;P&gt;000008ca:&amp;nbsp;&amp;nbsp; ldrh r3, [r3, #0]&lt;/P&gt;&lt;P&gt;000008cc:&amp;nbsp;&amp;nbsp; mov r0, r3&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;000008ce:&amp;nbsp;&amp;nbsp; blx 0x1458 &amp;lt;__floatsidf&amp;gt;&amp;nbsp;&amp;nbsp; &amp;lt;-- Core Hard Faults here&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;000008d2:&amp;nbsp;&amp;nbsp; mov r2, r0&lt;/P&gt;&lt;P&gt;000008d4:&amp;nbsp;&amp;nbsp; mov r3, r1&lt;/P&gt;&lt;P&gt;000008d6:&amp;nbsp;&amp;nbsp; add r1, pc, #56 ; (adr r1, 0x910 &amp;lt;cpu_Delay+88&amp;gt;)&lt;/P&gt;&lt;P&gt;000008d8:&amp;nbsp;&amp;nbsp; ldrd r0, r1, [r1]&lt;/P&gt;&lt;P&gt;000008dc:&amp;nbsp;&amp;nbsp; blx 0x17c4 &amp;lt;__divdf3&amp;gt;&lt;/P&gt;&lt;P&gt;000008e0:&amp;nbsp;&amp;nbsp; mov r2, r0&lt;/P&gt;&lt;P&gt;000008e2:&amp;nbsp;&amp;nbsp; mov r3, r1&lt;/P&gt;&lt;P&gt;000008e4:&amp;nbsp;&amp;nbsp; mov r0, r2&lt;/P&gt;&lt;P&gt;000008e6:&amp;nbsp;&amp;nbsp; mov r1, r3&lt;/P&gt;&lt;P&gt;000008e8:&amp;nbsp;&amp;nbsp; blx 0x19d0 &amp;lt;__fixdfsi&amp;gt;&lt;/P&gt;&lt;P&gt;000008ec:&amp;nbsp;&amp;nbsp; mov r3, r0&lt;/P&gt;&lt;P&gt;000008ee:&amp;nbsp;&amp;nbsp; strh r3, [r7, #14]&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the code for the __floatsidf, it doesn't look like thumb code? Is this right? Am I missing a compiler flag?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __floatsidf:&lt;/P&gt;&lt;P&gt;00001458:&amp;nbsp;&amp;nbsp; teq r0, #0&lt;/P&gt;&lt;P&gt;0000145c:&amp;nbsp;&amp;nbsp; moveq r1, #0&lt;/P&gt;&lt;P&gt;00001460:&amp;nbsp;&amp;nbsp; bxeq lr&lt;/P&gt;&lt;P&gt;00001464:&amp;nbsp;&amp;nbsp; push {r4, r5, lr}&lt;/P&gt;&lt;P&gt;00001468:&amp;nbsp;&amp;nbsp; mov r4, #1024&amp;nbsp;&amp;nbsp; ; 0x400&lt;/P&gt;&lt;P&gt;0000146c:&amp;nbsp;&amp;nbsp; add r4, r4, #50 ; 0x32&lt;/P&gt;&lt;P&gt;00001470:&amp;nbsp;&amp;nbsp; ands r5, r0, #-2147483648&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; 0x80000000&lt;/P&gt;&lt;P&gt;00001474:&amp;nbsp;&amp;nbsp; rsbmi r0, r0, #0&lt;/P&gt;&lt;P&gt;00001478:&amp;nbsp;&amp;nbsp; mov r1, #0&lt;/P&gt;&lt;P&gt;0000147c:&amp;nbsp;&amp;nbsp; b 0x1274 &amp;lt;__aeabi_dadd+336&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 13:29:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245267#M6410</guid>
      <dc:creator>chris_f</dc:creator>
      <dc:date>2013-09-23T13:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault on call to soft float routine</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245268#M6411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like I was lacking -mcpu=cortex-m4 in my linker options.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 20:21:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245268#M6411</guid>
      <dc:creator>chris_f</dc:creator>
      <dc:date>2013-09-23T20:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault on call to soft float routine</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245269#M6412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am glad your issue is solved. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 21:50:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245269#M6412</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2013-09-24T21:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Hard Fault on call to soft float routine</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245270#M6413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain where you added the -mcpu=cortex-m4 for the linker? I'm trying to add this option to the linker flags (Xlinker [option]) but it gives error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2013 23:30:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hard-Fault-on-call-to-soft-float-routine/m-p/245270#M6413</guid>
      <dc:creator>embeddedarchite</dc:creator>
      <dc:date>2013-10-25T23:30:39Z</dc:date>
    </item>
  </channel>
</rss>

