<?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>Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53920/random-fatal-error-log-message-when-powering-up-board</link><description>We are in the final throws of testing our boards that are based on the BLE UART Peripheral application. The current test environment involves monitoring board and battery life conditions. 
 Occasionally, yet far too often for product reliability, after</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Nov 2019 08:20:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53920/random-fatal-error-log-message-when-powering-up-board" /><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/220730?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 08:20:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebc38d84-4dc6-465e-83b7-e0834d43d8d6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Robin,&lt;/p&gt;
&lt;p&gt;The DEBUG flag is only used for pre-processor checks in the code, so I would suggest reviewing&amp;nbsp;its usage in your code to make sure it doesn&amp;#39;t have any unindented side effects if you haven&amp;#39;t already done it. E.g., check that the program doesn&amp;#39;t go into an infinite loop&amp;nbsp;if your&amp;nbsp;error handler gets invoked.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/220672?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 17:40:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f393c94-7a23-4399-9376-017e6e80e56e</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;These error have not reoccured since I started with the DEBUG flag set. They may have been related to a bug I found wherein I was attempting read/write NVRAM near battery death.&amp;nbsp; At this stage is is unlikely I will have time to chase it unless they become problematic again, or something changes in our schedule.&amp;nbsp; For now the plan to move forward with DEBUG set for production code.&amp;nbsp; Do you see any serious concerns with doing this?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Robin @ TL&lt;/p&gt;
&lt;p&gt;PS.&amp;nbsp; You can close this case for now.&amp;nbsp; I will be opening one today regarding pairing/bonding implications for ble_app_uart and ble_app_uart_central.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218888?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 15:44:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fd12d14-dbb6-40ce-8f8d-0a487d588843</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Robin,&lt;/p&gt;
[quote userid="74971" url="~/f/nordic-q-a/53920/random-fatal-error-log-message-when-powering-up-board/218857"]I am not sure you caught the gist of this latest finding.&amp;nbsp; With the DEBUG flag there had need no reboots or errors.&amp;nbsp; Or might I not be understanding your reply?[/quote]
&lt;p&gt;You&amp;#39;re right. The DEBUG flag could explain why you no longer get reboots, but it doesn&amp;#39;t explain why the errors have stopped occurring. It&amp;#39;s hard to say if that&amp;#39;s a coincidence or not.&lt;/p&gt;
[quote userid="74971" url="~/f/nordic-q-a/53920/random-fatal-error-log-message-when-powering-up-board/218857"]Right now I am more concerned about why before DEBUG there were multiple reboots within a few hours, and since it, there had been none ( will be rechecking that this AM).[/quote]
&lt;p&gt;Could you try to&amp;nbsp;add logging in&amp;nbsp;&lt;span&gt;APP_UART_COMMUNICATION_ERROR without setting the DEBUG flag to see if this may be the error source?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218857?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 14:14:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32740cd8-233c-418b-922e-61fd51d57909</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I am not sure you caught the gist of this latest finding.&amp;nbsp; With the DEBUG flag there had need no reboots or errors.&amp;nbsp; Or might I not be understanding your reply?&lt;/p&gt;
&lt;p&gt;Indeed, during the Cal and test processes there is code that writes (and therefore necessarily erases) NVRAM.&amp;nbsp; I may have a handle on this, as I am doing battery life monitoring then at full charge and discharge saving the data to NVRAM.&amp;nbsp; Under some battery conditions the battery may fully crash before the write. This could be the rare memory erasure.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Right now I am more concerned about why before DEBUG there were multiple reboots within a few hours, and since it, there had been none ( will be rechecking that this AM).&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Thanks again for your time,&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Robin @ TL&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218722?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 07:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a73032b3-71f5-4ba0-a495-dad9aa7bf273</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Robin,&lt;/p&gt;
&lt;p&gt;It might be related. The DEBUG flag changes the error handling in the default app error handler: without the flag, the device resets itself by calling NVIC_SystemReset() to attempt to recover, and with the flag set, it enters the infinite loop&amp;nbsp;app_error_save_and_stop() to allow the error information to be&amp;nbsp;inspected with the&amp;nbsp;debugger.&lt;/p&gt;
&lt;p&gt;I know I indicated earlier that the error information (from&amp;nbsp;app_error_save_and_stop)&amp;nbsp; would be logged. But I had forgotten that crash logging was&amp;nbsp;first introduced in SDK 14, so sorry for the confusion.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The default error handler from SDK 12.3.0 is shown below. If you want to verify if the behavior I described above with your app, you may&amp;nbsp;insert an APP_ERROR_CHECK() macro in main() and pass an error code to it. Then try debugging with and without the DEBUG flag.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Application main function.
 */
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;

    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
    uart_init();

    APP_ERROR_CHECK(NRF_ERROR_INVALID_PARAM); //&amp;lt;-- will invoke error handler when input is not NRF_SUCCESS
    ...
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-0e34eb79a5ef48ee83558f65ea390a16/pastedimage1573023251218v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Anyway, the&amp;nbsp;&lt;span&gt;&amp;quot;Fatal Error&amp;quot; message confirms the app is entering the fault handler, so the next step should be to find out where the error occurred. Since your app is based on ble_app_uart I&amp;#39;m wondering if you have kept the default handling for the&amp;nbsp;APP_UART_COMMUNICATION_ERROR event in the UART callback? This is a common source of errors. A floating RX input, level change on startup, etc may lead to a UART&amp;nbsp;&lt;a title="Error conditions" href="https://infocenter.nordicsemi.com/topic/ps_nrf52811/uart.html?cp=3_3_0_5_26_6#concept_ihd_yqw_sr"&gt;Error condition&lt;/a&gt;&amp;nbsp;(link to nrf52 but same applies to 51). To check if this may be the case I suggest that you insert&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt; case APP_UART_COMMUNICATION_ERROR:&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_LOG_INFO(&amp;quot; UART comm error. Error source %d&amp;quot;,&amp;nbsp;p_event-&amp;gt;data.error_communication);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication); // &amp;lt;-- Will invoke fault handler. Handling of this error is application-specific. May be removed if it&amp;#39;s OK to ignore com. errors.&amp;nbsp;&lt;br /&gt; break;&lt;/span&gt;&lt;/p&gt;
[quote user=""]2) Once booted, the contents of NVRAM (Board Cal, Sensor Cal, and board/battery life information) have been erased.[/quote]
&lt;p&gt;This is probably not directly related to the code assertion. Is there anything in your code that may delete the data in certain conditions?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218704?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 03:45:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:906b4717-371f-4202-8a64-d0668f9095b7</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello yet again Vidar,&lt;/p&gt;
&lt;p&gt;I am not sure this is related, but it very well may be.&amp;nbsp; I had powered 5 new boards yesterday and started burning them in.&amp;nbsp; When I checked them this morning all but one had multiple reboots.&amp;nbsp; At that juncture I elected to recompile with the DEBUG flag set, as you suggested, downloaded to all five boards, and restarted the burnin test on all of them, while monitoring the worst for errors.&amp;nbsp; So far no errors.&amp;nbsp; The only change I made to the code was the DEBUG flag.&amp;nbsp; What do you think could be going on?&lt;/p&gt;
&lt;p&gt;The failures the first attempt, before setting the flag happened within a few hours of the original burnin start.&amp;nbsp; I am now more than half way through the (24hr) burnin restart, with no sign of problem.&lt;/p&gt;
&lt;p&gt;Thanks for your input&lt;/p&gt;
&lt;p&gt;Robin @ TL&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218652?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 16:05:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d16337e-8ceb-4fe4-b045-7ae59d1b7f4c</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Vidar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where will these additional debug message appear? Are limited to the log config setting, or can they be directed to the BT UART port?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218587?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 13:31:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96b4e2e4-33ba-48fb-bd39-3bc79eb2fb24</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Ah, I see, thank you very much Vidar.&lt;/p&gt;
&lt;p&gt;Robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218422?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 07:35:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db33ffde-6122-4643-86fe-e1113d618324</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Robin,&lt;/p&gt;
&lt;p&gt;The &amp;quot;DEBUG&amp;quot; flag does not impact the log level, that&amp;#39;s a separate configuration option in the logger module. The flag is usually set like this if you use Keil:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-0e34eb79a5ef48ee83558f65ea390a16/pastedimage1572939300505v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218354?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 18:36:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12e48b54-5d67-4375-a1d9-8acb724b9763</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello again Vidar,&lt;/p&gt;
&lt;p&gt;Thank you for the response.&amp;nbsp; I am currently logging only &amp;quot;INFO&amp;quot; as I use this mode to trace the code execution.&amp;nbsp; I will set the flag for &amp;quot;DEBUG&amp;quot;.&amp;nbsp; Will the info messages still print in DEBUG mode?&lt;/p&gt;
&lt;p&gt;Thanks again, and happiest of Holday Seasons to you and yours.&lt;/p&gt;
&lt;p&gt;Robin @ TL&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random Fatal Error log message when powering up board</title><link>https://devzone.nordicsemi.com/thread/218266?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 14:24:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da23d2f9-f6d1-4aa2-8053-baf37c3f9888</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please try to compile your project with &amp;quot;DEBUG&amp;quot; defined if you haven&amp;#39;t done so already.&amp;nbsp;It should result in a more verbose crash log&amp;nbsp;if used together with the default app error handler (&lt;a title="Error module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_error.html?cp=5_1_3_13"&gt;Error module&lt;/a&gt;). Error information may include the file name and line number of where the error occurred.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>