<?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>Assert in subsys/net/buf.c during concurrent UART ISR and BLE communications</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84949/assert-in-subsys-net-buf-c-during-concurrent-uart-isr-and-ble-communications</link><description>I&amp;#39;m working on a 52840 board controller project that requires serial communication with the 9160 (on a nRF9160DK board) and BLE communications to an Android tablet. I have discovered when receiving serial data while transmitting gatt notifications results</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Mar 2022 15:15:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84949/assert-in-subsys-net-buf-c-during-concurrent-uart-isr-and-ble-communications" /><item><title>RE: Assert in subsys/net/buf.c during concurrent UART ISR and BLE communications</title><link>https://devzone.nordicsemi.com/thread/355871?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 15:15:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f52c0ede-7dfc-4500-85b7-ea5800c4326a</guid><dc:creator>KCrawford</dc:creator><description>&lt;p&gt;Hey Simon, I finally got a chance to test that config, but I still got the same error. I even tried to de-couple the UART event from the BLE transmit logic by inserting queue logic between them. The error changed from an ASSERT to the message &amp;quot;Unable to allocate TX&amp;nbsp;context&amp;quot;. At the point, BLE operations just seemed to hang.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, in doing more research I found a related Zephyr issue (can&amp;#39;t remember where), and it suggested switching to a thread vs a work queue. So I switched my BLE logic to a thread and Voila! Success. So this seems like an issue in the Zephyr logic somewhere. But at least I&amp;#39;m able to make progress again. Thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert in subsys/net/buf.c during concurrent UART ISR and BLE communications</title><link>https://devzone.nordicsemi.com/thread/354427?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 18:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5451ed14-c424-4b99-8ae1-13e105096f2f</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Yes, try to increase&amp;nbsp;&lt;span&gt;UART_RX_POOL_MAX_ENTRIES and see if&amp;nbsp;it still asserts.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert in subsys/net/buf.c during concurrent UART ISR and BLE communications</title><link>https://devzone.nordicsemi.com/thread/354398?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 14:59:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9855dee4-25b4-419d-a0e3-051c03aea783</guid><dc:creator>KCrawford</dc:creator><description>&lt;p&gt;Hey Simon, I have inserted a screenshot of where&amp;nbsp;a believe the buffer pool is configured. This code is from an example I found on DevZone that had sources files uart_simple.c and slip.c. I&amp;#39;m not sure of the link. The example as written would only handle packets 256 bytes or less. But I need to send a packet over 1000 bytes in length. So I increased the buffers for that. And had to fix an bug where the CRC index was defined as a uint8_t (hence the 256 limit). Note I did not increase the size of the&amp;nbsp;UART_RX_POOL_MAX_ENTRIES define. Is that possibly the issue?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/NETBUF_5F00_CONFIG.GIF" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert in subsys/net/buf.c during concurrent UART ISR and BLE communications</title><link>https://devzone.nordicsemi.com/thread/354227?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 20:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7a53018-6f6b-4cf6-a09b-0fb5203460ed</guid><dc:creator>KCrawford</dc:creator><description>&lt;p&gt;Hello again Simon. Thanks for the fast response and insight as to the problem I am sending somewhat large packets (around 1024 bytes) between the 9160&amp;lt;&amp;gt;52840 at about 500ms intervals. That doesn&amp;#39;t seem like much, but BLE and sensor sampling are going concurrently as well. I will research how to check/set the uart_pool and get back to you ASAP. Thanks again for your expertise and help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert in subsys/net/buf.c during concurrent UART ISR and BLE communications</title><link>https://devzone.nordicsemi.com/thread/354226?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 20:40:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8861bbca-d7d5-45d5-9af4-8bb4703b1619</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I can see that you run&amp;nbsp;&lt;code&gt;*buf = net_buf_alloc_len(&amp;amp;uart_pool,..)&lt;/code&gt; first. My suspicion is that uart_pool is out of buffers and it will return null (and buf will then be equal to NULL), as stated in the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.99-ncs1/include/net/buf.h#L1285"&gt;explanatory text above net_buf_alloc_len()&lt;/a&gt;. Could you try to figure out where you define uart_pool and try to increase the size?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>