<?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>nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106815/nrf-connect-sdk-v2-4-2-nrf_dm-sample-adv_start-in-the-callback-assertion-fail</link><description>Dear 
 Env: nRF Connect SDK 2.4.2 / Board: nRF52833DK 
 Sample : nrf_dm 
 I turned off bt_sync_init() and set a callback with reference to the following： 
 
 I put adv_start() in the callback, and when the wake up signal is received, Bluetooth should</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jan 2024 08:18:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106815/nrf-connect-sdk-v2-4-2-nrf_dm-sample-adv_start-in-the-callback-assertion-fail" /><item><title>RE: nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/thread/464309?ContentTypeID=1</link><pubDate>Tue, 16 Jan 2024 08:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab34387c-5b0e-499d-bb18-bd3dc7b74c2c</guid><dc:creator>Gary Kuo</dc:creator><description>&lt;p&gt;Ok, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/thread/464060?ContentTypeID=1</link><pubDate>Sun, 14 Jan 2024 21:58:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77703cef-6736-4131-a88b-7619674e88ea</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;I did not get your point.&lt;/p&gt;
&lt;p&gt;If the issue is different from the main issue of ticket then please open a new ticket with correct title as it helps locating and responding different cases.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/thread/463282?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2024 08:14:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc19eb48-f09d-4779-af33-0d2cd4440e60</guid><dc:creator>Gary Kuo</dc:creator><description>&lt;p&gt;Thanks, it work fine.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also tried to change it to a limited-time scan_start()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;scan_param.&lt;/span&gt;timeout=100).&lt;/p&gt;
&lt;p&gt;It worked normally the first time, but it had no effect the second time, and other key actions were also invalid (LED flashing stops), and there was no other error message.&lt;/p&gt;
&lt;p&gt;What situations might it encounter?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do I need to initiate another Nordic Q&amp;amp;A?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void adv_work_handle(struct k_work *item)
{
	// adv_start();
	scan_start();
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/thread/463183?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 14:40:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc8c52d4-e2ad-48b2-a2c5-8c49b275b19c</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is what I mean:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void button_pressed(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
	printk(&amp;quot;\n&amp;gt;&amp;gt;&amp;gt;&amp;gt; Button PRESSED &amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;quot;);
	
	adv_param = &amp;amp;adv_param_conn;
	k_work_submit(&amp;amp;adv_work);

	//adv_start();
	//advflag = 1;	
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Not calling the adv_start() or setting variable in the button_pressed callback, but rather calling k_work_submit to submit a work item where the task in the work handle is adv_start:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void adv_work_handle(struct k_work *item)
{
	adv_start();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the work handle and work item are defined in the main.c.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;/BR, Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/thread/463046?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 02:45:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f2ad8f6-45a8-435e-ae82-f65610ddc39c</guid><dc:creator>Gary Kuo</dc:creator><description>&lt;p&gt;&lt;span&gt;Thank you for your answer.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I currently still use the advflag method.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Workqueue refers to using k_msgq_put and k_msgq_get ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;ve looked at the ticket you provided, but I want an immediate start rather than a delayed start, which is the opposite of what I want&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/thread/462970?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 16:34:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1587b4f-01e8-49eb-b773-a3783405e7d8</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Apologies for the delayed response.&lt;/p&gt;
&lt;p&gt;Is there any progress at your end?&lt;/p&gt;
&lt;p&gt;I can see what you are having.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Calling adv_start() in the callback leads to CPU panic due to fatal error which points to the semaphore in kernel.&lt;/p&gt;
&lt;p&gt;You might need to do debugging to know what / why it is caused.&lt;/p&gt;
&lt;p&gt;Nonetheless, you can put the function call in the workqueue and it will be processed.&lt;/p&gt;
&lt;p&gt;You can also have a look at this ticket which started with the same kind of error:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/support-private/support/280097"&gt;Ble from Callback (Fatal Error)&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><item><title>RE: nRF Connect SDK v2.4.2 nrf_dm sample : adv_start in the callback,  ASSERTION FAIL</title><link>https://devzone.nordicsemi.com/thread/461448?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2023 13:59:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e6d0eaa-f35c-470c-9241-caa47f7c1e7a</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi Gary,&lt;/p&gt;
&lt;p&gt;I have been assigned this ticket and I will look into this and update your when I have more information.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>