<?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>nRF52833 increasing att mtu data length</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117076/nrf52833-increasing-att-mtu-data-length</link><description>hello, 
 
 I Have two nRF52833 that I have communicating over BLE. I am using soft device S140. I have my data packets use the default data length maximum of 20 bytes. I am trying to configure it such that data packets have more then 20 bytes. 
 
 I call</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Dec 2024 14:57:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117076/nrf52833-increasing-att-mtu-data-length" /><item><title>RE: nRF52833 increasing att mtu data length</title><link>https://devzone.nordicsemi.com/thread/515535?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2024 14:57:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a140300a-a56b-4511-8b82-092e9d2f9773</guid><dc:creator>jacob jacob</dc:creator><description>&lt;p&gt;I figured out what I was doing wrong, and I wanted to share incase it is useful to anyone. my issue was that when I called&amp;nbsp;&lt;span&gt;characteristic_add I passed in a .max_len of 20.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;both peripheral and central agreed that max length would be 244 based on the messaging I saw.&lt;br /&gt;&lt;br /&gt;but this is not the only thing&amp;nbsp;sd_ble_gatts_value_set checks before returning&amp;nbsp;[NRF_ERROR_DATA_SIZE]. it also checks .max_len value set by&amp;nbsp;characteristic_add.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;in summary to get packets with data of more than 20bytes:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;set these define:&lt;br /&gt;NRF_SDH_BLE_GAP_DATA_LENGTH = 244&lt;br /&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 244&lt;br /&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH = 400&lt;br /&gt;&lt;br /&gt;AND&lt;br /&gt;pass&amp;nbsp;characteristic_add .max_len of desired data value.&lt;br /&gt;&lt;br /&gt;doing all this will let you send packets of more then 20bytes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thanks einar for the help.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52833 increasing att mtu data length</title><link>https://devzone.nordicsemi.com/thread/514674?ContentTypeID=1</link><pubDate>Thu, 12 Dec 2024 09:44:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fd6bb05-1657-4e34-a44a-e213b64840d6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. The only other thing I can think of is that the maximum length for the characteristic is lower? Which max_len was used when you added the characteristic with&amp;nbsp;sd_ble_gatts_characteristic_add() or indirectly with characteristic_add()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52833 increasing att mtu data length</title><link>https://devzone.nordicsemi.com/thread/514120?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 19:31:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8da16089-a5d2-45ee-b6f3-7439395656f5</guid><dc:creator>jacob jacob</dc:creator><description>&lt;p&gt;thanks for the response.&lt;br /&gt;this is my settup:&lt;br /&gt;NRF_SDH_BLE_GAP_DATA_LENGTH = 244&lt;br /&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 244&lt;br /&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH = 400&lt;br /&gt;&lt;br /&gt;I get the message in the debug terminal:&lt;br /&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 244 bytes on connection 0x3 (response).&lt;br /&gt;&lt;br /&gt;then when I call&amp;nbsp;sd_ble_gatts_value_set passing a .len of 40 I still get the following error:&lt;br /&gt;&amp;lt;error&amp;gt; app: ERROR 12 [NRF_ERROR_DATA_SIZE] at C:\Users\...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52833 increasing att mtu data length</title><link>https://devzone.nordicsemi.com/thread/514082?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 15:28:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f13c966-b352-4c66-acb4-838102ef2f8b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I assume you use the SoftDevice Handler (SDH) library which is used in the examples? If os, you should adjust a few parameters in sdk_config.h:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NRF_SDH_BLE_GAP_DATA_LENGTH&lt;/li&gt;
&lt;li&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE&lt;/li&gt;
&lt;li&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can refer to&amp;nbsp;examples/ble_peripheral/ble_app_uart/pca10056/s140/config/sdk_config.h for an example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>