<?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>S140 7.3.0 Softdevice Assertion Failed at PC=0xa806 using L2CAP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81894/s140-7-3-0-softdevice-assertion-failed-at-pc-0xa806-using-l2cap</link><description>I&amp;#39;m seeing an assertion failure at PC=0xa806 in nrf52840 + S140 7.3.0, while using L2CAP. 
 I know the most common cause for softdevice assertion failures is interrupt/timing issues, so I have triple-checked this is not the case. I have no critical sections</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Nov 2021 14:22:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81894/s140-7-3-0-softdevice-assertion-failed-at-pc-0xa806-using-l2cap" /><item><title>RE: S140 7.3.0 Softdevice Assertion Failed at PC=0xa806 using L2CAP</title><link>https://devzone.nordicsemi.com/thread/340925?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 14:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a71e8a0c-a891-461f-be84-c553ba5df491</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;It&amp;#39;s good to hear you got better results with the workaround &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;After setting credits to 0 for the established channel you can at any time query remaining credits by calling&amp;nbsp;sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, 0, p_credits).&lt;br /&gt;On return *p_credits will contain the number of remaining credits. When this number comes close to 0 you can resupply credits by issuing the following two calls:&lt;br /&gt;sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, 0xFFFF, NULL)&lt;br /&gt;sd_ble_l2cap_ch_flow_control(conn_handle, local_cid, 0, NULL)&lt;/p&gt;
&lt;p&gt;Note that the assert you have seen happens during credits sending so it is better to do that at some time when you did not see the assert happening (is it when not many TXes are queued?).&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S140 7.3.0 Softdevice Assertion Failed at PC=0xa806 using L2CAP</title><link>https://devzone.nordicsemi.com/thread/340795?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 17:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb628f01-e5a9-4fd1-aa0a-48df96576a76</guid><dc:creator>Dirbaio</dc:creator><description>&lt;p&gt;Hello Torbj&amp;oslash;rn&lt;/p&gt;
&lt;p&gt;Thanks for the reply! Indeed the workaround works, I can now queue as many packets as I want for tx without hitting the assertion failure.&lt;/p&gt;
&lt;p&gt;&amp;gt; so the peer will have 0xFFFF credits for the lifetime of the channel&lt;/p&gt;
&lt;p&gt;As I understand it, this means we&amp;#39;re giving 0xFFFF credits to the peer at channel setup and never give more credits. Thus every packet sent by the peer uses up one credit, so after 0xFFFF packets the channel will stop working. Is this correct? If so, can you suggest a workaround without this limitation? (our devices are connected 24/7 and transfer quite a bit of data, so 0xFFFF packets is not that many unfortunately).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S140 7.3.0 Softdevice Assertion Failed at PC=0xa806 using L2CAP</title><link>https://devzone.nordicsemi.com/thread/340722?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 12:36:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47a49cd8-5422-4e83-b503-c4964e9d6a2b</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Potentially this could be a bug in the SoftDevice, but we need to look into it a bit more to be sure.&amp;nbsp;&lt;/p&gt;
&lt;div&gt;There is a possible workaround, but it will only&amp;nbsp;work if you don&amp;#39;t need flow control by credits (that is, you can resupply the RX buffer as soon as the previous one was released by the SoftDevice). &lt;br /&gt;In this case you can use sd_ble_l2cap_ch_flow_control before establishing the CoC channel, with local_cid=BLE_L2CAP_CID_INVALID and a big amount of credits, for example credits=0xFFFF. After establishing the channel, you should set credits to 0 for local_cid of the new channel (!=BLE_L2CAP_CID_INVALID) so the peer will have 0xFFFF credits for the lifetime of the channel. You should carefully read the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.3.0%2Fgroup___b_l_e___l2_c_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=4_7_4_1_2_5_2_0&amp;amp;anchor=gae6b1fc6ec123acd45b99e8679c46c159"&gt;description of the func&lt;/a&gt; (especially the note) before deciding to use this method.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Best regards&lt;/div&gt;
&lt;div&gt;Torbjørn&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S140 7.3.0 Softdevice Assertion Failed at PC=0xa806 using L2CAP</title><link>https://devzone.nordicsemi.com/thread/339951?ContentTypeID=1</link><pubDate>Mon, 22 Nov 2021 07:41:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e22cdad-df2c-47a3-a2f5-dc9eb587a412</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have forwarded your findings to the SoftDevice team, and I will let you know once I hear back from them.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>