<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>HardFault on nrf52832 when passing floating point value to C++ ostream and can&amp;#39;t get backtrace.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73805/hardfault-on-nrf52832-when-passing-floating-point-value-to-c-ostream-and-can-t-get-backtrace</link><description>Hello, I&amp;#39;m trying to run C++ code on the nrf52832 but I&amp;#39;m getting an Hard Fault when sending a floating point to an ostream, like in &amp;quot;std::cout &amp;lt;&amp;lt; 13.5f;&amp;quot;. The FPU is enabled. 
 Printing the backtrace from the handler I get the following: 
 (gdb) bt #0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 11 Apr 2021 00:50:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73805/hardfault-on-nrf52832-when-passing-floating-point-value-to-c-ostream-and-can-t-get-backtrace" /><item><title>RE: HardFault on nrf52832 when passing floating point value to C++ ostream and can't get backtrace.</title><link>https://devzone.nordicsemi.com/thread/304129?ContentTypeID=1</link><pubDate>Sun, 11 Apr 2021 00:50:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe30b5ab-1718-4968-ac4f-ffc2e735db61</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Looks like you have a stack overflow. &amp;nbsp;I don&amp;#39;t recommend using any iostream in embedded system especially mcu. &amp;nbsp;use the regular redirected printf instead such as printf via uart. &amp;nbsp;mcu does not have a console iostreams are not going anywhere and takes a lot memory. &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HardFault on nrf52832 when passing floating point value to C++ ostream and can't get backtrace.</title><link>https://devzone.nordicsemi.com/thread/304096?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 19:36:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dd3f167-bec5-45cf-8972-e98f45f61c28</guid><dc:creator>Patrick</dc:creator><description>&lt;p&gt;You will probably want to look into using NRF_LOG_INFO to print information to the console. Take a look at &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/24030/how-to-print-floats-with-nrf_log-macros"&gt;this case&lt;/a&gt; for how to output a float.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>