<?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>Connection hangs/drops randomly without triggering callback</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111135/connection-hangs-drops-randomly-without-triggering-callback</link><description>Hello and thanks for reading. 
 I have a critical problem with my device, and seeing as the problem is BLE related I figured I would ask your help as well. We are using the NRF5340 as a peripheral. There are two operating modes; in one, the peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 May 2024 13:38:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111135/connection-hangs-drops-randomly-without-triggering-callback" /><item><title>RE: Connection hangs/drops randomly without triggering callback</title><link>https://devzone.nordicsemi.com/thread/485438?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 13:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b70d42f-583b-48bd-a1e7-c2117242b9f7</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for all your help. I will open new tickets for the other issues.&lt;/p&gt;
&lt;p&gt;The main reason I suggest making the clock config carry over implicitly is that its a huge trap for new programmers that creates a weird and hard-to-replicate bug. I fully understand that multi-image development is challenging and complicated in many weird and wonderful ways.&lt;/p&gt;
&lt;p&gt;Thanks for your consideration!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection hangs/drops randomly without triggering callback</title><link>https://devzone.nordicsemi.com/thread/485299?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 07:26:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a914632-6592-44cd-8b2f-f50cddb1746c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Sorry about the late reply here, but we&amp;#39;ve had a few bank holidays in Norway.&lt;/p&gt;
[quote user="i_4556"]maybe NRF should consider revising this in a future version?[/quote]
&lt;p&gt;This is noted and I&amp;#39;ll put up a feature request internally on this. The problem is it is two separate images where this must be set which is why it&amp;#39;s needed twice as of now I believe. Yes, you should also set this in the MCUBoot image config IIRC.&lt;/p&gt;
&lt;p&gt;For the crystal load capacitors we recommend following the following formula where CL is the load capacitance in the crystal datasheet and Ccap is what the optimal capacitor value in our designs would be:&amp;nbsp;&lt;strong&gt;Ccap = 2 * CL - 4pF&lt;/strong&gt;. Removing them to use the internal caps should be perfectly fine, and the settings seem correct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your other questions are not really related to the initial ticket, so I&amp;#39;d recommend you create separate tickets for the other questions. If the initial issue reappears it will be easier to follow up in this case if we don&amp;#39;t have multiple topics ongoing at the same time. Most peripheral samples support connecting to multiple devices, but in order to connect to multiple at the same time you need to make sure it starts advertising again after connecting to a central.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection hangs/drops randomly without triggering callback</title><link>https://devzone.nordicsemi.com/thread/484823?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 14:03:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44541bd4-b593-47ce-87d7-924c2af14c06</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello and thank you for your reply. I am a little surprised that I need to set the clock config twice, in both the app and net cores; this feels like a recipe for mistakes and a landmine for new developers; maybe NRF should consider revising this in a future version? I assume I should also make the same change in my MCUBoot confing too then?&lt;/p&gt;
&lt;p&gt;Our oscillator is this one: &lt;a id="" href="https://www.mouser.ca/datasheet/2/122/ECX-1048-1115630.pdf"&gt;https://www.mouser.ca/datasheet/2/122/ECX-1048-1115630.pdf&lt;/a&gt; for which we have added a set of 10pF ceramic caps. I am not the hardware developer, so I cant really comment on how they were chosen. I know the hardware dev. is threatening to remove them to save space and instead use the internal caps on the NRF; in that case I would need to make the following changes right:&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_SOC_HFXO_CAP_EXTERNAL&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_SOC_HFXO_CAP_INTERNAL&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#9cdcfe;"&gt;SOC_HFXO_CAP_INT_VALUE_X2&lt;/span&gt;=20&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Per your suggestions, I have rolled back the change to the CONFIG_RESET_ON_FATAL_ERROR, and everything is still working. We have done more tests, including one overnight, and everything seems to be working.&lt;/p&gt;
&lt;p&gt;Thank you for all your help. While you are here, if you dont mind, do you have an example for configuring a peripheral to accept multiple central connections? We need our device to accept to simultaneous centrals.&lt;/p&gt;
&lt;p&gt;Also, I seem to be getting some incorrect performance from the flash memory with NVS, in that NVS needs to be primed or something before it works properly. I have been testing with this code:&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;void&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;Prime_Flash&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#7ca668;"&gt;&amp;nbsp; &amp;nbsp; //now prime the file system, ive no idea why we need this but it works...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;const&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;float&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; test_value &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0xDEADBEEF&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;span style="color:#7ca668;"&gt; //random number, doesnt actually matter&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;float&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; read_value &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;int&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; i &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#c586c0;"&gt;while&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; ((i &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;25&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;) &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; (test_value &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;!=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; read_value))&lt;/span&gt;&lt;span style="color:#7ca668;"&gt; //usually takes 12 tries&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;NUS_Send&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;Write %u %i &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;, i, &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nvs_write&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;fs, TEST_REGISTER_ID, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;test_value, &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;sizeof&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(test_value)));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#7ca668;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // nvs_write(&amp;amp;fs, TEST_REGISTER_ID, &amp;amp;test_value, sizeof(test_value));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;k_msleep&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;10&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;NUS_Send&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;Read %u %i &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;, i, &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nvs_read&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;fs, TEST_REGISTER_ID, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;read_value, &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;sizeof&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(read_value)));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#7ca668;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // nvs_read(&amp;amp;fs, TEST_REGISTER_ID, &amp;amp;read_value, sizeof(read_value));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;k_msleep&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;10&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; i&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;++&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;NUS_Send&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;Flash ready took %i tries &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;,i);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And I get the following results:&lt;/p&gt;
&lt;p&gt;Write 0 4&lt;br /&gt;Read 0 -2&lt;br /&gt;Write 1 4&lt;br /&gt;Read 1 -2&lt;br /&gt;Write 2 4&lt;br /&gt;Read 2 -2&lt;br /&gt;Write 3 4&lt;br /&gt;Read 3 -2&lt;br /&gt;Write 4 4&lt;br /&gt;Read 4 -2&lt;br /&gt;Write 5 4&lt;br /&gt;Read 5 -2&lt;br /&gt;Write 6 4&lt;br /&gt;Read 6 4&lt;br /&gt;Write 7 4&lt;br /&gt;Read 7 4&lt;br /&gt;Write 8 4&lt;br /&gt;Read 8 4&lt;br /&gt;Write 9 4&lt;br /&gt;Read 9 4&lt;br /&gt;Write 10 4&lt;br /&gt;Read 10 4&lt;br /&gt;Write 11 4&lt;br /&gt;Read 11 4&lt;br /&gt;Write 12 4&lt;br /&gt;Read 12 4&lt;br /&gt;Flash ready took 13 tries&lt;/p&gt;
&lt;p&gt;This happens consistently, where it takes 13 tries before the flash can be used properly. As near as I can tell, once we get that Flash ready then everything works fine until the next reset.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I initialize the flash with:&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;void&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;Initialise_Flash&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#7ca668;"&gt;&amp;nbsp; &amp;nbsp; //prepare flash memory&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;flash_device&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; NVS_PARTITION_DEVICE;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#c586c0;"&gt;if&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; (&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;!&lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;device_is_ready&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;flash_device&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;)) &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;printk&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;Flash device %s is not ready&lt;/span&gt;&lt;span style="color:#569cd6;"&gt;\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;flash_device&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;name&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;offset&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; NVS_PARTITION_OFFSET;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;flash_get_page_info_by_offs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;flash_device&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;offset&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;, &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;info);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;sector_size&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;info&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;size&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;fs&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;.&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;sector_count&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#ffffff;"&gt; FLASH_SECTOR_COUNT;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nvs_mount&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;fs);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ffffff;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And it seems to work, I get the message&lt;/p&gt;
&lt;p&gt;I: 2 Sectors of 4096 bytes&lt;br /&gt;I: alloc wra: 0, f40&lt;br /&gt;I: data wra: 0, 54&lt;/p&gt;
&lt;p&gt;I doubt this is the expected behavior; do you have any suggestions what I am doing wrong?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection hangs/drops randomly without triggering callback</title><link>https://devzone.nordicsemi.com/thread/483386?ContentTypeID=1</link><pubDate>Wed, 15 May 2024 06:17:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb79a1bb-5594-494a-9a78-ec923dc7930b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Glad to hear you might have fixed the issue. My guess is setting HFXO_CAP_EXTERNAL=y in both cores is what has fixed this, as without it the network cores might have drifted which would explain the issue occurring not right away but after a while (4-5 minutes). You should still do more testing and over longer periods than just 5 minutes. What are the external capacitor values set to the HF crystal you&amp;#39;re using, and can you upload the HF crystal datasheet so I can double check that the capacitor values make sense?&lt;/p&gt;
&lt;p&gt;Also, the&amp;nbsp;&lt;span&gt;CONFIG_RESET_ON_FATAL_ERROR&lt;/span&gt;&lt;span&gt;=n should only be used for debugging, as if the device runs into a fatal error it will stop entirely and not reset and try to get back up and running. When this is set, you can debug and see where the device gets stuck, but it&amp;#39;s not recommended to be used in release products.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As for the watchdog, you should see a watchdog reset occur if the watchdog is triggered. The default value for it is not ~4 minutes if I recall correctly, so I think that is a dead end.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let me know how your testing goes, and if it still persists I&amp;#39;ll do a proper review of the sniffer trace as well.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection hangs/drops randomly without triggering callback</title><link>https://devzone.nordicsemi.com/thread/483329?ContentTypeID=1</link><pubDate>Tue, 14 May 2024 14:41:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1eb3f503-b54f-489e-bc49-ecb3e4aac920</guid><dc:creator>i_4556</dc:creator><description>&lt;p&gt;Hello and thank you for your answer. I am testing with the dev board now.&lt;/p&gt;
&lt;p&gt;In the meantime, a thought occurred to me; I am not using the watchdog timer, in either the network or main core. Are they disabled by default, or do I need to manually disable them?&lt;/p&gt;
&lt;p&gt;When the problem occurs, it does seem to happen around the 4 minute mark, and I am wondering if there is something significant about that timeframe.&lt;/p&gt;
&lt;p&gt;I have also tested powering the device from USB rather than battery, and the problem persists, so I dont think the problem is related to a weak battery.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT: I have tested with the sniffer, please find the file attached. Skip to packet 35876, that is the last good packet. It really looks like the network core just stops suddenly for some reason... It never stops/disconnects either, even twenty minutes later my application core still thinks it has a good connection...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf5340_5F00_netwrok_5F00_error.pcapng"&gt;devzone.nordicsemi.com/.../nrf5340_5F00_netwrok_5F00_error.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT2: I may have gotten it working, in that in ten 5 minute tests I have experienced zero errors. Unfortunatly I made a bunch of changes so I dont know what did it, but heres what I did:&lt;/p&gt;
&lt;p&gt;1) Homogenized the clock configs in both the main and network core, they now both contain&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_SOC_HFXO_CAP_EXTERNAL&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_SOC_HFXO_CAP_INTERNAL&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;2) Added the following magic line of code to the network core config&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_RESET_ON_FATAL_ERROR&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;=n&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;3) Removed the ability to have multiple centrals connect to my peripheral. for now we arent using this feature, so not a huge deal. In my network core config I commented out&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#7ca668;"&gt;# CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=3&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;4) Removed the ability to store pairing information. I do need to add this feature back in at some point, but for now in my disconnect callback I have&lt;/p&gt;
&lt;div style="background-color:#000000;color:#ffffff;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#dcdcaa;"&gt;bt_unpair&lt;/span&gt;&lt;span style="color:#ffffff;"&gt;(BT_ID_DEFAULT, BT_ADDR_LE_ANY);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Does any of this make sense, could any of this plausibly be the problem?&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: Connection hangs/drops randomly without triggering callback</title><link>https://devzone.nordicsemi.com/thread/483271?ContentTypeID=1</link><pubDate>Tue, 14 May 2024 12:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb93bfb2-cc51-4454-a99b-799c8fd8b5aa</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This issue seems very strange to be honest, and I don&amp;#39;t really have some working theories of what this could be caused by based on this description. Are you also able to reproduce this with an nRF5340 DK running this application? It would also be helpful to see a&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE"&gt; sniffer trace&lt;/a&gt; so we can get some info of what&amp;#39;s happening over-the-air. The clock configuration looks okay to me, but it does seem like the radio on the nRF5340 side stops transmitting all of a sudden. Does a disconnect occur eventually, when the connection times out with the central device?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>