<?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: i.MX8MP: Cannot print float values from SDK M7 examples in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407852#M186563</link>
    <description>&lt;P&gt;Here is attachment.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 05:29:05 GMT</pubDate>
    <dc:creator>b36401</dc:creator>
    <dc:date>2022-02-02T05:29:05Z</dc:date>
    <item>
      <title>i.MX8MP: Cannot print float values from SDK M7 examples</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407676#M186549</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I am using custom board based on i.MX8MP EVK. I am using the SDK created from NXP MCUXpresso SDK builder for i.MX8MPEVK. I am not using the MCUXpresso&amp;nbsp; IDE as it is not supported for i.MX8MP platform so building the examples on Ubuntu 20.04 using gcc-arm toolchain. Looking at the examples for M7 co-processor (ecspi polling), I'm unable to print floating point values. The floating point values are stored correctly and in the flags.cmake I see that the below flags are defined.&lt;/P&gt;&lt;P&gt;-mfloat-abi=hard&amp;nbsp;&lt;BR /&gt;-mfpu=fpv5-sp-d16&amp;nbsp;&lt;/P&gt;&lt;P&gt;The statement -&amp;nbsp;&lt;SPAN&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Execution timer: &lt;/SPAN&gt;&lt;SPAN&gt;%s&lt;/SPAN&gt;&lt;SPAN&gt;\n\r&lt;/SPAN&gt;&lt;SPAN&gt;Time: &lt;/SPAN&gt;&lt;SPAN&gt;%u&lt;/SPAN&gt;&lt;SPAN&gt; ticks &lt;/SPAN&gt;&lt;SPAN&gt;%2.5f&lt;/SPAN&gt;&lt;SPAN&gt; milliseconds&lt;/SPAN&gt;&lt;SPAN&gt;\n\r&lt;/SPAN&gt;&lt;SPAN&gt;DONE&lt;/SPAN&gt;&lt;SPAN&gt;\n\r&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"1 day"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;86400&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;86.4&lt;/SPAN&gt;&lt;SPAN&gt;); doesn't print 86.4, just a blank space. If I check the hex value at the address of a float variable, the value is correct which means only PRINTF has issue printing the float value.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;float&lt;/SPAN&gt; &lt;SPAN&gt;test&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;86.6&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt; *&lt;/SPAN&gt;&lt;SPAN&gt;ptr&lt;/SPAN&gt;&lt;SPAN&gt; = (&lt;/SPAN&gt;&lt;SPAN&gt;int32_t&lt;/SPAN&gt;&lt;SPAN&gt; *)&amp;amp;&lt;/SPAN&gt;&lt;SPAN&gt;test&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"float in hex - &lt;/SPAN&gt;&lt;SPAN&gt;%x&lt;/SPAN&gt;&lt;SPAN&gt;\r\n&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, *&lt;/SPAN&gt;&lt;SPAN&gt;ptr&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outputs -&amp;nbsp;0x42ad3333 which is correct for 86.6&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Does any one know how to get the custom PRINTF function of the SDK to print floating point values? Is it the problem with the C library being used for M7 co-processor examples build?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 16:54:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407676#M186549</guid>
      <dc:creator>vin_imd</dc:creator>
      <dc:date>2022-02-01T16:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP: Cannot print float values from SDK M7 examples</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407851#M186562</link>
      <description>&lt;P&gt;Please note that %x option in printf means integer in hex. So in this case the code gets the bytes of the variable and looks at them as an integer variable.&lt;BR /&gt;You need to write a routine that parses a float and divides in into integer and fractional parts of a number.&lt;BR /&gt;You can refer to example I attached.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 05:27:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407851#M186562</guid>
      <dc:creator>b36401</dc:creator>
      <dc:date>2022-02-02T05:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8MP: Cannot print float values from SDK M7 examples</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407852#M186563</link>
      <description>&lt;P&gt;Here is attachment.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 05:29:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407852#M186563</guid>
      <dc:creator>b36401</dc:creator>
      <dc:date>2022-02-02T05:29:05Z</dc:date>
    </item>
  </channel>
</rss>

