<?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>Question in &amp;quot;on_connect&amp;quot; in a BLE app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106241/question-in-on_connect-in-a-ble-app</link><description>Hi! 
 I don&amp;#39;t have a problem, I just have a doubt about the &amp;quot;on_connect&amp;quot; function. I opened the UART example from: 
 nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_uart\pca10040\s132\ses 
 
 In this project, it&amp;#39;s used the &amp;quot;on_connect&amp;quot; function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Dec 2023 14:34:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106241/question-in-on_connect-in-a-ble-app" /><item><title>RE: Question in "on_connect" in a BLE app</title><link>https://devzone.nordicsemi.com/thread/459394?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2023 14:34:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae19871b-ab21-49ae-bd7a-6c7639e4afd1</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi Bernat,&lt;/p&gt;
&lt;p&gt;We are still supporting NRF5 in the maintenance mode and it depends on your application, choices and decisions to chose bare-metal (nrf5) or RTOS (ncs) solutions.&lt;/p&gt;
&lt;p&gt;One solution might not be optimized for all customers. It all depends on individual projects and how they are looking forward and what features do they require.&lt;/p&gt;
&lt;p&gt;From Nordic&amp;#39;s pov, shifting to Zephyr RTOS based SDK (NCS) was a big decision. NCS was launched in 2018, and for sure Nordic is committed to NCS. You can see very active development and feature support in NCS.&lt;/p&gt;
&lt;p&gt;Please see NCS and NRF5 statement from Nordic:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;SDK Statement&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You will see table comparing features, and different questions / concerns answered.&lt;/p&gt;
&lt;p&gt;Please also look at this blog by Tiago:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/debunking-misconceptions-a-technical-analysis-of-nrf5-sdk-and-nrf-connect-sdk"&gt;Technical Analysis of NRF5 and NCS&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You might also look at this question regarding nrf5 and ncs:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/support-private/support/288643"&gt;Question about Nrf5 and NCS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With regards,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question in "on_connect" in a BLE app</title><link>https://devzone.nordicsemi.com/thread/459064?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 18:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53850a7c-3243-4277-80d9-ef10cd36a252</guid><dc:creator>Bernat</dc:creator><description>&lt;p&gt;Hi Naeem,&lt;/p&gt;
&lt;p&gt;Thanks for your response.&amp;nbsp;Oh I see, I never saw a pointer used this way, instead of storing an address it&amp;#39;s directly holding the number...&amp;nbsp;It&amp;#39;s weird because&amp;nbsp;the&amp;nbsp;p_context&amp;nbsp;is defined as a &amp;quot;void *&amp;quot;, whose&amp;nbsp;bit width is dependent on the platform, but in a 32 bit microcontroller it&amp;#39;s usually 32 bit, so I see the concept a bit wrong but it&amp;#39;s OK&lt;/p&gt;
&lt;p&gt;About the platform. I use a nRF52832, and I don&amp;#39;t plan to move to a more powerful microcontroller. My firmware is quite simple, and I use a very small battery, so the time it&amp;#39;s in sleep state is important, what means each clock counts and I prefer to prioritize the performance&amp;nbsp;rather than modularity. I see the nRF Connect SDK uses a RTOS, which in my case is totally unnecessary. Do you have some performance comparison to see the overhead the nRF Connect SDK is adding? I could migrate it now that it&amp;#39;s in the initial stage if the performance is not&amp;nbsp;worsened too much.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question in "on_connect" in a BLE app</title><link>https://devzone.nordicsemi.com/thread/458764?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 14:38:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:882b50ce-96d2-4fcd-99dd-1255b3588920</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi Bernat,&lt;/p&gt;
&lt;p&gt;As you have pointed to the code:&lt;/p&gt;
&lt;p&gt;The function &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;conn_params_negotiation()&lt;/span&gt;&amp;nbsp;takes a number &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;conn_handle&lt;/span&gt;&amp;nbsp;as an input argument. It then passes this number (&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;conn_handle&lt;/span&gt;) as a pointer (not the address of the number, but rather the number itself) to the &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;app_timer_start()&lt;/span&gt;&amp;nbsp;function.&lt;br /&gt;The function &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;app_timer_start()&lt;/span&gt;&amp;nbsp;has the following prototype:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;ret_code_t app_timer_start(app_timer_id_t timer_id, uint32_t timeout_ticks, void * p_context);&lt;/pre&gt;&lt;br /&gt;the parameter &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;p_context&lt;/span&gt; will be passed to the &lt;strong&gt;time-out-handler&lt;/strong&gt;&lt;br /&gt;When we look at the timeout handler function (&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;update_timeout_handler()&amp;nbsp;&lt;/span&gt;), we see that the pointer &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;p_context&lt;/span&gt; is not dereferenced, but just type casted and stored as a value.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t conn_handle = (uint32_t)p_context;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This could have been an implementation choice as the &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;conn_handle&lt;/span&gt; is just a number and does not contain big data stored as a structure.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding the SDK, please go through Nordic&amp;#39;s &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;NCS and NRF5 statement&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please also note that&amp;nbsp;Nordic is&amp;nbsp;&lt;span&gt;still supporting the nRF5 SDK in&amp;nbsp;&lt;/span&gt;&lt;strong&gt;maintenance mode&lt;/strong&gt;&lt;span&gt;. This means that bug fixes and security updates will be available as needed. However,&amp;nbsp;&lt;/span&gt;&lt;strong&gt;support for new features beyond Bluetooth&amp;nbsp;LE 5 will not be added to the nRF5 SDK&lt;/strong&gt;&lt;span&gt;. For instance, Bluetooth Direction Finding, Bluetooth LE Audio, and so forth are not supported and will not be supported in the nRF5 SDK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If your project is not bound to use the nRF5 SDK, we highly recommend to you (and all other customers) to use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html"&gt;latest version of Nordic&amp;#39;s Connect SDK&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Nordic&amp;#39;s Educational Resources are based on NCS and we offer free courses with certificates on our DevAcademy which only is relevant to the NCS based designs.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Getting started with NCS is pretty easy, I bed you will be running samples like &amp;quot;blinky&amp;quot; or &amp;quot;hello_world&amp;quot; within minutes:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-1-nrf-connect-sdk-introduction/topic/exercise-1-1/"&gt;Getting Started: Installing NCS and VSCode&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;/BR, Naeem&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question in "on_connect" in a BLE app</title><link>https://devzone.nordicsemi.com/thread/458706?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 11:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f071b9b-5418-4929-b4f9-2a8f8f6d88f1</guid><dc:creator>Bernat</dc:creator><description>&lt;p&gt;Hi Naeem!&lt;/p&gt;
&lt;p&gt;I thought I was using the last one. If I go to the nRF5-SDK download site, I see the last one is the 17.1.0, which is the one I&amp;#39;m using (you can check this in the path I showed in my initial post: &lt;span&gt;nRF5_SDK_17.1.0_ddde560).&amp;nbsp;&lt;/span&gt;Is that wrong?&lt;/p&gt;
&lt;p&gt;Thanks!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question in "on_connect" in a BLE app</title><link>https://devzone.nordicsemi.com/thread/458671?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 08:40:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:975b3b2b-8aad-4962-bec2-66013eddaa6c</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for contacting DevZone at NordicSemi.&lt;/p&gt;
&lt;p&gt;I will have a look at this code and will come back.&lt;/p&gt;
&lt;p&gt;However,&amp;nbsp;we recommend our customers to use the latest version of &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html"&gt;Nordic Connect SDK (NCS)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;/BR, Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>