<?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>NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118995/nrf-5340-resets-automatically-in-between-device-scanning</link><description>hi, 
 i am trying to connect peripherials ( blood pressure, pulseox meter) with nrf5340 using uuid and mac, initially using uuid filter are used to scan the devices around and store the mac of the device. once the mac is stored we use address filter to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Feb 2025 08:46:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118995/nrf-5340-resets-automatically-in-between-device-scanning" /><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/524256?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2025 08:46:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dab5825-912e-426a-b054-f71a5e39e498</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;can you please check if you have&amp;nbsp;&lt;span&gt;CONFIG_RESET_ON_FATAL_ERROR=y in your prj.conf or in your .config file in your build folder.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If that does not help, then please help me reproduce this on the DK and I will try to debug the soft reset and try to get the context of the reset.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/524194?ContentTypeID=1</link><pubDate>Sun, 23 Feb 2025 06:03:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a98d8400-36d8-4c95-9251-3ba2717b1ecb</guid><dc:creator>Aravibala</dc:creator><description>&lt;p&gt;hi susheel i misunderstood your message, actually you have mentioned to select the &amp;quot;optimize for debugging &amp;quot; option in the optimization level. However already the same option is selected during the project build. but still the code does not break during a reset. is there any other options to identify the exact cause of the reset&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/524193?ContentTypeID=1</link><pubDate>Sun, 23 Feb 2025 03:34:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7639868d-06b9-4951-b96d-09bc41f99b06</guid><dc:creator>Aravibala</dc:creator><description>&lt;p&gt;hi susheel, thank you for the mail, sorry for the delay, actually in using RTT viewer for viewing the debug messages. i face issues when using both the debugger and RTT viewer at the same time in visual studio code. i could not get the debugging messages. right now to check if the debugger breaks during reset. im sending a set of hex data to serial port to identify if the board resets. so everytime when the board resets i get the hex code in the serial port but still the break point does not breaks in the debug mode, and im using RTT viewer without debugging to check the debug messages and thats how i got the reason for reset that is soft reset. how can i now see both the debug message and debugger bith at same time to see when the break point breaks and see the reason.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/524115?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 14:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7601bd15-e527-45ea-9548-6308ff64b8bf</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Aravibala"]i&amp;#39;m quite confused, if its due to software then why during the debugging face the debugger did not break at the point.[/quote]
&lt;p&gt;I have seen this behavior many times and most of the times it happens due to the compiler settings of debug optimizations. If you are compiling your program for performance or code size, then there is minimal debug info and the debugger wont function as it should. Please recompile your program (pristine build) after you&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/debugging-in-vs-code/#:~:text=To%20be%20able%20to%20debug,after%20the%20application%20is%20built."&gt; enable optimizations&lt;/a&gt; for debugger.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In VSC you can find it like this&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1740147232031v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;If you are compiling from the command line&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/524057?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 10:42:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d3071d8-4ba0-4642-b0aa-e2f582344d49</guid><dc:creator>Aravibala</dc:creator><description>&lt;p&gt;hi Susheel, thank you for the mail, i tried as per your suggestion by providing the break point in the sys_reboot function and check if the debugger breaks during reset. However the debugger did not break during the reset. i tried to log what causes the reset and came across a function in devzone which helps finding the reason.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/108223/nrf52840-soft-reset-cause"&gt;nrf52840 soft reset cause&lt;/a&gt;&amp;nbsp;in this they provide a function to log the reset cause i tried to add it in my code to determine which causes the fault.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1740134202316v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;and i got the reset is due to software Reset_Software.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i&amp;#39;m quite confused, if its due to software then why during the debugging face the debugger did not break at the point. and how can we further know what the exact cause of the issue. im using the nordic nrf5340_DK development kit and im powering it up using the usb of my laptop. so i dont guess its due to brownout. kindly let me know how i can continue further&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/523805?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 06:54:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0971b1f9-ee8d-49b4-8b6c-19b9767a1b59</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Aravind, sorry for late response.&lt;/p&gt;
&lt;p&gt;Either this is a brownout reset or a software reset. A software reset is trackable.&lt;/p&gt;
&lt;p&gt;put a breakpoint in&amp;nbsp;zephyr\lib\os\reboot.c-&amp;gt;sys_reboot function and recompile your project enabling debug_optimizations as compiler flag and start the debugger and run the code. When the breakpoint hits, look at the function call trace and post it here. We will get a full context of the reset then and we can go from there to attempt to solve it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/523504?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2025 13:04:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:431a7487-9932-46cb-847f-c1f775b5fa76</guid><dc:creator>Aravibala</dc:creator><description>&lt;p&gt;hi Susheel, thank you for the reply i tried using the configs you suggested, and i could visualize the stack usage and i guess the issue is not due to stack over flow, since mostly 50 to 70 percent of the stack is unused. I guess the issue is due to the scan attempts as you told. i tried to add the scan_stop function before starting the scan_start function with a delay&amp;nbsp; 200ms however, the issue is not solved and it can be clearly noticed that the reset happens during the execution of the scan_start function. is there any way we can identify the exact cause further.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1739883678881v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 5340 resets automatically in between  device scanning</title><link>https://devzone.nordicsemi.com/thread/523264?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2025 13:04:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d31c7115-81fe-44ac-a534-fd5826eaf003</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Aravind, I think I have seen before, just do not remember the whole context but I remember that it had to do with the multiple attempts of scanning while the scanner is still on. Try to stop the scanner before you start it (if the bt_scan_stop returns error, it is normal, you do not need to handle the error). Do something like bt_scan_stop, wait few milliseconds and scan_start again.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The other reason I can think of is that you might be seeing a side effect of stack overflow, Make sure that all your contexts have enough stack memory allocated&amp;nbsp;&amp;nbsp;&lt;br /&gt;Some of the configs that are generally useful to enable in prj.conf for such debugging is mentioned &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82034/how-to-monitor-the-size-of-a-thread-stack-in-ncs"&gt;here&lt;/a&gt;. Enable those and pristine build your project, flash and see what you see on the serial logs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>