<?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>Bearer bitmap assert in Mesh</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65498/bearer-bitmap-assert-in-mesh</link><description>I&amp;#39;m developing a Bluetooth mesh device on a Window 10 machine using Segger Embedded Studio v4.52c on a nRF52832 chip using SDK16.0.0, Mesh SDK 4.1.0 and FreeRTOS. 
 in the core_tx.c file I get an assert on line 105 if the m_packet.bearer_bitmap == 0.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Sep 2020 09:55:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65498/bearer-bitmap-assert-in-mesh" /><item><title>RE: Bearer bitmap assert in Mesh</title><link>https://devzone.nordicsemi.com/thread/268699?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2020 09:55:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3667b75d-989c-4cea-b108-c30da3df0199</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry, seems like I missed the link.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I talked to one of my colleagues and he suspected that this might be because of either:&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;inadequate heap allocation in FreeRTOSConfig.h file causing stack corruption in app memory&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;some RTOS task of Mesh/App is not with the correct priority.&lt;/p&gt;
&lt;p&gt;Hard to say which one is the issue. Can you check?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bearer bitmap assert in Mesh</title><link>https://devzone.nordicsemi.com/thread/267922?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2020 21:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46dbb48b-51b2-4653-b963-1e46bbf599d7</guid><dc:creator>Ryjan</dc:creator><description>&lt;p&gt;I actually referenced that project above. Right now what we dd was consolidate the softdevice task and the mesh task into one task. I&amp;#39;m in the process of testing the stability of that setup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bearer bitmap assert in Mesh</title><link>https://devzone.nordicsemi.com/thread/267871?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2020 13:35:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cd85fed-3191-497d-9cfc-32608ff94df9</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We do have an example on&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/NordicPlayground/nrf-mesh-freeRTOS-example" rel="noopener noreferrer" target="_blank"&gt;Github&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;demonstrating how the Mesh stack can coexist with the FreeRTOS library available in the nRF5 SDK. I will suggest you have a look at that and see if it help you solve the issue.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bearer bitmap assert in Mesh</title><link>https://devzone.nordicsemi.com/thread/267707?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2020 22:01:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2537ec2-213c-4ee0-8dcf-b92e38092f45</guid><dc:creator>Ryjan</dc:creator><description>&lt;p&gt;A co-worker showed me a thread I had missed in my searches:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/36979/mesh-assert-error-in-m_packet-bearer_bitmap-events"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/36979/mesh-assert-error-in-m_packet-bearer_bitmap-events&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This seems to be addressing this same issues. I theorized today that the m_packet member variable is getting accessed and edited in multiple threads. There is a mesh thread and a BLE thread since my code is based off of this playground example:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicPlayground/nrf-mesh-freeRTOS-example"&gt;https://github.com/NordicPlayground/nrf-mesh-freeRTOS-example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Setting up a mutex to protect the corruption in the m_packet variable was one idea, but it right now I decided to elevate the priority of the BLE thread (the softdevice thread) to above the mesh thread and my initial tests have not caused the assert error and given me reliable operation so far. After reading the second bullet point from the top in the article cited in the link on the 3rd post (see here: &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v2.1.1%2Fmd_doc_getting_started_mesh_interrupt_priorities.html&amp;amp;cp=4_1_0_3_3"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v2.1.1%2Fmd_doc_getting_started_mesh_interrupt_priorities.html&amp;amp;cp=4_1_0_3_3&lt;/a&gt;) it&amp;#39;s still confusing if that is the right solution concerning priorities, you can see below:&lt;/p&gt;
&lt;p&gt;&amp;quot;The less time-critical parts should run in the same IRQ priority as the user application&amp;#39;s low priority code. This can be any priority lower than the SoftDevice API call priority, but it should be the same as the SoftDevice event IRQ handler. When using the nRF5 SDK, this will normally be NRF_MESH_IRQ_PRIORITY_LOWEST (APP_IRQ_PRIORITY_LOWEST). However, if you use the nRF5 SDK&amp;#39;s app_scheduler module to run the application from the main loop, the low priority parts of the mesh stack should also run from the main loop.&amp;quot;&lt;/p&gt;
&lt;p&gt;That page deals with non RTOS related implementation.&lt;/p&gt;
&lt;p&gt;Also According to the above mentioned playground project it says:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/** The FreeRTOS task priority used for the Mesh processing task.
 *  Should not have to be modified.
 *  It is important that this is not lower than the priority of the SoftDevice Handler
 *  task in nrf_sdh_freertos.c as that will cause issues with GATT provisioning.
 */
#define MESH_FREERTOS_TASK_PRIO             2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What I tried to fix this is in violation of this warning, I boosted the BLE thread to 3, making it higher and because the bearer_bitmap field is not being corrupted like it often was at the end of provisioning. It sounds like what I have done is not a good solution, so what may be better for this FreeRTOS implementation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>