<?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>nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119112/nrf5340-dk-ble-code-crashing-while-integration</link><description>Hi, I am facing an issue while integrating BLE with the rest of my code. The code crashes when I try to start BLE outside of main() . 
 Currently, I have placed the BLE initialization at the beginning of main() , and it starts and advertises successfully</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Mar 2025 10:04:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119112/nrf5340-dk-ble-code-crashing-while-integration" /><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/527342?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 10:04:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b91d04c1-2b54-458a-82e6-76b97350471f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user="REDHAT"]I am &amp;nbsp;using &lt;strong&gt;3 UARTs and I2C&lt;/strong&gt;.&amp;nbsp;[/quote][quote user="REDHAT"]Do I need to keep &lt;strong&gt;UART0&lt;/strong&gt; exclusively for logs in both the &lt;strong&gt;Application&lt;/strong&gt; and &lt;strong&gt;Network Core&lt;/strong&gt;? If I change this configuration, could it be causing the problem? Also, I am using only &lt;strong&gt;one pin for LOG TX&lt;/strong&gt;.[/quote]
&lt;p&gt;Network core: There is only UART0, there is no UART1&lt;/p&gt;
&lt;p&gt;App core: Have UART0,UART1,UART2,UART3&lt;/p&gt;
&lt;p&gt;If you are using UART0, UART1, UART2 (3x UART), then for I2C you should use i2c3. (since UARTx shares instance with I2Cx, ref &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/memory/appmem.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/memory/appmem.html&lt;/a&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/526138?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2025 11:48:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d6f50aa-7a02-4959-b5f0-c43b044426c7</guid><dc:creator>REDHAT</dc:creator><description>&lt;p data-start="172" data-end="339"&gt;I am &amp;nbsp;using &lt;strong data-start="223" data-end="242"&gt;3 UARTs and I2C&lt;/strong&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p data-start="341" data-end="535"&gt;I would like to understand the relationship between &lt;strong data-start="393" data-end="409"&gt;BLE and UART&lt;/strong&gt; in this scenario. Are there any specific considerations to ensure smooth operation when using multiple UARTs alongside BLE?&lt;/p&gt;
&lt;p data-start="537" data-end="557"&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/526086?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2025 05:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de0684aa-3947-4e71-b9ab-75931d2ec29b</guid><dc:creator>REDHAT</dc:creator><description>&lt;p&gt;Hi waiting for the inputs !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/525860?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 04:49:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa76246c-0bec-490f-927a-0e5efac4e216</guid><dc:creator>REDHAT</dc:creator><description>&lt;p data-start="93" data-end="119"&gt;The issue still remains.&lt;/p&gt;
&lt;p data-start="121" data-end="332"&gt;Do I need to keep &lt;strong data-start="139" data-end="148"&gt;UART0&lt;/strong&gt; exclusively for logs in both the &lt;strong data-start="182" data-end="197"&gt;Application&lt;/strong&gt; and &lt;strong data-start="202" data-end="218"&gt;Network Core&lt;/strong&gt;? If I change this configuration, could it be causing the problem? Also, I am using only &lt;strong data-start="307" data-end="329"&gt;one pin for LOG TX&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-start="334" data-end="393"&gt;Please let me know if you require any additional details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/525670?ContentTypeID=1</link><pubDate>Tue, 04 Mar 2025 09:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b37029d2-b20c-47e4-b3b2-0fee20bb825f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Maybe check that the correct pins are used for uart0 . If you are not using flow control, and only have RX/TX pin, make sure that flow-control is disabled. e.g. like this in an overlay file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart0 {
     /delete-property/ hw-flow-control;
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/525628?ContentTypeID=1</link><pubDate>Tue, 04 Mar 2025 04:30:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee0929d3-dfa9-4e24-b998-bbd048083bc7</guid><dc:creator>REDHAT</dc:creator><description>&lt;p&gt;Hi kindly provide some inputs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/525379?ContentTypeID=1</link><pubDate>Sat, 01 Mar 2025 09:08:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1967fd25-6d36-4853-ad34-a2ad97f9a5ea</guid><dc:creator>REDHAT</dc:creator><description>&lt;p data-start="55" data-end="60"&gt;Hi,&lt;/p&gt;
&lt;p data-start="62" data-end="153"&gt;I have identified the issue causing the crash. The code crashes whenever I use &lt;strong data-start="141" data-end="150"&gt;UART0&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-start="155" data-end="169"&gt;&lt;strong data-start="155" data-end="167"&gt;Details:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-start="170" data-end="489"&gt;
&lt;li data-start="170" data-end="264"&gt;By default, the UART is set to &lt;strong data-start="203" data-end="212"&gt;UART0&lt;/strong&gt;, but I have changed it to &lt;strong data-start="239" data-end="248"&gt;UART2&lt;/strong&gt; to view logs.&lt;/li&gt;
&lt;li data-start="265" data-end="318"&gt;Now, I am using &lt;strong data-start="283" data-end="292"&gt;UART0&lt;/strong&gt; for another peripheral.&lt;/li&gt;
&lt;li data-start="319" data-end="379"&gt;If &lt;strong data-start="324" data-end="333"&gt;UART0&lt;/strong&gt; is &lt;strong data-start="337" data-end="352"&gt;not enabled&lt;/strong&gt;, the code runs smoothly.&lt;/li&gt;
&lt;li data-start="380" data-end="489"&gt;However, if &lt;strong data-start="394" data-end="403"&gt;UART0&lt;/strong&gt; is enabled for another peripheral, the code crashes during the &lt;strong data-start="467" data-end="486"&gt;bonding process&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt; */
 #include &amp;quot;nrf5340_cpuapp_common-pinctrl.dtsi&amp;quot;
 #include &amp;lt;zephyr/dt-bindings/input/input-event-codes.h&amp;gt;
 
 / {
 
	 chosen {
		 zephyr,console = &amp;amp;uart2;
		 zephyr,shell-uart = &amp;amp;uart2;
		 zephyr,uart-mcumgr = &amp;amp;uart2;
		 zephyr,bt-mon-uart = &amp;amp;uart2;
		 zephyr,bt-c2h-uart = &amp;amp;uart2;
		 zephyr,bt-hci-ipc = &amp;amp;ipc0;
		 nordic,802154-spinel-ipc = &amp;amp;ipc0;
		 zephyr,ieee802154 = &amp;amp;ieee802154;
	 };
 &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Kindly help me resolve this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/524046?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 10:03:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3407b03d-3848-4079-925f-5326c0d89fd8</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Are you able to provide a stripped down example that reproduces this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/524026?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 09:00:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8ea1fb0-cf5b-4713-979d-eb0a539e47a8</guid><dc:creator>REDHAT</dc:creator><description>&lt;p&gt;Kindly provide any inputs...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/523858?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 10:21:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4b276fb-c81d-4260-85bc-0f47dc0f3610</guid><dc:creator>REDHAT</dc:creator><description>&lt;p data-start="0" data-end="5"&gt;Hi,&lt;/p&gt;
&lt;p data-start="7" data-end="171"&gt;I am integrating this BLE code with other code, where the logs from the other code run in a separate task. However, I noticed that the logs have stopped printing.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p data-start="233" data-end="472"&gt;In the NRF Connect application, after entering the key, I see the &amp;quot;Delete bond information&amp;quot; option. At the same time, the controller stops printing logs, and I am unable to perform any other operations (such as button input).&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/523847?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 09:51:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15fafb39-7b64-4a9a-bb8e-7e9ed10f4a66</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user="REDHAT"]In the first case, when BLE is initialized outside &lt;code&gt;main()&lt;/code&gt;, the logs stop without any error.[/quote]
&lt;p&gt;What makes you think it &amp;quot;crashes&amp;quot; then ?&lt;/p&gt;
[quote user="REDHAT"]In the second case, during the bonding process, after entering the BLE-generated passcode, the bonding completes on the application side but not on the controller side.[/quote]
&lt;p&gt;What do you mean by &amp;quot;controller&amp;quot; side? Could you explain this some more?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/523839?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 09:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:773bac8e-4ec7-4151-aa5b-b21234824baa</guid><dc:creator>REDHAT</dc:creator><description>&lt;p data-start="0" data-end="5"&gt;Hi,&lt;/p&gt;
&lt;p data-start="7" data-end="91"&gt;I&amp;rsquo;m wondering if I haven&amp;rsquo;t properly configured the heap, stack, or something else.&lt;/p&gt;
&lt;p data-start="93" data-end="162"&gt;My code is relatively large, but it only occupies 20% of the flash.&lt;/p&gt;
&lt;p data-start="164" data-end="265"&gt;Do I need to make any configuration changes? &lt;br /&gt;&lt;br /&gt;Or is there anything I can test to identify the issue?&lt;/p&gt;
&lt;p data-start="267" data-end="295" data-is-last-node="" data-is-only-node=""&gt;Please help me resolve this!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/523801?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 04:34:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95f75b76-a6d3-4e73-af32-450d5f2b9b63</guid><dc:creator>REDHAT</dc:creator><description>&lt;p data-start="66" data-end="75"&gt;&lt;strong data-start="66" data-end="73"&gt;Hi,&lt;/strong&gt;&lt;/p&gt;
&lt;p data-start="77" data-end="172"&gt;In the first case, when BLE is initialized outside &lt;code data-start="128" data-end="136"&gt;main()&lt;/code&gt;, the logs stop without any error.&lt;/p&gt;
&lt;p data-start="174" data-end="392"&gt;In the second case, during the bonding process, after entering the BLE-generated passcode, the bonding completes on the application side but not on the controller side. At this point, the logs stop without any error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 DK BLE code crashing while integration.</title><link>https://devzone.nordicsemi.com/thread/523718?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2025 13:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3172e06b-8041-4004-b1b8-9cd88501985a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""] The code crashes when I try to start BLE outside of &lt;code&gt;main()&lt;/code&gt;.[/quote][quote user=""]Currently, I have placed the BLE initialization at the beginning of &lt;code&gt;main()&lt;/code&gt;, and it starts and advertises successfully. However, the code crashes during the bonding process.[/quote]
&lt;p&gt;So you are seeing 2 different crashes.&lt;/p&gt;
&lt;p&gt;Could you post the crash info for this? Any log output, etc that shows this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>