<?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>How to debug with stdlib code around? Was: Code fails in snprintf, how to debug?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20716/how-to-debug-with-stdlib-code-around-was-code-fails-in-snprintf-how-to-debug</link><description>I am using an nrf51822 DK with a (so far) very simple code along: 
 main()
{
 //... init I/O
 run();
}

Inside run:

run()
{
 uint32_t retval = NRF_SUCCESS;

 // nrf_gpio_* calls to set up some GPIOs...
 // Set up UART...

 // VALUE_SIZE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Mar 2017 12:39:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20716/how-to-debug-with-stdlib-code-around-was-code-fails-in-snprintf-how-to-debug" /><item><title>RE: How to debug with stdlib code around? Was: Code fails in snprintf, how to debug?</title><link>https://devzone.nordicsemi.com/thread/80835?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 12:39:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5e206a1-7616-462f-8ec5-ecf4647a4bde</guid><dc:creator>Lisandro Dami&amp;#225;n Nicanor P&amp;#233;rez Meyer</dc:creator><description>&lt;p&gt;And the answer is.... check your boards. There was an electrical issue in the serial port connection that made the board go crazy. Simply unplugging the board from my circuit did the trick.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug with stdlib code around? Was: Code fails in snprintf, how to debug?</title><link>https://devzone.nordicsemi.com/thread/80834?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 12:55:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f45c61a6-cd21-4a65-bf2d-bcbcb561f92b</guid><dc:creator>Lisandro Dami&amp;#225;n Nicanor P&amp;#233;rez Meyer</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;With GCC and newlib you can try using sniprintf(). This function does not support formatting floating point numbers - but should not crash due to missing heap.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Good point! Sadly even using it I&amp;#39;m still facing the issue.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Also, you code example does not compile due to missing declaration of value.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Right, it was just a snippet.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Try to set up an Hardfault_Handler() in your application. This way you will know that something bad happended.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That sounds like a very good advice, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to debug with stdlib code around? Was: Code fails in snprintf, how to debug?</title><link>https://devzone.nordicsemi.com/thread/80833?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 09:06:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56f1461f-8f5b-41c1-880d-11f38c7b8d0f</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;With GCC and newlib you can try using &lt;code&gt;sniprintf()&lt;/code&gt;. This function does not support formatting floating point numbers - but should not crash due to missing heap.&lt;/p&gt;
&lt;p&gt;Also, you code example does not compile due to missing declaration of &lt;code&gt;value&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Try to set up an &lt;code&gt;Hardfault_Handler()&lt;/code&gt; in your application. This way you will know that something bad happended.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>