<?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 BLE disconnections and occasional system hang on nRF52832 using bare-metal SDK (external RTC used)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126346/random-ble-disconnections-and-occasional-system-hang-on-nrf52832-using-bare-metal-sdk-external-rtc-used</link><description>We are facing an intermittent issue on an nRF52832–based product using bare-metal Nordic nRF5 SDK (non-NCS, non-Zephyr) BLE implementation. 
 Observed behavior: 
 BLE initializes correctly; advertising and connection establishment work as expected 
 Communication</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Jan 2026 08:12:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126346/random-ble-disconnections-and-occasional-system-hang-on-nrf52832-using-bare-metal-sdk-external-rtc-used" /><item><title>RE: Random BLE disconnections and occasional system hang on nRF52832 using bare-metal SDK (external RTC used)</title><link>https://devzone.nordicsemi.com/thread/558230?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 08:12:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c9a12f2-1ce0-48de-b6b0-0b710c47d32b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Ramesh Polasa"]I can share the application logs if that helps.[/quote]
&lt;p&gt;Yes, that will be very usefull. The Android devices sees a timeout, but that can be caused by a number of things. If there was a SoftDevice assert, or another unhandled error on the nRF side, that would terminate the link immediately, that would&amp;nbsp;cause a timeout (disconnect reason 0x8) on the Android side.&lt;/p&gt;
&lt;p&gt;There are also a number of other potential causes, such as inaccurate sleep clock, so it could be interesting to know your exact 32.768 kHz crystal and which load caps you have used. Though I would expect you should see problems more often if that was the rase.&lt;/p&gt;
[quote user="Ramesh Polasa"]What would you recommend as the next steps to narrow this down?[/quote]
&lt;p&gt;Primarily I would start by error logging on the nRF, so that we can see if there are errors or asserts, or unexpected resets. A sniffer trace is also useful, this could&amp;nbsp;show if the nRF simply stops responding (as would be the case of an error), or if the problem could be on the Android side.&lt;/p&gt;
[quote user="Ramesh Polasa"]What is the recommended way to capture callstack and register data if a HardFault or SoftDevice assert ever does occur? I’d like to add a simple blackbox-style capture so I can get the fault context even if the device freezes during long-term operation.[/quote]
&lt;p&gt;In case of SoftDevice assert, log the PC of the assert that is passed to the error handler (see&amp;nbsp;&lt;span&gt;app_error_fault_handler() implementation&lt;/span&gt;). With this and the exact SoftDevice version I can look up which assert this was in the SoftDevice. For Hardfaults I would start with enabling the &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_hardfault.html"&gt;HardFault handling library &lt;/a&gt;as you have logging. This will then print information about the error in the log. Enable this by setting&amp;nbsp;HARDFAULT_HANDLER_ENABLED to 1 in your sdk_config.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Random BLE disconnections and occasional system hang on nRF52832 using bare-metal SDK (external RTC used)</title><link>https://devzone.nordicsemi.com/thread/558225?ContentTypeID=1</link><pubDate>Thu, 08 Jan 2026 07:38:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ce685eb-61be-4f74-8b9a-83408866ac55</guid><dc:creator>Ramesh Polasa</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1362.NRF_5F00_LOG.txt"&gt;devzone.nordicsemi.com/.../1362.NRF_5F00_LOG.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Log-2026_2D00_01_2D00_02-14_5F00_47_5F00_57.txt"&gt;devzone.nordicsemi.com/.../Log-2026_2D00_01_2D00_02-14_5F00_47_5F00_57.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks for the explanation.&lt;/p&gt;
&lt;p&gt;I have NRF logs (RTT-based) when the device is running under a debugger, but the issue is that it never hangs in that setup. The random disconnects and the occasional freeze only happen during long standalone runs, so I haven&amp;rsquo;t been able to capture a SoftDevice assert or a HardFault in the moment. The logs look normal right up to the disconnect.&lt;/p&gt;
&lt;p&gt;About bonding: I did see the phone removing the bond on the Android side, but even when bonding isn&amp;rsquo;t involved, we still get &amp;ldquo;Error 8 (0x8): GATT CONN TIMEOUT.&amp;rdquo; In some long runs the device stops responding completely. It stops advertising and stops producing any logs, so it seems like something deeper than just bonding.&lt;/p&gt;
&lt;p&gt;I can share the application logs if that helps.&lt;/p&gt;
&lt;p&gt;What would you recommend as the next steps to narrow this down?&lt;br /&gt; Should I:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enable full PM event logging&lt;/li&gt;
&lt;li&gt;Capture a sniffer trace (and if so, what should I focus on)&lt;/li&gt;
&lt;li&gt;Add more SoftDevice and reset-reason logging&lt;/li&gt;
&lt;li&gt;Monitor radio notifications for possible missed events&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, one more question:&lt;br /&gt; What is the recommended way to capture callstack and register data if a HardFault or SoftDevice assert ever does occur? I&amp;rsquo;d like to add a simple blackbox-style capture so I can get the fault context even if the device freezes during long-term operation.&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: Random BLE disconnections and occasional system hang on nRF52832 using bare-metal SDK (external RTC used)</title><link>https://devzone.nordicsemi.com/thread/557933?ContentTypeID=1</link><pubDate>Mon, 05 Jan 2026 13:41:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0812e8f5-a105-49f9-bfe1-e35a5f125958</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You write that internal RTC is not used by the application, but it is used by the SoftDevice (which always use RTC0). Regarding the use of external RTC I do not immediately see how that could be relevant (given that it is anyway not used by the SoftDevice).&lt;/p&gt;
&lt;p&gt;Blocking the SoftDevice for too long can be problematic so critical sections should be short, and you should not use higher interrupt priorities for the application. See &lt;a href="https://docs.nordicsemi.com/bundle/sds_s132/page/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html"&gt;Interrupt priority levels&lt;/a&gt;. If this cause a problem, the SoftDvice will assert. Note that there is no way to recover from a SoftDevice assert, so you need to reset after that (but should log the assert, and create a support ticket with the assert address if you need more information about it).&lt;/p&gt;
&lt;p&gt;I do not believe this is the reason for the issue, though. Do you have logs from the nRF? The&amp;nbsp;Android log you have posted indicate that the bonding data is deleted on he phone side, and in that case, the nRF will by default not accept pairing again. If this is the problem, that can be resolved by allowing re-pairing as shown in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/93434/please-tell-me-how-to-achieve-re-pairing/393927"&gt;this post&lt;/a&gt;&amp;nbsp;with the handling of the &lt;code&gt;PM_EVT_CONN_SEC_CONFIG_REQ&lt;/code&gt; event.&lt;/p&gt;
&lt;p&gt;If this is not the problem, it would be interesting with a sniffer trace and potentially also a log from the nRF side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>