<?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 fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118093/assert-fires-when-disconnecting-while-data-is-transmitted-via-l2cap</link><description>I have a nRF5340 using nrf connect v3.7.99-nc1 that is in a peripheral role. I establish a l2cap connection to the peripheral, to request a larger amount of data. That works quite ok until I close that connection from the receiving side while still some</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Mar 2025 08:05:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118093/assert-fires-when-disconnecting-while-data-is-transmitted-via-l2cap" /><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/525876?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 08:05:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de64010f-4c2a-4bf7-9de5-8861ea9fd6a3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sorry for late reply Torsten, I reproduced the assert and your changes seems to help avoid this. I can pass this on to the team and create a bug report. Thanks for all the effort Torsten.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/523694?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2025 12:32:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:951dc827-6f4e-4413-88d3-8eeafa4963e9</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;This bug-fix might fix the problem:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="diff"&gt;--- a/subsys/bluetooth/host/l2cap.c
+++ b/subsys/bluetooth/host/l2cap.c
@@ -959,8 +959,9 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn,
         * static channels don&amp;#39;t have the concept of L2CAP segments.
         */
        bool last_seg = lechan-&amp;gt;_pdu_remaining == pdu-&amp;gt;len;
+       bool sdu_end = ( last_frag &amp;amp;&amp;amp; last_seg ) || conn-&amp;gt;state != BT_CONN_CONNECTED;
 
-       if (last_frag &amp;amp;&amp;amp; last_seg) {
+       if (sdu_end) {
                LOG_DBG(&amp;quot;last frag of last seg, dequeuing %p&amp;quot;, pdu);
                __maybe_unused struct net_buf *b = k_fifo_get(&amp;amp;lechan-&amp;gt;tx_queue, K_NO_WAIT);
 
@@ -968,7 +969,6 @@ struct net_buf *l2cap_data_pull(struct bt_conn *conn,
        }
 
        if (last_frag &amp;amp;&amp;amp; L2CAP_LE_CID_IS_DYN(lechan-&amp;gt;tx.cid)) {
-               bool sdu_end = last_frag &amp;amp;&amp;amp; last_seg;
 
                LOG_DBG(&amp;quot;adding %s callback&amp;quot;, sdu_end ? &amp;quot;`sdu_sent`&amp;quot; : &amp;quot;NULL&amp;quot;);
                /* No user callbacks for SDUs */
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/523687?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2025 12:14:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44dda361-3d01-4f57-9128-57df3413f6c5</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;please find the reproducer here:&amp;nbsp;&lt;a id="" href="https://github.com/TorstenRobitzki/l2cap_reproducer"&gt;https://github.com/TorstenRobitzki/l2cap_reproducer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It is bases on one of the official examples (GATT CGM). It accepts a L2CAP connection and once connected, tries to send as much 4KByte large SDU as possible.&lt;/p&gt;
&lt;p&gt;There is a python script, that used a HCI controller on a nrf52 eval board, to connect to the reproducer.&lt;/p&gt;
&lt;p&gt;Once, the HCI controller, is powered off, the connection times out and the L2CAP layer on the reproducer hits the assert.&lt;/p&gt;
&lt;p&gt;Let me know, when you have further questions or need help with the setup.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/522845?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 12:31:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:721dca0c-7048-496d-b9b4-bbfe0d547c63</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sounds like a plan Torsten.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/522833?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 11:47:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83386f71-d9bc-49d2-8308-615a9b4ea20c</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;OK, I was missing that information and that&amp;#39;s why I also asked for unit tests. If there where unit tests, either that case could&amp;nbsp;be covered by them, or it might be relatively easy to create a test for that case if similar tests already exists.&lt;/p&gt;
&lt;p&gt;Anyway: I will put that as a TODO on our side and see, when we are able to work further on the reproducer.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/522831?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 11:41:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3c5544e-20ec-45c4-8a84-125fe336c40a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Torsten, Sorry no I did not try to reproduce this on my end.&lt;/p&gt;
&lt;p&gt;Normal process is that we get a minimalistic project from the users who have issues so that we can spend our time in debugging and not constructing the project and its configuration. It happened so many times that we spend huge amount of times trying to get close to the user setup, but the time we spend on constructing the environment does not guarantee that we are still able to reproduce. Best is that you give a minimalistic project for me to reproduce and i can debug and take it to the dev team.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/522275?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2025 16:20:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58d9748e-019a-4952-b039-86be06111341</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;did you made any progress on this issue? Are you able to reproduce this?&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/521503?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 10:00:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cc93633-f32a-4149-9809-142ed7900ccf</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I understand your concern, the side effect might be that there could be a double freeing of PDU if you do this wrong. Consider using&amp;nbsp;k_fifo_peek_head first not to affect the queue while enquiring stuff.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/521461?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 08:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4920d024-bd1c-4b85-bc38-8dc940d4b527</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Unfortunately, I was not able to reproduce this with a small example. In `l2cap_data_pull`, at the beginning, the next PDU is pulled out of the transit queue, using `k_fifo_peek_head`, which leaves the PDU on the queue. Later in the same function, if `last_frag` and `last_seg`, `k_fifo_get` is used to actually remove the PDU from the queue. I&amp;#39;ve a PDU is returned but not removed from the queue, the trouble begins (same PDU is pulled twice from the queue. First time it was marked as freed, second time, the assert will fire).&lt;/p&gt;
&lt;p&gt;So my last resort quick fix for our upcoming release will be, to change&amp;nbsp;the function to use `&lt;span&gt;k_fifo_get` also, when the connection state is indicating that the connection is closed. But I don&amp;#39;t know if that has other side effects.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/521456?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2025 08:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a372fc79-6475-4380-8bdc-a625a01dc394</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Wow, Torsten, seems like you have done some solid debugging already, sorry to hear about the pain caused by the tools on Mac. I am using windows and the tools work ok.&lt;/p&gt;
&lt;p&gt;I have not tried to reproduce this but it seems like&amp;nbsp;theassertion failure occurs because the &lt;code&gt;net_buf_simple_push()&lt;/code&gt; function in &lt;code&gt;buf_simple.c&lt;/code&gt; is being called on an SDU that has already been marked as freed.&lt;/p&gt;
&lt;p&gt;Before I dive into this, I need to able to reproduce this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/520790?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2025 21:30:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ece0d59c-8746-4003-b774-774d9b88e874</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Torsten,&lt;/p&gt;
&lt;p&gt;I unfortunately don&amp;#39;t have anything to add to the discussion. I&amp;#39;m writing just to let you know that Susheel has unfortunately been sick, but he will return next week and continue working on this. Our apologies for the inconvenience.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/519956?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2025 11:26:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db965582-f880-4ecc-aaf3-7941632dff80</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;I think, I figured out, why the assert is firing. When a connection gets closed, bt_conn_tx_processor() in conn.c is destroying all pending SDUs on the transmit queue (line 1059). It pulls the SDUs from the queue, using l2cap_data_pull() from l2cap.c.&lt;/p&gt;
&lt;p&gt;That l2cap_data_pull() function not just pulls a SDU from the queue, but also adds PDU headers if necessary (that&amp;#39;s what causes the assert later) and only removed the SDU from the queue, if the very last fragment of the SDU was transmitted.&lt;/p&gt;
&lt;p&gt;So, if the SDU has multiple fragments and not all fragments where send out, l2cap_data_pull() returns a SDU, but leaves the SDU on the transmit queue. A call to destroy_and_callback() will then set the data and __buf pointers to NULL. In the second iteration of the loop in conn.c, l2cap_data_pull() will be called again and will get the very same SDU from the queue. But this time, the __buf and data are set to NULL and thus, the call to net_buf_push() will fail with an assert.&lt;/p&gt;
&lt;p&gt;Without that assert enable, this will probably fail later with a dereferenced null pointer.&lt;/p&gt;
&lt;p&gt;It took me quite some time, to figure that out. My first attempt was to set watch points on the pointer that get set to zero. Maybe the watch points are not supported by nrf53, or they have to be set explicitly? And I had to restart the debugger for every run, as restarting the debug session (&amp;quot;monitor reset&amp;quot;, &amp;quot;continue&amp;quot;), triggered and an assert in GNU gdb (Zephyr SDK 0.16.4) 12.1 (/Volumes/Workspace/build/.build/arm-zephyr-eabi/src/gdb/gdb/infrun.c:5825: internal-error: finish_step_over: Assertion `ecs-&amp;gt;event_thread-&amp;gt;control.trap_expected&amp;#39; failed.)&lt;/p&gt;
&lt;p&gt;Now, I&amp;#39;ve tried to figure out, why my example from above is not triggering the issue. But currently, I first have to figure out, why debugging is not working any more. While the very same setup worked a few days ago, now, when I start a debug session:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Loading section .last_section, size 0x4 lma 0x60fb4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Start address 0x0000bec4, load size 397218&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Transfer rate: 301 KB/sec, 7944 bytes/write.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Resetting target&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;(gdb) monitor flash breakpoints = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Flash breakpoints disabled&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;(gdb) b conn.c:1059&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Breakpoint 1 at 0x1874c: file /Users/todi/bloomlife/l2cap_reproducer/zephyr/subsys/bluetooth/host/conn.c, line 1059.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;(gdb) c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Continuing.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Warning:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Cannot insert breakpoint 1.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Cannot access memory at address 0x1874c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Command aborted.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know, if it is just me on Mac, but all this tooling seem so fragile and buggy and costs soooo much time.&lt;/p&gt;
&lt;p&gt;Anyway, maybe you can already look into this, with the information, that I found out? Maybe, there is a unit test, that should cover this situation or maybe you could modify an existing unit test to cover that situation?&lt;/p&gt;
&lt;p&gt;best regards and thanks in advance&lt;br /&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/519578?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2025 14:00:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05195229-72f6-480c-8603-f64429cf9ff5</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Ok, got it. Guess, I hit this old bug in build system: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92557/nrf5340-multicore-application-configuration-problem/389463"&gt;devzone.nordicsemi.com/.../389463&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When running `west` and `west` is in the path and installed to be a script pointing to a specific python version, then it might happen, that some required libraries are not installed for that python version that comes with west, even when you use `venv` to setup a local python environment, that contains all required libraries. In the end, some python scripts are running, failing and the failing is ignored, leading to a mess, that is hard to debug.&lt;/p&gt;
&lt;p&gt;Maybe, never calling west directly, but using &amp;quot;python -m west&amp;quot; instead would be a recommendation to prevent such time consuming issues.&lt;/p&gt;
&lt;p&gt;I will get back to you, once, I have the reproducer running.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/519562?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2025 13:13:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46261ae4-d928-4cee-882b-cb40826cdb17</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;we discovered, that in our test environment we must expect BLE&amp;nbsp;disconnects due to the harsh environment, which would then crash our application.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve started to write a reproducer. I had two options to go, either strip down our application to a bare minimum, that works on a eval board, or start from scratch (the&amp;nbsp;CGMS from nrf/samples/bluetooth).&lt;/p&gt;
&lt;p&gt;Unfortunately, I toke the second road and now I&amp;#39;m stuck with the configuration. I get Kconfig errors from generated code. I tried to strip down the configuration to a bare minimum. However:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;rm -fr ./build &amp;amp;&amp;amp; ZEPHYR_BASE=$(pwd)/../zephyr ZEPHYR_NRF_MODULE_DIR=$(pwd)/../nrf west build  -b&amp;quot;nrf5340dk/nrf5340/cpuapp&amp;quot; --build-dir ./build --sysbuild  .&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;results in:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /opt/homebrew/opt/python@3.11/bin/python3.11 (found suitable version &amp;quot;3.11.7&amp;quot;, minimum required is &amp;quot;3.8&amp;quot;) found components: Interpreter 
-- Cache files will be written to: /Users/todi/Library/Caches/zephyr
-- Found west (found suitable version &amp;quot;1.2.0&amp;quot;, minimum required is &amp;quot;0.14.0&amp;quot;)
-- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
Parsing /Users/todi/bloomlife/l2cap_reproducer/zephyr/share/sysbuild/Kconfig
Loaded configuration &amp;#39;/Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/_sysbuild/empty.conf&amp;#39;
Merged configuration &amp;#39;/Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/sysbuild.conf&amp;#39;
Configuration saved to &amp;#39;/Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/zephyr/.config&amp;#39;
Kconfig header saved to &amp;#39;/Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/_sysbuild/autoconf.h&amp;#39;
-- 
   **************************************
   * Running CMake for l2cap_reproducer *
   **************************************

Loading Zephyr default modules (Zephyr base).
-- Application: /Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer
-- CMake version: 3.28.1
-- Found Python3: /Users/todi/zephyrproject/.venv/bin/python (found suitable version &amp;quot;3.12.3&amp;quot;, minimum required is &amp;quot;3.8&amp;quot;) found components: Interpreter 
-- Cache files will be written to: /Users/todi/Library/Caches/zephyr
-- Zephyr version: 3.7.99 (/Users/todi/bloomlife/l2cap_reproducer/zephyr)
-- Board: nrf5340dk, qualifiers: nrf5340/cpuapp
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.16.4 (/Users/todi/zephyr-sdk-0.16.4)
-- Found toolchain: zephyr 0.16.4 (/Users/todi/zephyr-sdk-0.16.4)
-- Found Dtc: /opt/homebrew/bin/dtc (found suitable version &amp;quot;1.7.0&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;) 
-- Found BOARD.dts: /Users/todi/bloomlife/l2cap_reproducer/zephyr/boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpuapp.dts
-- Found devicetree overlay: /Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/app.overlay
-- Generated zephyr.dts: /Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/l2cap_reproducer/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/l2cap_reproducer/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/l2cap_reproducer/zephyr/dts.cmake

/Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/l2cap_reproducer/zephyr/.config.sysbuild:2: warning: attempt to assign the value &amp;#39;y&amp;#39; to the undefined symbol PARTITION_MANAGER_ENABLED

/Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/l2cap_reproducer/zephyr/.config.sysbuild:5: warning: attempt to assign the value &amp;#39;n&amp;#39; to the undefined symbol BT_FAST_PAIR

/Users/todi/bloomlife/l2cap_reproducer/l2cap_reproducer/build/l2cap_reproducer/zephyr/.config.sysbuild:7: warning: attempt to assign the value &amp;#39;n&amp;#39; to the undefined symbol CHIP
...
...
...
warning: NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED (defined at modules/hal_nordic/nrfx/Kconfig:24) has direct dependencies NRFX_CLOCK &amp;amp;&amp;amp; HAS_NRFX &amp;amp;&amp;amp; 0 with value n, but is currently being y-selected by the following symbols:
 - CLOCK_CONTROL_NRF_K32SRC_XTAL (defined at drivers/clock_control/Kconfig.nrf:36), with value y, direct dependencies &amp;lt;choice CLOCK_CONTROL_NRF_SOURCE&amp;gt; (value: y), and select condition !SOC_SERIES_BSIM_NRFXX &amp;amp;&amp;amp; !CLOCK_CONTROL_NRF_FORCE_ALT &amp;amp;&amp;amp; &amp;lt;choice CLOCK_CONTROL_NRF_SOURCE&amp;gt; (value: y)

error: Aborting due to Kconfig warnings
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can find the entire code here:&amp;nbsp;&lt;a href="https://github.com/TorstenRobitzki/l2cap_reproducer"&gt;https://github.com/TorstenRobitzki/l2cap_reproducer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The version of the nRF SDK is set to&amp;nbsp;v2.8.0 in west.yml&lt;/p&gt;
&lt;p&gt;Any idea, as to how to create a small stand alone application using nrf5340 without hacking it into the nrf source code (to be able to quickly switch SDK versions)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/519294?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 12:43:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a569970a-90c5-4b0e-80ec-800149fb8cbd</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Torsten,&lt;/p&gt;
&lt;p&gt;Got it, please write here when you pick this task again and able to help me to reproduce the issue. Good luck with your product test launch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/519229?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 09:34:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3638a42-558a-4b22-9c74-c3f62995e4a4</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;I added this issue to our ticket system. Currently we are shortly before rolling out our product to test customers and it might take some time, before someone (most likely me) is able to pick that ticket up and to create a reproducer.&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/518989?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 08:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd018fa5-f355-4fde-ac11-8fee4b116356</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Yes, this does not seem normal, Can you please help me reproduce this so that I can take this to the BLE stack engineers and they can take us seriously about this? Maybe, if I can reproduce this, then I might be able to find out if this is a stack issue or if there is something we can do in the app to mitigate this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/518840?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 12:43:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:675bf3c3-7096-4347-b8e0-a0df9ed13b84</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;there was for sure enough headroom for the l2cap protocol, when the l2cap message was added to the queue (using `bt_l2cap_chan_send()`), as I&amp;#39;m able to send thousands of l2cap SDUs without problem.&lt;/p&gt;
&lt;p&gt;The reason, why the calculation of the headroom results in 0 (and thus is small&amp;nbsp;than len) is, because the headroom is defined to be the difference between `data` and `__buf`. As booth are 0 (which I think is most likely the reason for the failure), the difference and thus the headroom is 0.&lt;/p&gt;
&lt;p&gt;The pool for all messages are statically allocated and as `data` and `__buf` are the first and the last member, I would rule out some accidental overwriting. I looked into the buffer library but&amp;nbsp;also did not found any single function, that sets both pointer to zero.&lt;/p&gt;
&lt;p&gt;As you can see from that call stack, the assert is triggered from a function that runs in a BLE stack internal thread. So there is hardly anything, I can do to prevent it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks and best regards&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assert fires when disconnecting while data is transmitted via L2CAP</title><link>https://devzone.nordicsemi.com/thread/518832?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 12:00:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38051cdd-a18a-4e10-9df3-6b0587f229a5</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Torsten,&lt;/p&gt;
[quote user=""]When inspecting the buffer that caused the assert, it turns out, that `len` and `size` have values that I would expect, while `&lt;span&gt;data` and `__buf` are set to 0!:&lt;/span&gt;[/quote]
&lt;p&gt;Can you please elaborate on this. The assert triggered means that&amp;nbsp;&lt;span&gt;net_buf_simple_headroom&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;buf&lt;/span&gt;&lt;span&gt;) was less than the len. If you think there should have been enough space in that buffer, then we need to investigate how the buffer got full or why this API gave wrong info. Could be stackoverflow symptoms?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>