<?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>Beaconing while running the Mesh stack</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47272/beaconing-while-running-the-mesh-stack</link><description>I successfully tried the &amp;quot;beaconing&amp;quot; example from your Mesh SDK 310. 
 I noticed that moving 
 line 215 &amp;quot;adv_start();&amp;quot; in main.c 
 right after &amp;quot;ERROR_CHECK(mesh_stack_start()); (line 219 of main.c) 
 Causes the project not working with an error like:</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 May 2019 11:06:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47272/beaconing-while-running-the-mesh-stack" /><item><title>RE: Beaconing while running the Mesh stack</title><link>https://devzone.nordicsemi.com/thread/189276?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 11:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9d12943-8223-4c56-9212-d8d044f826d4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Davide,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The link to the documentation in the infocenter is what we have on this topic.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Basically, if you want mesh activity to be performed on interrupt context (&lt;span&gt;NRF_MESH_IRQ_PRIORITY_LOWEST&amp;nbsp;) so that it can preempt application&amp;nbsp;activity in main context (the main loop) you need to call all Mesh APIs in&amp;nbsp;NRF_MESH_IRQ_PRIORITY_LOWEST&amp;nbsp;context (in an interrupt). Note that you still can have an application interrupt that has more priority than normal mesh activity by setting it&amp;#39;s priority lower than&amp;nbsp;NRF_MESH_IRQ_PRIORITY_LOWEST&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you want mesh running in main (Thread) context,&amp;nbsp;so it won&amp;#39;t mess up your application running in main, then you need to call&amp;nbsp;nrf_mesh_process() in main loop, and you can call Mesh API in main context. If you call Mesh API in an interrupt, it may results unexpected behavior.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beaconing while running the Mesh stack</title><link>https://devzone.nordicsemi.com/thread/189263?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 10:07:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae94dac4-295f-4658-a79f-7169ae6618f7</guid><dc:creator>DavideDN</dc:creator><description>&lt;p&gt;Thank you Hung. &lt;/p&gt;
&lt;p&gt;setting NRF_MESH_IRQ_PRIORITY_THREAD solved the problem as you correctly guessed.&lt;/p&gt;
&lt;p&gt;So this ticket can be closed here. Anyway can you kindly point me where to read something regarding the overall picture of the &amp;quot;thread context&amp;quot;, &amp;quot;IRQ mode&amp;quot; and whole user application structure? I am still missing the whole picture on how to correctly lay down all the user code we need to complete our products.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beaconing while running the Mesh stack</title><link>https://devzone.nordicsemi.com/thread/188855?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 13:44:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:817f6e3b-571e-400f-97f5-c8c7a7b495dc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Davide,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m taking over the case as Bjørn is going on a business trip.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I have the same line number in the timer_scheduler.c file as you , but most likely you have the assert at this line:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;NRF_MESH_ASSERT_DEBUG(bearer_event_in_correct_irq_priority());&lt;/p&gt;
&lt;p&gt;This is due to that the mesh stack in the example by default initialized at Interrupt mode&amp;nbsp;NRF_MESH_IRQ_PRIORITY_LOWEST (see&amp;nbsp;mesh_init() )&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And if you have a look here:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.1.0/md_doc_introduction_mesh_interrupt_priorities.html?cp=5_2_0_4"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.1.0/md_doc_introduction_mesh_interrupt_priorities.html?cp=5_2_0_4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can find this:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Except for calling initialization related functions before calling&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.1.0/group__MESH__STACK.html#ga2b6a69481241334dca341ad9636503dc"&gt;mesh_stack_start()&lt;/a&gt;, no mesh API functions shall be called from an IRQ priority other than the one specified in the configuration. Breaking this rule may cause unpredicable behavior.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So if you want to call adv_start() in thread context, you would need to initialize the mesh stack in NRF_MESH_IRQ_PRIORITY_THREAD mode and in your main loop you need to&amp;nbsp;have something like this:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;bool done = nrf_mesh_process();&lt;br /&gt; if (done)&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; sd_app_evt_wait();&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Otherwise if you want in IRQ mode, you need to call adv_start() in an interrupt at APP LOWEST priority.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beaconing while running the Mesh stack</title><link>https://devzone.nordicsemi.com/thread/188186?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 10:02:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6ba55a1-930a-420d-ac29-3ad71a9de8d9</guid><dc:creator>DavideDN</dc:creator><description>&lt;p&gt;Thank you for your answer Bj&amp;oslash;rn:&lt;/p&gt;
&lt;p&gt;this is the reference you asked for.&lt;/p&gt;
&lt;p&gt;$ addr2line -e beaconing_nrf52832_xxAA_s132_6.1.0.elf 0x0002A64A&lt;br /&gt;&lt;strong&gt;C:\Mc\Nordic\nrf5SDKforMeshv310src\mesh\core\src/timer_scheduler.c:225&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I am looking forward to understand how to correctly use the beaconing functionalities.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beaconing while running the Mesh stack</title><link>https://devzone.nordicsemi.com/thread/187951?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 13:21:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1af311d2-b74c-483f-a701-e08b26b82382</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Very sorry for the delayed response. I have tested this myself &amp;amp; notice a similar assert to you. Could you please use the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/25886/70-mesh-assert-at-0x00023680"&gt;addr2line function&lt;/a&gt; to see where exactly this assert is occurring &amp;amp; then we can take it from there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>