<?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>How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62427/how-to-configure-mtu-of-nrf52840-dongle</link><description>Hi, 
 When I used nRF52840 dongle (connectivity_5.1.0_usb_with_s132_5.1.0.uf2 firmware) to receive peripheral device notifications, nRF52840 dongle can only receive 20 bytes. The peripheral device has been configured to send 240 bytes notification and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 28 Jun 2020 02:33:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62427/how-to-configure-mtu-of-nrf52840-dongle" /><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/257243?ContentTypeID=1</link><pubDate>Sun, 28 Jun 2020 02:33:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33fc9b16-ccb6-49bc-9dfa-10cb4a83a6f2</guid><dc:creator>Banban</dc:creator><description>&lt;p&gt;&lt;span&gt;As you suggested, I&amp;nbsp;checked out&amp;nbsp;ble_app_uart_c&amp;nbsp;example, but&amp;nbsp;nrf_ble_gatt_att_mtu_central_set() is&amp;nbsp;&lt;span class="" id="w_93"&gt;not&amp;nbsp;&lt;/span&gt;&lt;span class="" id="w_94"&gt;available in win10 operating system.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/255392?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 06:24:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45381e9b-85c0-425b-9900-e1a27b64987d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;This is just the default size that will be used in the start of any connection. You should leave it as 23.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suggest that you check out the ble_app_uart and the ble_app_uart_c examples. They both use&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247.&lt;/p&gt;
&lt;p&gt;See how it is used in gatt_init() in main.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for initializing the GATT library. */
void gatt_init(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the callback:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for handling events from the GATT library. */
void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
{
    if ((m_conn_handle == p_evt-&amp;gt;conn_handle) &amp;amp;&amp;amp; (p_evt-&amp;gt;evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))
    {
        m_ble_nus_max_data_len = p_evt-&amp;gt;params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
        NRF_LOG_INFO(&amp;quot;Data len is set to 0x%X(%d)&amp;quot;, m_ble_nus_max_data_len, m_ble_nus_max_data_len);
    }
    NRF_LOG_DEBUG(&amp;quot;ATT MTU exchange completed. central 0x%x peripheral 0x%x&amp;quot;,
                  p_gatt-&amp;gt;att_mtu_desired_central,
                  p_gatt-&amp;gt;att_mtu_desired_periph);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It will print the MTU that the central and peripheral will agree upon.&lt;/p&gt;
&lt;p&gt;Check what you get in the MTU callback.&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/255372?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 02:32:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5524b92-e3d1-4908-b1a3-c4b272092c61</guid><dc:creator>Banban</dc:creator><description>&lt;p&gt;I compiled pc-ble-driver that downloaded from&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/releases/tag/v4.1.1"&gt;https://github.com/NordicSemiconductor/pc-ble-driver/releases/tag/v4.1.1&lt;/a&gt;&lt;span&gt;. And the nRF52840 dongle received 20 bytes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I found this file - &amp;quot;pc-ble-driver-4.1.1\hex\nRF5_SDK_15.3.0_connectivity.patch&amp;quot;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Line 3783:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;+/** @brief Default MTU size, in bytes. */&lt;br /&gt;+#define GATT_MTU_SIZE_DEFAULT 23&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I changed this definition:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;+#define GATT_MTU_SIZE_DEFAULT 250&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But&amp;nbsp;the nRF52840 dongle stll received 20 bytes!&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><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/255081?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 15:40:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddb569fd-32ab-4bc7-97f7-b8b1404355df</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Does it use att_mtu = 240 by default? If so, I would guess. My point is that if you see that it doesn&amp;#39;t support more than 20 bytes, you need to find out where in your &amp;quot;blackbox&amp;quot; this is limited. With the example that I linked to, you can configure this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And I still recommend you to get hold of a DK, so that you can debug in realtime.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/255043?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 13:28:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5511abe7-0fa0-487e-89a2-b9b38c3dc03b</guid><dc:creator>Banban</dc:creator><description>&lt;p&gt;I found this prigram from&amp;nbsp;pc-ble-driver\examples\heart_rate_collector.&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;ble_cfg, 0x00, sizeof(ble_cfg));&lt;br /&gt;ble_cfg.conn_cfg.conn_cfg_tag = conn_cfg_tag;&lt;br /&gt;ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = 240;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;error_code = sd_ble_cfg_set(m_adapter, BLE_CONN_CFG_GATTC, &amp;amp;ble_cfg, ram_start);&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;&lt;span&gt;the ble_connectivity support 250 bytes, will sd_ble_cfg_set(m_adapter() configure MTU to 240 bytes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And will nRF52840 dongle receive 240 bytes?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/255034?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 13:11:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90e86e76-7e24-4648-8780-f71183dbd885</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;That FW doesn&amp;#39;t support connectivity over 20 bytes, is my guess. You should compile your own. Use the example from the path in the previous reply, the ble_connectivity example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/254873?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 06:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83bd5474-8a7e-46d2-9a6b-978173dbf8df</guid><dc:creator>Banban</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I used the connectivity(connectivity_4.1.1_usb_with_s140_6.1.1) which was downloaded from&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/releases/tag/v4.1.1"&gt;https://github.com/NordicSemiconductor/pc-ble-driver/releases/tag/v4.1.1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1592203209687v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The nRF52840 dongle only received 20 bytes, at the same time, Iphone can receive 240 bytes.&lt;/p&gt;
&lt;p&gt;How to configure nRF52840 dongle MTU?&lt;/p&gt;
&lt;p&gt;Is this program enough?&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;ble_cfg, 0x00, sizeof(ble_cfg));&lt;br /&gt;ble_cfg.conn_cfg.conn_cfg_tag = conn_cfg_tag;&lt;br /&gt;ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = 240;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;error_code = sd_ble_cfg_set(m_adapter, BLE_CONN_CFG_GATTC, &amp;amp;ble_cfg, ram_start);&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure MTU of nRF52840 dongle?</title><link>https://devzone.nordicsemi.com/thread/254489?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 12:37:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cd5d2d5-364c-4a89-92d0-ec66f1db60da</guid><dc:creator>Edvin</dc:creator><description>[quote user=""]The&amp;nbsp;peripheral device&amp;nbsp;has been&amp;nbsp;configured to send 240 bytes notification and Iphone received 240 bytes&amp;nbsp;notifications correctly.[/quote]
&lt;p&gt;&amp;nbsp;What happens to the peripheral if it enters a connection that doesn&amp;#39;t support more than 23 bytes of MTU? Does it still send 240 bytes?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect that the &lt;span&gt;connectivity_5.1.0_usb_with_s132_5.1.0.uf2 doesn&amp;#39;t support MTU higher than 23 bytes, and then it would be impossible to send more than 20 bytes of payload in a packet.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Where exactly did you find&amp;nbsp;connectivity_5.1.0_usb_with_s132_5.1.0.uf2?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Perhaps you rather want to look into the SDK16.0.0\examples\connectivity\ble_connectivity - example?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Or even use some custom ble_peripheral?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Even before that, I would suggest that you get hold of an nRF52840 DK for your development. The dongle doesn&amp;#39;t have a debugger, so it is very hard to actually develop on the dongle. Once it is working on a DK you can port it to the dongle, if you need the dongle&amp;#39;s form factor.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>