<?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>Conflicts when accessing peripherals from mesh-callback</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57771/conflicts-when-accessing-peripherals-from-mesh-callback</link><description>H i 
 I faced probl ems when handling messages from the callback function of the mesh ( generic_set_cb() in my case) we are using generic SDK 15.2 and mesh SDK 3.1 
 Here what I do: - directly inside the callback function generic_set_cb() I analyze the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Feb 2020 13:19:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57771/conflicts-when-accessing-peripherals-from-mesh-callback" /><item><title>RE: Conflicts when accessing peripherals from mesh-callback</title><link>https://devzone.nordicsemi.com/thread/235726?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 13:19:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:123c9301-ab7e-42c9-a538-2db6d00b6b91</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &amp;quot;Run application and mesh event handling in main loop&amp;quot; section, should actually help. Did you set IRQ priority to NRF_MESH_IRQ_PRIORITY_THREAD when initializing the mesh stack: &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.2.0/structnrf__mesh__init__params__t.html#ad41f7d35516c895ec84ac9b2cd9e77af" rel="noopener noreferrer" target="_blank"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.2.0/structnrf__mesh__init__params__t.html#ad41f7d35516c895ec84ac9b2cd9e77af&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Could you post how the mesh stack is initialized and which call you use for replying on a message?&lt;/p&gt;
&lt;p&gt;What could also cause the issue is that the mesh API is not called at the correct IRQ priority. 2 ways how this can be fixed:&lt;/p&gt;
&lt;p&gt;1. Use app_scheduler and run the mesh stack at &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v4.0.0%2Fgroup__MESH__DEFINES__API.html&amp;amp;anchor=ga3c75e81adeb76c025c403caed6fae531" rel="noopener noreferrer" target="_blank"&gt;NRF_MESH_IRQ_PRIORITY_THREAD&lt;/a&gt;&amp;nbsp;as described on &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.2.0/md_doc_introduction_mesh_interrupt_priorities.html#irq_levels_changes_main_loop" rel="noopener noreferrer" target="_blank"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.2.0/md_doc_introduction_mesh_interrupt_priorities.html#irq_levels_changes_main_loop&lt;/a&gt; page and use the same workaround as provided for `simple_hal` on that page. Use `app_sched_event_put` to put an event to the app scheduler and then call the mesh API from the callback provided to `app_sched_event_put` call.&lt;/p&gt;
&lt;p&gt;2. Use Bearer Event API to schedule a callback at the mesh stack IRQ priority level. To do that, register the callback using `bearer_event_flag_add` function (see bearer_event.h). Whenever the callback needs to be scheduled, run `bearer_event_flag_set` function with the event returned by `bearer_event_flag_add`.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Conflicts when accessing peripherals from mesh-callback</title><link>https://devzone.nordicsemi.com/thread/235543?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 16:00:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f926acbd-bd6f-47c2-aa91-f87bddbdf8c4</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have forwarded this to our Mesh team, I will update you when I get a response from them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>