<?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>Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76686/inconsistent-behavior-when-debugging</link><description>I&amp;#39;m not even exactly sure how to describe this problem, so please bear with me. I have a setup with two nRF52840s, one of them (call it B) functions as a peripheral server with two available connections, one for phone/host, one for the other unit, and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Jun 2021 19:57:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76686/inconsistent-behavior-when-debugging" /><item><title>RE: Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/thread/317803?ContentTypeID=1</link><pubDate>Tue, 29 Jun 2021 19:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66cecaf2-35b4-42d9-be60-4a0ef4a426ef</guid><dc:creator>SmallerPond</dc:creator><description>&lt;p&gt;I never had a need to make a new ticket because we (I think) found the problem.&amp;nbsp; For the sake of posterity:&lt;/p&gt;
&lt;p&gt;We have an external 3V3 that supplies an audio amp that requires enough power that it sometimes pulls the battery voltage down.&amp;nbsp; This was causing the reset, but it was also causing the 3v3 regulator to go into boost mode.&amp;nbsp; Then the battery would quickly rebound and the regulator would take a moment to switch back to buck mode.&amp;nbsp; In the meantime it would cause a voltage spike over nRF52840 VDDH spec, which in turn must have done something to sometimes irrevocably latch the antenna into low power mode.&amp;nbsp; Since it only happens rarely, it was very difficult to find.&lt;/p&gt;
&lt;p&gt;Thanks again for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/thread/317257?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 13:38:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e80623c8-10c5-4cdc-b1a6-17c2d6530f81</guid><dc:creator>SmallerPond</dc:creator><description>&lt;p&gt;Will do - thanks again Vidar!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/thread/317246?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 12:51:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26d35fd8-f5c2-4e13-b178-6eb6d1204cf6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for confirming. Because this is sounding more like a HW issue&amp;nbsp; I think it&amp;#39;s better if you create a new ticket. My more HW oriented colleagues can give better advice when it comes to troubleshooting of poor radio performance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/thread/317231?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 12:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06ee3380-3b47-4a00-80e8-684857b5b452</guid><dc:creator>SmallerPond</dc:creator><description>&lt;p&gt;Thanks Vidar!&amp;nbsp; The 2cm behavior seems to persist forever with the device, regardless of what we do to it.&amp;nbsp; Even if I erase the device and just run ble_app_blinky, we get the same behavior.&amp;nbsp; And yes they only work within 2cm even after pairing - if I move them apart they lose connection and start advertising again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/thread/317160?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 09:02:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06b050ae-fcd4-4bc4-afeb-0fb79fd35424</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the update. Good to hear that you found the problem. To read the RESETREAS register after the reset you must first tell the debugger to re-connect because it doesn&amp;#39;t know that the connection has been lost. You can use nrfjprog for this.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reading RESETREAS register after reset&lt;/strong&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;nrfjprog --memrd 0x40000400 // Should return 0x0 if you encountered a brownout reset&lt;/p&gt;
&lt;p&gt;With regards to your follow up question, do I understand it correctly that you achieve a more normal range as soon as you have managed to establish the connection and completed the pairing, or do you still have to keep them 2cm apart? I can&amp;#39;t say I have seen that before. Are there any additional noise sources during this phase like high speed bus communication (SPI, UART, PWM, etc) that could possibly interfere with the RADIO?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/thread/317096?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 01:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99d979d5-9da6-48ee-8f52-bc761647801b</guid><dc:creator>SmallerPond</dc:creator><description>&lt;p&gt;Thank you, this ended up pretty much getting me there.&amp;nbsp; We definitely ran into a voltage drop when the hardware was playing audio (amplifier IC draws around 2.5W) that must have been causing the debugger to drop the connection and the system to reset.&amp;nbsp; I will say though that I was never able to check RESETREAS for this, all the registers always came up as 0xAAAAAAAA and 0xDEADBEEF for the CPU regs when I would try to connect after reset.&amp;nbsp; I suspect that the J-Link is having trouble reconnecting to the unit after the voltage drop event for some reason.&lt;/p&gt;
&lt;p&gt;Which brings me to a follow-up question that I am happy to put in its own thread if you like.&amp;nbsp; We have a handful of devices (I think 6 or 8 of them now) that acted funny, and now function perfectly well, except that they only connect and pair to other devices if they are literally less than about 2cm apart, otherwise they do not connect at all.&amp;nbsp; Everything else functions as expected and erasing them doesn&amp;#39;t seem to have any effect.&amp;nbsp; Have you ever seen this before?&amp;nbsp; My guess is that they were subject to this voltage drop condition at some point and it somehow affected only that part of the device that supplies power to the antenna?&amp;nbsp; Is this possible?&amp;nbsp; It seems weird because I would be okay with the idea if it was a voltage spike (up), but a voltage sag/drop seems like it shouldn&amp;#39;t have such an effect.&amp;nbsp; Yet it seems to be somewhat repeatable for us.&amp;nbsp; I think with a little work, I could maybe adapt a firmware that breaks nRF52840s in this manner.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent behavior when debugging</title><link>https://devzone.nordicsemi.com/thread/316979?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 12:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c91477f-c9ce-4358-be2d-99398b16858a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m afraid I can&amp;#39;t think of any good explanations as to why the devices would behave differently depending on where you placed the breakpoints. It&amp;#39;s also uncommon to loose the debugger connection to the nRF device unless there is a HW problem (drop in supply voltage, bad connection, etc). For memory corruption bugs I&amp;#39;d usually expect to see either a hardfault exception, or worst case, a CPU lockup reset (you should have gotten the vector catch in that case).&lt;/p&gt;
&lt;p&gt;If you haven&amp;#39;t already, I would suggest that you try to monitor the &lt;span&gt;&lt;a title="RESETREAS" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=4_0_0_4_2_6_10#register.RESETREAS"&gt;RESETREAS&lt;/a&gt;&lt;/span&gt; register on boot to figure out what the reset source is.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>