<?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>Crash at disconnect + RTT Viewer weird behavior</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67793/crash-at-disconnect-rtt-viewer-weird-behavior</link><description>Hello guys, 
 I am new in the BLE world. 
 I am currently using a BLE Android application running on a tablet + nrf52832 communication with another chip through UART. 
 I have this weird bug when I try to disconnect the connection from the tablet the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Nov 2020 08:51:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67793/crash-at-disconnect-rtt-viewer-weird-behavior" /><item><title>RE: Crash at disconnect + RTT Viewer weird behavior</title><link>https://devzone.nordicsemi.com/thread/278375?ContentTypeID=1</link><pubDate>Wed, 04 Nov 2020 08:51:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a30beb7d-5dd2-4ad3-8974-ddab162eb380</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The PM_EVT_CONN_SEC_FAILED event signals the application that a bonding or link encryption procedure has failed, but you have to check the event data (error code) to find the reason for the failure. Is&amp;nbsp;PM_LOG_ENABLED set to &amp;#39;1&amp;#39; in your project? That should make the PM log the error code like this:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;lt;info&amp;gt; peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Encryption, error: 4102&lt;/p&gt;
&lt;p&gt;Also, I don&amp;#39;t think it&amp;#39;s related to the failure, but&amp;nbsp; .io_caps should be set BLE_GAP_IO_CAPS_NONE when you are not setting the &amp;#39;mitm&amp;#39; flag.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Crash at disconnect + RTT Viewer weird behavior</title><link>https://devzone.nordicsemi.com/thread/278216?ContentTypeID=1</link><pubDate>Tue, 03 Nov 2020 09:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a94b81a-b6bb-4851-b0c7-91be9af64f69</guid><dc:creator>genzy9</dc:creator><description>&lt;p&gt;You right. I just put a flag to true when DISCONNECT event is received&amp;nbsp;and it will be handle in my main loop, seems to work for now, we will investigate later.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But the problem might be on our UART so not sure it&amp;#39;s all related to the nrf52 chip.&lt;/p&gt;
&lt;p&gt;Yes I did not change the default behavior. I am fine with rebooting in case of an error.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s consider the previous issue as solved for now.&lt;/p&gt;
&lt;p&gt;Could you help me to solve the PM_EVT_CONN_SEC_FAILED ? What does it mean?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I set no security settings from Android side (all default) and from the nrf chip in the pm :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // Security parameters to be used for all security procedures.
    sec_param.bond           = SEC_PARAM_BOND;
    sec_param.mitm           = 0;
    sec_param.io_caps        = BLE_GAP_IO_CAPS_DISPLAY_ONLY;
    sec_param.oob            = 0;
    sec_param.min_key_size   = 7;
    sec_param.max_key_size   = 16;
    sec_param.kdist_own.enc  = 1;
    sec_param.kdist_own.id   = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id  = 1;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Crash at disconnect + RTT Viewer weird behavior</title><link>https://devzone.nordicsemi.com/thread/278068?ContentTypeID=1</link><pubDate>Mon, 02 Nov 2020 12:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7938c17-3343-47a4-8f16-efaa20e9a1c4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s generally good practice to keep the processing time inside interrupts short, but I&amp;#39;m not sure how it relates to the crash you mentioned. It&amp;#39;s also a bit strange that it seems to work ok as long as you are debug mode (note: chip enters debug mode when you start viewing RTT messages). Have you kept the default error handling in your app (see &lt;span&gt;&lt;a title="Error module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_error.html?cp=7_1_3_13"&gt;Error module&lt;/a&gt;&lt;/span&gt;)? This is usually the only place where the app may trigger a reboot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>