<?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>RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64712/ram-reset-after-softreset-nrf52832-sdk-15-2-softdevice-6-1-0</link><description>Hi, 
 I need to reset RAM after softreset. As I read product specification, RAM cannot be cleared after softreset or CPU lockup. 
 Please see below image for reference. 
 
 
 How can I clear total RAM after softreset( NVIC_SystemReset() )?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Aug 2020 08:42:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64712/ram-reset-after-softreset-nrf52832-sdk-15-2-softdevice-6-1-0" /><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264786?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 08:42:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5a3ed6e-5838-4b2b-8d6d-c24102ab9743</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I need more debug information from you to be able to help find the root cause. So please do what I suggested earlier and let me know when you have new information to share.&lt;/p&gt;
[quote user="Somesh Burkule"]can I use it in production? or is it only used for debugging?[/quote]
&lt;p&gt;&amp;nbsp;This is answered in the documentation I linked to. The short answer is yes.&lt;/p&gt;
&lt;p&gt;[quote user="Somesh Burkule"][/quote]&lt;/p&gt;
&lt;p&gt;I am using printf() to sent transmit data to other MCU via UART.&lt;/p&gt;
&lt;p&gt;does it affect application?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think it&amp;#39;s related to the hardfault if that&amp;#39;s what you&amp;#39;re asking. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264726?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 06:25:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b705a97-7ddd-4932-849d-09d7020f9117</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Awaiting your reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Somesh Burkule&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264557?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2020 07:26:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:916674e1-6b08-4c77-b7d1-78155cee1b52</guid><dc:creator>Somesh Burkule</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/64712/ram-reset-after-softreset-nrf52832-sdk-15-2-softdevice-6-1-0/264555"]It&amp;#39;s a good idea to enable the &lt;span&gt;&lt;a title="HardFault handling library" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/lib_hardfault.html?cp=7_1_3_22"&gt;HardFault handling library&lt;/a&gt;&lt;/span&gt;[/quote]
&lt;p&gt;can I use it in production? or is it only used for debugging?&lt;/p&gt;
&lt;p&gt;one more thing, I am using printf() to sent transmit data to other MCU via UART.&lt;/p&gt;
&lt;p&gt;does it affect application? I am sending 10000bytes/500ms&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264555?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2020 07:18:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad7fe270-006a-455f-ac4c-36a2a64b7cc7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Ok, a stack overflow or a buffer overrun sounds likely to me. It&amp;#39;s a good idea to enable the &lt;span&gt;&lt;a title="HardFault handling library" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/lib_hardfault.html?cp=7_1_3_22"&gt;HardFault handling library&lt;/a&gt;&lt;/span&gt;, it may help you determine what caused it. Remember to also enable debug logging, add DEBUG flag to preprocessor list, and disable compiler optimization to get as much error information as possible.&lt;/p&gt;
[quote user="Somesh Burkule"]today I got one point that I have not used uart flush in application anywhere. so I;ll add it now. will this affect something?[/quote]
&lt;p&gt;&amp;nbsp;When would you want to flush the FIFO buffer? It will just remove the received UART data you may have received from RAM.&lt;/p&gt;
&lt;p&gt;Also, please add a check on the &amp;#39;index&amp;#39; variable before the &amp;quot;UNUSED_VARIABLE(app_uart_get(&amp;amp;cmd_Data.raw_Data[index]));&amp;quot; line, in case there is a chance it may be incremented beyond the buffer size.&lt;/p&gt;
&lt;p&gt;eg.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if ( index &amp;gt;= &amp;quot;size of raw data buffer in bytes&amp;quot;)
{
   NRF_LOG_ERROR(&amp;quot;Index is out of bounds with the value: %d&amp;quot;, index&amp;quot;);     
   APP_ERROR_CHECK(NRF_ERROR_INVALID_LENGTH);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264550?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2020 06:31:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dd71cd7-63cb-44e8-bd00-c9f7323d99a4</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;yes, I am only getting this one. I am not confirm about hardfault is due communication error or not.&lt;/p&gt;
&lt;p&gt;Actually when I kept my device on for long time, after some time( 1-2 days or once in day )nordic not responding to other MCU. when I power OFF and ON device again it works ok.&lt;/p&gt;
&lt;p&gt;today I got one point that I have not used uart flush in application anywhere. so I;ll add it now. will this affect something?&lt;/p&gt;
&lt;p&gt;there may stack overflow due to that may cpu lockup but I need to confirm it.&lt;/p&gt;
&lt;p&gt;can I enable hardfault handler? what does this do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264548?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2020 05:54:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b013b6b1-130e-4206-a73a-cbf69c7a1d9d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There does not seem to be anything to trigger a hardfault on APP_UART_COMMUNICATION_ERROR. Are you still able to reproduce the same stack trace you shared with Jared, or is it different now?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-715501f6be734d2cb2e86a7172366fa7/Capture.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264439?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 11:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b36dcd0f-27b5-4b5f-a46a-2875d28425d8</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;please check uart callback given below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void uart_event_handle(app_uart_evt_t * p_event)
{
   
	switch (p_event-&amp;gt;evt_type)
    {
        case APP_UART_DATA_READY:
            UNUSED_VARIABLE(app_uart_get(&amp;amp;cmd_Data.raw_Data[index]));
						
            index++;
				
            if (cmd_Data.raw_Data[index - 1] == &amp;#39;;&amp;#39;)
            {
								cmdRxFlg = true;
            }
						
            break;

        case APP_UART_COMMUNICATION_ERROR:
            
							//APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
				
            break;

        case APP_UART_FIFO_ERROR:
				
							APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
				
            break;

        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264435?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 11:13:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f70140f7-8398-4a95-b657-258b7e38c3bc</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Can you post your updated uart callback? A APP_UART_COMMUNICATION_ERROR does not cause a hardfault by itself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264417?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 09:55:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71dbd226-0441-458f-8a6a-b5c0ad394251</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;I tried with that also still facing an issue.&lt;/p&gt;
&lt;p&gt;what if wrong values passed to ble stack for advertiser and scanner?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Does &amp;quot;APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);&amp;quot; causes hardfault?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264416?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 09:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ea0d9ac-5b08-4743-a5ca-f6410b42c420</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You can comment the &amp;quot;APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);&amp;quot; line in APP_UART_COMMUNICATION_ERROR event to ignore communication errors on the UART bus. This is not related to RAM initialization&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264412?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 09:47:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1651b2e9-0167-4925-b98a-976a376b5afd</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have issue related to nordic hardfault. I am using UART, BLE Scanner, Advertiser parallely in my application code and also fds for storing the parameters. please see below link for the issue.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64313/hardfault-on-parallel-ble-scanning-and-advertising-on-nrf52832-with-fds-storage-sdk15-2"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/64313/hardfault-on-parallel-ble-scanning-and-advertising-on-nrf52832-with-fds-storage-sdk15-2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect this may due to no RAM reset. please help me out for the same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264409?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 09:39:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43903f74-18c0-464f-88a9-9eee70563c78</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;These are basic concepts that are not specific to Nordic MCUs and it&amp;#39;s difficult to cover it one answer. It&amp;#39;s better if you post some code to demonstrate the problem.&lt;/p&gt;
&lt;p&gt;Globals are always initialized on startup, so it doesn&amp;#39;t matter what the reset source is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264403?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2020 09:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d77e25b-cf70-4140-bfc8-1e076749c1bb</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Please tell me your thought about RAM reset? what does it includes?&lt;/p&gt;
&lt;p&gt;Awaiting your reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Somesh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264190?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 08:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cd21814-b96b-4d79-b5b7-dded022fd544</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you please clear me that what is mean by RAM reset? which type of memory is cleared after RAM reset?&lt;/p&gt;
&lt;p&gt;I am asking this because as per my understanding global variables are also part of RAM and they cannot be initialise again when softreset is done in nrf52832.&lt;/p&gt;
&lt;p&gt;As I using other MCU&amp;#39;s, they always resets RAM when there is softreset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264178?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 08:07:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8816abae-41e6-4c0a-810b-2914d061feeb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;How are you declaring the buffers in your code? Global variables that are not assigned a value will automatically be initialized to &amp;#39;0&amp;#39; by the startup code (before reaching main()). Anyway, memset() is a standard function you can use to clear a block of memory. &lt;/p&gt;
&lt;p&gt;e.g.,&lt;/p&gt;
&lt;p&gt;memset(&amp;lt;p_buffer&amp;gt;, 0, sizeof(buffer))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264171?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 07:51:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fc9aa66-75f1-4d1e-a9ba-7d94c8365a54</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Is there any way to clear it using software API?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;rather best solution is to initialise all buffers at the start in main().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264168?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 07:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a96bdf8-899e-4237-ba14-e49582e5d9f6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;As I indicated earlier, the RAM is never reset, regardless of the reset source. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264097?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 13:46:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:360436df-7ee8-40bf-a53f-073c2f30aac8</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;thanks for your quick response.&lt;/p&gt;
&lt;p&gt;I need to clear all buffers and variables used in application code same as hardreset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM reset after softreset | nrf52832 | sdk 15.2 | softdevice 6.1.0</title><link>https://devzone.nordicsemi.com/thread/264095?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 13:43:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:206c6b44-ad12-465d-8eb3-df07f286347e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s usually your startup code that&amp;#39;s responsible for re-initializing (or resetting) the RAM.&amp;nbsp; Notice the statement below the table you referred to: &amp;quot;The RAM is never reset, but depending on reset source, RAM content may be corrupted.&amp;quot;. Maybe you give some more background on what you are trying to achieve? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>