<?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>Beacon and GATT: NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37640/beacon-and-gatt-nrf_error_no_mem</link><description>HI guys, 
 I am running a beacon based on the ble_app_beacon example. This works fine. 
 Next, I made a connectable GAP/GATT application to read and make some settings. This is based on the ble_app_hrs example, and also works fine. 
 Finally, I wanted</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 15 Sep 2018 08:33:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37640/beacon-and-gatt-nrf_error_no_mem" /><item><title>RE: Beacon and GATT: NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/148869?ContentTypeID=1</link><pubDate>Sat, 15 Sep 2018 08:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:170f093e-8b3d-4f8a-a07b-8eec672f14c3</guid><dc:creator>Henk Pragt</dc:creator><description>&lt;p&gt;Hi Simon,&lt;br /&gt;brilliant! Thanks a lot, this runs indeed and I would not have found the cause in a month of Sundays. &lt;/p&gt;
&lt;p&gt;I owe you one (aquavit?)&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Henk&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon and GATT: NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/148746?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 08:55:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9912339c-1aaa-430c-ab67-c2b1cfafd588</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;After some trial and error I was able to successfully merge the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fble_sdk_app_hrs.html"&gt;Heart Rate Example&lt;/a&gt;&amp;nbsp;with the&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fble_sdk_app_beacon.html"&gt;Beacon Transmitter Sample Example&lt;/a&gt;&amp;nbsp;using SDK v15.2.0. However, initially I got the same error as you (&lt;em&gt;NRF_ERROR_NO_MEM&lt;/em&gt;), and the reason was because the two examples uses different levels of API.&lt;/p&gt;
&lt;p&gt;Let me explain more in depth. The Beacon example uses the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s112.api.v6.1.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html"&gt;GAP Module&lt;/a&gt;&amp;nbsp;(ble_gap.h)&amp;nbsp;directly, while Heart Rate (HR) example uses the advertising module&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fgroup__ble__advertising.html"&gt;Advertising Module&lt;/a&gt;&amp;nbsp;(which uses the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s112.api.v6.1.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html"&gt;GAP Module&lt;/a&gt;). Thus, the Beacon example uses the SV call&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s112.api.v6.1.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga9969047f4e7485c3f856c841978cc31a"&gt;sd_ble_gap_adv_set_configure(..)&lt;/a&gt;&lt;span style="font-weight:400;"&gt;&amp;nbsp;directly from main, while the HR example calls &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fgroup__ble__advertising.html&amp;amp;anchor=gabbdf62a76d64fc8d5e5b0d183d3c0fa7"&gt;ble_advertising_init(..)&lt;/a&gt;→&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s112.api.v6.1.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga9969047f4e7485c3f856c841978cc31a"&gt;sd_ble_gap_adv_set_configure(..)&lt;/a&gt; from main.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;When switching from beacon advertising to connectable advertising, the following line inside &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fgroup__ble__advertising.html&amp;amp;anchor=gabbdf62a76d64fc8d5e5b0d183d3c0fa7"&gt;ble_advertising_init(..)&lt;/a&gt;&amp;nbsp;will be called:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (!p_advertising-&amp;gt;initialized)
{
    p_advertising-&amp;gt;adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Since the beacon example didn&amp;#39;t use the advertising module, &lt;em&gt;p_advertising-&amp;gt;initialized&lt;/em&gt; is never set to true. Then the handle will be set to&amp;nbsp;&lt;em&gt;BLE_GAP_ADV_SET_HANDLE_NOT_SET&lt;/em&gt;, and when calling &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s112.api.v6.1.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga9969047f4e7485c3f856c841978cc31a"&gt;sd_ble_gap_adv_set_configure(..)&lt;/a&gt;&lt;em&gt;,&amp;nbsp;&lt;/em&gt;the same handle will not be used, resulting in the error&amp;nbsp;&lt;em&gt;NRF_ERROR_NO_MEM.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;I solved this by running&amp;nbsp;&lt;i&gt;m_advertising.initialized = true;&amp;nbsp;&lt;/i&gt;before starting the connectable advertising.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Here is the working code (SDK v15.2.0):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-7b877ce3d27c4bb096d009a0dabba1ee/ble_5F00_app_5F00_hrs_5F00_with_5F00_beacon.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_hrs_5F00_with_5F00_beacon.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight:400;"&gt;Best regards, Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon and GATT: NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/148537?ContentTypeID=1</link><pubDate>Thu, 13 Sep 2018 08:07:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e730f25-96c9-493d-ad32-4763d454a91f</guid><dc:creator>Henk Pragt</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;still no luck with this problem.&lt;/p&gt;
&lt;p&gt;I struggle with the different calls to &lt;em&gt;ble_advertising_init&lt;/em&gt;. The beacon&amp;nbsp; example uses &amp;quot;&lt;em&gt;ble_gap_adv_params_t&lt;/em&gt;&amp;quot; and calls &lt;em&gt;sd_ble_gap_adv_set_configure&lt;/em&gt;() to initialize the advertizing. The HRS example uses macro &lt;em&gt;BLE_ADVERTISING_DEF&lt;/em&gt; to declare a &amp;quot;&lt;em&gt;ble_advertising_t&lt;/em&gt;&amp;quot; structure that incorporates the&amp;nbsp; &amp;quot;&lt;em&gt;ble_gap_adv_params_t&lt;/em&gt;&amp;quot; and calls &lt;em&gt;ble_advertising_init&lt;/em&gt;().&lt;/p&gt;
&lt;p&gt;I tried to have both functions use the same data structure, but whatever I try the call to &lt;em&gt;ble_advertising_init&lt;/em&gt;() returns either a &lt;em&gt;NRF_ERROR_NO_MEM&lt;/em&gt; or a &lt;em&gt;NRF_ERROR_INVALID_PARAM&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Do you know of any complete and runnable example code that shows how to do this? The example you mentioned does not show how to declare the various structures.&lt;/p&gt;
&lt;p&gt;thanks for you help,&lt;/p&gt;
&lt;p&gt;Henk&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon and GATT: NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/146750?ContentTypeID=1</link><pubDate>Fri, 31 Aug 2018 11:46:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd752a50-2b65-4ff3-b65c-8472472c5d16</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I am glad to help. Please ask if you have any more questions.&lt;/p&gt;
&lt;p&gt;Cheers, Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon and GATT: NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/146334?ContentTypeID=1</link><pubDate>Wed, 29 Aug 2018 13:43:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be1cd481-ba8d-48b6-a208-c89b603ad542</guid><dc:creator>Henk Pragt</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;thanks for your reply. It looks like exactly the info I needed. I will try this next week. I only hope that it does not mean there is practically no RAM left for my application, if one additional advertising structure causes an out-of-memory.&lt;/p&gt;
&lt;p&gt;Henk&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon and GATT: NRF_ERROR_NO_MEM</title><link>https://devzone.nordicsemi.com/thread/145515?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 12:48:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffec830f-dd7c-44df-a5a5-481d2d1e4516</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/30823/how-to-switch-the-functions-between-beacon-advertising-to-connectable-advertising"&gt;Here&lt;/a&gt;&amp;nbsp;is a&amp;nbsp;similar case that might help you solve the problem.&lt;/p&gt;
&lt;p&gt;Regarding you question, according to the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.0.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=2_3_2_1_0_2_1_2_2&amp;amp;anchor=ga9969047f4e7485c3f856c841978cc31a"&gt;S132 SoftDevice v6.0.0 API&lt;/a&gt;, if &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.0.0%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;cp=2_3_2_1_0_2_1_2_2&amp;amp;anchor=ga9969047f4e7485c3f856c841978cc31a"&gt;sd_ble_gap_adv_set_configure(..)&lt;/a&gt;&amp;nbsp;returns NRF_ERROR_NO_MEM, the following is mentioned:&lt;em&gt; &amp;quot;Not enough memory to configure a new advertising handle. Update an existing advertising handle instead&amp;quot;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Try&amp;nbsp;using same handle as used when configuring the advertising set for the beacon advertiser.&lt;/p&gt;
&lt;p&gt;Best regards Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>