<?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>Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20386/large-mtu-dle-softdevice-crash</link><description>Hello, 
 I have followed a couple of the posts on the devzone on how to increase the MTU and add the DLE support such as this . 
 However, whenever I send over 20 bytes of data I get an &amp;quot;app_error_fault&amp;quot;. 
 
 
 I have logging enabled and changed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Mar 2017 12:19:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20386/large-mtu-dle-softdevice-crash" /><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79473?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2017 12:19:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe7be1d0-c5ca-4d01-826d-f87bb09ee193</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;To check if UART is the problem, you can temporarily disable the UART functionality or for example transmit only one of the transmitted bytes per packet over UART.&lt;/p&gt;
&lt;p&gt;The example ble_central_and_peripheral/experimental/ble_att_mtu_throughput shows how to test long MTU, but it doesn&amp;#39;t transfer the received data over UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79472?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2017 04:18:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:791d2299-ef47-404e-acb1-181928126065</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;After doing some sleuthing on the crash data, it seems my error is in the softdevice_handler.c,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = sd_ble_evt_get(mp_ble_evt_buffer, &amp;amp;evt_len);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This function fails with a NRF_ERROR_DATA_SIZE&lt;/p&gt;
&lt;p&gt;My thought to fix this was to set the NRF_BLE_GATT_MAX_MTU_SIZE to allow for larger GATT chars.&lt;/p&gt;
&lt;p&gt;This seems to work with single long writes, but when I push a lot of data (1kb file) the nRF52 gets hung on FIFO handling.  Perhaps my UART is not able to push the data out fast enough?  At 115kbps for the uart you would think that would not pose any issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79471?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2017 09:17:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4f93432-37aa-4596-bed2-3b168f2a2705</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;In SDK 13.0.0 there is a GATT module that handles data length update related events, see gatt_init() --&amp;gt; nrf_ble_gatt_init(). Perhaps it could be useful to take a look at it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79475?ContentTypeID=1</link><pubDate>Thu, 16 Mar 2017 03:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f354216a-2dfc-4b6d-b7b8-d5ec8f9aa762</guid><dc:creator>Craig</dc:creator><description>&lt;p&gt;OK I have the same exact setup so that is good....what are you using to test it? Iphone? Android? What model? also I didn&amp;#39;t do anything other than the code I sent you so I don&amp;#39;t understand I can test tomorrow morning and verify my result....you shouldn&amp;#39;t have any probles....did you run a terminal and get any debug messages about the agreed upon MTU size?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79470?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2017 23:06:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab7e9bd9-14d5-4656-9050-1ff41fefb4b9</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;nrf52-DK, SDK 12.2,softdevice 3.1&lt;/p&gt;
&lt;p&gt;BLE uart com through the UART&lt;/p&gt;
&lt;p&gt;Debug logging through the j-link RTT&lt;/p&gt;
&lt;p&gt;RAM is changed in the linker&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79469?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2017 22:20:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9588f346-9b4d-49f7-bb2d-57aeb454c889</guid><dc:creator>Craig</dc:creator><description>&lt;p&gt;OK what cpu are you using exactly? what hardware are you using? devkit or your own? do you have access to a uart thru jlink? I have not tested it as I cannot until tonight or tomorrow morning.....please let me know and I can help you figure it out im sure...thanks for the advice on the RAM I also saw there is a file called app_ram_base.h which has all ram info for all configs!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79476?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2017 21:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03779018-748d-4091-802f-c51abdbe2ca4</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Craig,&lt;/p&gt;
&lt;p&gt;&lt;em&gt;how did you know how to set RAM?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The program checks it in ble_stack_init(), it is output over the j-link RTT window.  This is the code that checks the RAM settings:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//Check the ram settings against the used number of links
CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The only difference I see between your code and mine was this link after the GATT Connected callback:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_ble_gattc_exchange_mtu_request(m_conn_handle, NRF_BLE_MAX_MTU_SIZE);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Adding this didn&amp;#39;t seem to change anything, it works fine on small sends but breaks on large data transfers.  Have you tested your code for the throughput using larger packet sizes?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79477?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2017 18:38:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ef1a42b-18e3-4ecc-b116-8bb5a1f14bbe</guid><dc:creator>Craig</dc:creator><description>&lt;p&gt;Hey Luke, here are the changes you should make, also how did you know how to set RAM? I know how to do it so that it works but how do you KNOW what the start value is? I read it has to do with the softdevice taking up the first section of bytes so you cant obviously overwrite this....I can test it tonight but these changes should work from quick glance....&lt;/p&gt;
&lt;p&gt;#define NRF_BLE_MAX_MTU_SIZE            247&lt;/p&gt;
&lt;p&gt;static void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)
//{
/*
for (uint32_t i = 0; i &amp;lt; length; i++)
//{
while (app_uart_put(p_data[i]) != NRF_SUCCESS);
//}
while (app_uart_put(&amp;#39;\r&amp;#39;) != NRF_SUCCESS);
while (app_uart_put(&amp;#39;\n&amp;#39;) != NRF_SUCCESS);
*/
printf(&amp;quot;%d bytes rcvd!\r\n&amp;quot;, length);   //outputs to terminal such as PuTTY on COMx from JLINK in windows-&amp;gt;system
//}&lt;/p&gt;
&lt;p&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
//{
uint32_t err_code;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;switch (p_ble_evt-&amp;gt;header.evt_id)
//{
    case BLE_GAP_EVT_CONNECTED:
        err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
        APP_ERROR_CHECK(err_code);
        m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
        sd_ble_gattc_exchange_mtu_request(m_conn_handle, NRF_BLE_MAX_MTU_SIZE);
        break; // BLE_GAP_EVT_CONNECTED
  .......
//}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;//}&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
					printf(&amp;quot;Received BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST, client_rx_MTU: %d\r\n&amp;quot;, p_ble_evt-&amp;gt;evt.gatts_evt.params.exchange_mtu_request.client_rx_mtu);
        err_code = sd_ble_gatts_exchange_mtu_reply(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                                   NRF_BLE_MAX_MTU_SIZE);
        APP_ERROR_CHECK(err_code);
        break; // BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST
			case BLE_EVT_DATA_LENGTH_CHANGED:
					printf(&amp;quot;Received BLE_EVT_DATA_LENGTH_CHANGED\r\n&amp;quot;);
					printf(&amp;quot;The max number of payload octets the LL expects to receive %d \r\n&amp;quot;, p_ble_evt-&amp;gt;evt.common_evt.params.data_length_changed.max_rx_octets);
					printf(&amp;quot;The max number of payload octets the LL will send %d \r\n&amp;quot;, p_ble_evt-&amp;gt;evt.common_evt.params.data_length_changed.max_tx_octets);
					break;
			case BLE_EVT_TX_COMPLETE:
					// here you can for example set a flag that the buffer is now free and main() can wait on that flag.
					printf(&amp;quot;Received BLE_EVT_TX_COMPLETE\r\n&amp;quot;);
					break;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and also ensure in ble_nus.h:&lt;/p&gt;
&lt;p&gt;define BLE_NUS_MAX_DATA_LEN (GATT_MTU_SIZE_PKTLEN_EXT - 3)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79474?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2017 17:28:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b2fd84c-ba48-42dc-bc74-3d40cb8e0731</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Thanks for your help Craig.  &lt;a href="https://drive.google.com/file/d/0B0A7YXy4YSBYMVp2cWJvc1ZqOW8/view?usp=sharing"&gt;Here&lt;/a&gt; is my project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Large MTU + DLE Softdevice Crash</title><link>https://devzone.nordicsemi.com/thread/79468?ContentTypeID=1</link><pubDate>Sat, 11 Mar 2017 13:29:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47c8583b-2585-495a-82ac-54085ce52931</guid><dc:creator>Craig</dc:creator><description>&lt;p&gt;I just did this yesterday, can you post your files here? You need to request the MTU from the central upon connection established. You can use a function sd_ble_request_mtu() I believe that is what its called....I can lookup my notes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>