<?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>Zephyr BLE issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123457/zephyr-ble-issues</link><description>Hello, I&amp;#39;m currently exploring BLE using zephyr and faced some issues. 
 1. id like to restart advertising after disconnecting from a device. I tried different approaches like stopping advertising and starting it again. stopping advertising, disabling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Aug 2025 18:35:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123457/zephyr-ble-issues" /><item><title>RE: Zephyr BLE issues</title><link>https://devzone.nordicsemi.com/thread/544696?ContentTypeID=1</link><pubDate>Tue, 05 Aug 2025 18:35:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1986ddf3-e9d1-4181-964e-a233064b569f</guid><dc:creator>Amanda Hsieh</dc:creator><description>[quote user="rsf_pn"]&lt;div&gt;&lt;span&gt;#CONFIG_BT_CTLR_PHY_2M=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_BT_CTLR_PHY_CODED=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;for some reason my main loop is not executed anymore if i add these two lines back in.&lt;/span&gt;&lt;/div&gt;[/quote]
&lt;p&gt;It&amp;#39;s not clear what might have caused the issue, but you can refer to&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/main/samples/bluetooth/throughput"&gt;https://github.com/nrfconnect/sdk-nrf/tree/main/samples/bluetooth/throughput&lt;/a&gt;&amp;nbsp;for the settings and coding.&amp;nbsp;&lt;/p&gt;
[quote user="rsf_pn"]and i don&amp;#39;t get the MTU values i thought MTU can be maximum 251 bytes with 244 bytes usable data for bluetooth 5. what does 498 mean. can i really use 498 bytes every connection interval?[/quote]
&lt;p&gt;MTU of 498 means the maximum size of a single ATT operation, but not a single on-air packet. The actual on-air packet size is limited by data length &lt;span&gt;up to 251 bytes, while the actual payload that you can send is a maximum of 244 bytes. This is because the 251-byte Data PDU payload needs an L2CAP Header of 4 bytes, and an Attribute header of 3 bytes. This leaves you with 251 – 4 – 3 = 244 bytes that you can actually populate with payload data.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr BLE issues</title><link>https://devzone.nordicsemi.com/thread/544522?ContentTypeID=1</link><pubDate>Mon, 04 Aug 2025 19:42:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36b62a01-e7e5-4c52-981c-880f55899e22</guid><dc:creator>rsf_pn</dc:creator><description>&lt;p&gt;changing the connection paramters worked perfectly fine following the guide.&lt;/p&gt;
&lt;p&gt;i&amp;#39;ve set the following settings in my proj.conf file (looked at the guide and throughput example for the macros)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=24
CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
CONFIG_BT_USER_PHY_UPDATE=y

CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1

CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_ATT_TX_COUNT=10
CONFIG_BT_L2CAP_TX_MTU=498
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=502

CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_CTLR_PHY_CODED=y
CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=4000000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and called the required commands from the guide.&lt;/p&gt;
&lt;p&gt;in the debug logs i can see that the connection interval is set correctly, phy is updated and mtu is updated.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;- BLE connected

PHY updated. New PHY: 2M
Connection interval: 24 units (30 ms)
Connection latency: 0
Supervision timeout: 720 ms
MTU: 23
UATT MTU: 23

Connection interval: 24 units (30 ms)
Connection latency: 0
Supervision timeout: 4000 ms
MTU: 498
UATT MTU: 498&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Only two things that i still don&amp;#39;t understand.&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_BT_CTLR_PHY_2M=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_BT_CTLR_PHY_CODED=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;for some reason my main loop is not executed anymore if i add these two lines back in.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;and i don&amp;#39;t get the MTU values i thought MTU can be maximum 251 bytes with 244 bytes usable data for bluetooth 5. what does 498 mean. can i really use 498 bytes every connection interval?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;thanks for your advice&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr BLE issues</title><link>https://devzone.nordicsemi.com/thread/544511?ContentTypeID=1</link><pubDate>Mon, 04 Aug 2025 16:53:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0adf8e56-188d-46d9-a403-0c78b815f99b</guid><dc:creator>Amanda Hsieh</dc:creator><description>[quote user="rsf_pn"]can i also set the parameters as ble peripheral or only as central device?[/quote]
&lt;p&gt;That course demonstrates&amp;nbsp;&lt;span&gt;setting the parameters on the ble peripheral side, and that will trigger the&amp;nbsp;negotiation with the central device in the connection.&amp;nbsp;&lt;/span&gt;&lt;span&gt;so you may not get the full bytes that you request. The device that supports the shortest data length will have the final say.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr BLE issues</title><link>https://devzone.nordicsemi.com/thread/544498?ContentTypeID=1</link><pubDate>Mon, 04 Aug 2025 15:02:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:160b3aef-224f-4c87-9092-2869cd75371e</guid><dc:creator>rsf_pn</dc:creator><description>&lt;p&gt;Thanks for the reply my current setup is:&lt;br /&gt;nRF Connect SDK v3.0.2&lt;br /&gt;nRF Connect SDK Toolchain v3.0.2&lt;br /&gt;Zephyr OS v4.0.99&lt;/p&gt;
&lt;p&gt;1. i see so i guess the issue is that i tried to run it from the callback.&lt;br /&gt;2. im using the nrf52840 dongle and running it as a Bluetooth peripheral.&amp;nbsp;can i also set the parameters as ble peripheral or only as central device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr BLE issues</title><link>https://devzone.nordicsemi.com/thread/544493?ContentTypeID=1</link><pubDate>Mon, 04 Aug 2025 14:31:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9df3a7b-fd6f-4df3-b6ae-0f7b5eb05786</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I&amp;#39;m currently exploring BLE using zephyr and faced some issues.[/quote]
&lt;p&gt;Are you using vanilla Zephyr? If so, please use&amp;nbsp;&lt;span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html"&gt;nRF Connect SDK (NCS)&lt;/a&gt; since our support is based on NCS.&lt;/span&gt;&lt;/p&gt;
[quote user=""]1. id like to restart advertising after disconnecting from a device. I tried different approaches like stopping advertising and starting it again. stopping advertising, disabling bluetooth, enabling and starting it again but it always results in the same error. I added some error logs for debugging. I always get error code -12 but don&amp;#39;t know how to resolve it.[/quote]
&lt;p&gt;Check out&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/114174/nrf52840-ncs-2-5-0---ncs-2-7-0-ble-advertising-stops-on-disconnect/499731"&gt;this post.&lt;/a&gt;&lt;/p&gt;
[quote user=""]2. how do I max the ble data rate?[/quote]
&lt;p&gt;Check out this course:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-3-bluetooth-le-connections/topic/blefund-lesson-3-exercise-2/"&gt;https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-3-bluetooth-le-connections/topic/blefund-lesson-3-exercise-2/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>