<?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>SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51340/sdk-code-is-getting-hanged-in-do-while-loop-with-nrf_error_no_mem</link><description>Hi, I am beginner for nRF51822. We are using SDK v10 and S120. 
 We have an IOT Gateway with it&amp;#39;s processor interfaced with nRF51822 radio through UART. We have flashed nRF51822 radio with ble_central application with our changes. The radio on Gateway</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Sep 2019 13:00:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51340/sdk-code-is-getting-hanged-in-do-while-loop-with-nrf_error_no_mem" /><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/207692?ContentTypeID=1</link><pubDate>Tue, 03 Sep 2019 13:00:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a7a7d07-3ee3-4993-8742-4e8038094374</guid><dc:creator>Durgesh Tanuku</dc:creator><description>&lt;p&gt;Hi edvin,&lt;br /&gt;&lt;br /&gt;Sorry for late reply. This issue was introduced by previous developers by modifying the&amp;nbsp;SDK&amp;nbsp;code. ser_conn_ble_event_encoder() is directly invoked from&amp;nbsp;ser_conn_ble_event_handle() instead of using&amp;nbsp;app_sched_event_put(). I have removed custom changes in SDK code and issue is not happening now.&lt;br /&gt;Thanks for your support.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/207012?ContentTypeID=1</link><pubDate>Fri, 30 Aug 2019 07:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00e1d59d-3c6c-45f0-a5ec-45d870ef27bf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I had to forward this ticket to our SDK team, who worked on the serialization project. I haven&amp;#39;t heard back from them yet. I will let you know as soon as I have an update.&lt;/p&gt;
&lt;p&gt;Please also let me know if you find anything new in the meantime.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/206487?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 05:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bf6e604-37a2-44af-9d5e-d61bfde03d8a</guid><dc:creator>Durgesh Tanuku</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;br /&gt;&lt;br /&gt;In another instance of the similar issue, code was stuck in NRF_ERROR_NO_MEM due to HAL_TRANSP_TX_STATE_TX_ALLOCATED state of the buffer.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Below is the corresponding GDB stack trace.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;#0 SEGGER_RTT_vprintf (BufferIndex=BufferIndex@entry=0, sFormat=0x26a77 &amp;quot;M : %d\r\n&amp;quot;, sFormat@entry=0x2000329a &amp;lt;m_ble_evt_buffer_size&amp;gt; &amp;quot;H&amp;quot;, &lt;br /&gt; pParamList=0x20003f1c, pParamList@entry=0x20003f04)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/drivers_ext/segger_rtt/SEGGER_RTT_printf.c:439&lt;br /&gt;#1 0x00026232 in log_rtt_printf (terminal_index=terminal_index@entry=0, format_msg=0x26a68 &amp;quot;NRF_ERROR_NO_MEM : %d\r\n&amp;quot;)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/libraries/util/nrf_log.c:39&lt;br /&gt;#2 0x00023970 in ser_hal_transport_tx_pkt_alloc (pp_memory=pp_memory@entry=0x20003f38, p_num_of_bytes=p_num_of_bytes@entry=0x20003f3c)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/serialization/common/transport/ser_hal_transport.c:406&lt;br /&gt;#3 0x000234b0 in ser_conn_ble_event_encoder (p_event_data=p_event_data@entry=0x20002c34 &amp;lt;BLE_EVT_BUFFER.6626&amp;gt;, event_size=&amp;lt;optimized out&amp;gt;)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/serialization/connectivity/ser_conn_event_encoder.c:41&lt;br /&gt;#4 0x0002360a in ser_conn_ble_event_handle (p_ble_evt=0x20002c34 &amp;lt;BLE_EVT_BUFFER.6626&amp;gt;)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/serialization/connectivity/ser_conn_handlers.c:165&lt;br /&gt;#5 0x0002568c in intern_softdevice_events_execute ()&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/softdevice/common/softdevice_handler/softdevice_handler.c:138&lt;br /&gt;#6 0x0002578c in intern_softdevice_events_execute ()&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/softdevice/common/softdevice_handler/softdevice_handler.c:77&lt;br /&gt;#7 SWI2_IRQHandler ()&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/softdevice/common/softdevice_handler/softdevice_handler.c:333&lt;br /&gt;#8 &amp;lt;signal handler called&amp;gt;&lt;br /&gt;#9 0x000265b6 in memcpy ()&lt;br /&gt;#10 0x0001f79a in ble_gattc_evt_read_rsp_enc (p_event=0x20002d4c &amp;lt;APP_SCHED_BUF.6623+208&amp;gt;, event_len=&amp;lt;optimized out&amp;gt;, p_buf=&amp;lt;optimized out&amp;gt;, &lt;br /&gt; p_buf_len=0x20003fcc)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/serialization/connectivity/codecs/s120/serializers/ble_gattc_evt_read_rsp.c:43&lt;br /&gt;#11 0x0001d3cc in ble_event_enc (p_event=p_event@entry=0x20002d4c &amp;lt;APP_SCHED_BUF.6623+208&amp;gt;, event_len=event_len@entry=0, &lt;br /&gt; p_buf=&amp;lt;optimized out&amp;gt;, p_buf_len=p_buf_len@entry=0x20003fcc)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/serialization/connectivity/codecs/s120/serializers/ble_event.c:126&lt;br /&gt;#12 0x000234d2 in ser_conn_ble_event_encoder (p_event_data=0x20002d4c &amp;lt;APP_SCHED_BUF.6623+208&amp;gt;, event_size=&amp;lt;optimized out&amp;gt;)&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/serialization/connectivity/ser_conn_event_encoder.c:51&lt;br /&gt;#13 0x00024908 in app_sched_execute ()&lt;br /&gt; at git_working_directory/nordic_sdk_10/components/libraries/scheduler/app_scheduler_serconn.c:246&lt;br /&gt;#14 0x00024ea0 in main () at git_working_directory/nordic_sdk_10/examples/ble_central/ble_connectivity/main.c:76&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;From the stack trace it seems that in frame 12 (in file&amp;nbsp;&lt;span&gt;ser_conn_event_encoder.c)&amp;nbsp;ser_hal_transport_tx_pkt_alloc() was called and m_tx_state was set to&amp;nbsp;HAL_TRANSP_TX_STATE_TX_ALLOCATED. After that, before sending this packet to transmit&amp;nbsp;SWI2_IRQHandler () was invoked in frame 8. In interrupt handler context it is again trying to allocate buffer and got stuck there.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So is there any way to deffer&amp;nbsp;SWI2_IRQHandler ()&amp;nbsp;interrupt ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/206029?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 07:57:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c62262d4-e73f-4b92-a1c4-fd589a8afabb</guid><dc:creator>Edvin</dc:creator><description>[quote user="Durgesh Tanuku"]We are using UART and flow control&amp;nbsp;was not enabled.[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ok. That was what I wanted to check, because if for some reason flow control was enabled, and the other chip doesn&amp;#39;t allow the nRF to send the message. That doesn&amp;#39;t seem to be the case.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am looking a bit in the serialization project now. m_tx_state is only set to HAL_TRANSP_TX_STATE_TRANSMITTING on line 443 in ser_hal_transport.c.&lt;/p&gt;
&lt;p&gt;Are you able to get any information on what message that is the last one that is set?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The two other places that HAL_TRANSP_TX_STATE_TRANSMITTING is used is in ser_hal_transport.c on line 115 and 260. in phy_events_handler(). Can you see if phy_events_handler is called after it is stuck in NRF_ERROR_NO_MEM? And if so, what type of event is it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/205921?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2019 13:54:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:468c0aa0-3926-4534-a5da-e432cd3c6729</guid><dc:creator>Durgesh Tanuku</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for your suggestion.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;We are using UART and flow control&amp;nbsp;was not enabled. I have enabled Hardware flow control in both application and host chips. But still facing the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/205870?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2019 11:28:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:410c2ef5-0290-4b23-9e08-77e4598a180b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok. Thank you for confirming.&lt;/p&gt;
&lt;p&gt;What serial transport platform do you use for your serialization? Are the nRF and other µcontroller connected via SPI, UART or TWI?&lt;/p&gt;
&lt;p&gt;If it is UART, is flow control enabled?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/205842?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2019 10:31:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fec772c8-6779-499d-adb4-b34a06d29430</guid><dc:creator>Durgesh Tanuku</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Yes, It is always stuck there and not returning forever.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I have increased the connection interval from 40ms to 128ms. Still no luck. Facing the same issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Durgesh&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK code is getting hanged in do-while loop with NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/205812?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2019 09:00:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4521533d-6d11-4b74-9bcf-f5a0b932c916</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It looks like there are no free buffer space in the packet processing. It will probably return this from time to time. Are you sure that it is always stuck there, and that it doesn&amp;#39;t eventually return NRF_SUCCESS, and then the next packet is returning NRF_ERROR_NO_MEM?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It may also be that there simply are too many packets coming in. Can you, just for testing purposes, try to increase the connection interval from your application chip?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>