<?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>sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10214/sd_ble_gatts_characteristic_add-error-code-0x4-no-memory-for-operation</link><description>Hello all, I am using nRF51822 SDK8.1.0 SD130
The code was a central, and I want add a peripheral function.
I reference \examples\ble_central_and_peripheral\experimental 
 I got 2 error when I call void own_service_setup(void) 
 
 sd_ble_gatts_characteristic_add</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 14 Nov 2015 03:14:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10214/sd_ble_gatts_characteristic_add-error-code-0x4-no-memory-for-operation" /><item><title>RE: sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/thread/37896?ContentTypeID=1</link><pubDate>Sat, 14 Nov 2015 03:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:933c24fe-8668-4743-9c63-1d6519d94836</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;I see , Thanks :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/thread/37895?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 13:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d86b6e80-ba27-4919-884e-04619b7263e3</guid><dc:creator>Bill Siever</dc:creator><description>&lt;p&gt;frogofmagic,  I suspect the SoftDevice RAM segment has different internal buffers: 1) space to save the values of Characteristics and 2) space reserved for radio processing needs.  I&amp;#39;ve received these sorts of memory errors on projects that used several somewhat long characteristics (i.e., my data used all the internal buffer space available for characteristics).   I was able to work around the limitation by placing some of the characteristics in user RAM rather than have the Soft Device manage them (&lt;code&gt;vloc&lt;/code&gt; set to &lt;code&gt;BLE_GATTS_VLOC_USER&lt;/code&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/thread/37894?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 09:00:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8621e9da-0ade-4620-a36b-6bf2928877af</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi Bill, I found my IC is 16KB ram, and my code use 5.4KB and S130 use 10KB.
Will this cause the No Memory for operation error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/thread/37897?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 02:08:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8805d712-00ee-4c48-8337-491ad825a5d1</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi Bill, I&amp;#39;ll try it, thanks a lot. :D&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/thread/37892?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 02:05:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92072b33-0b37-4c42-9ebd-fd535a4611b1</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi Petter, Thanks for your advice.  I&amp;#39;m not sure my project can work on SDK9 or 10.
I will try it :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/thread/37891?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 12:55:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:573222bb-738a-4d4d-b9b6-ec251219839a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Do you mean \examples\ble_central_and_peripheral\experimental\app_s130_demo ? This is not a very good example. Maybe you can try \examples\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay from SDK 9 or 10?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ble_gatts_characteristic_add() error code 0x4 No Memory for operation.</title><link>https://devzone.nordicsemi.com/thread/37893?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 12:43:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:253c9721-af55-49b8-95fd-419e06644038</guid><dc:creator>Bill Siever</dc:creator><description>&lt;p&gt;This probably indicates that your characteristics are consuming all of the Soft Device memory that&amp;#39;s available for characteristics.&lt;/p&gt;
&lt;p&gt;If this is the case you can overcome it by keeping some characteristics in user memory.  You can do this by setting the &lt;code&gt;vloc&lt;/code&gt; variable of the characteristic&amp;#39;s &lt;code&gt;ble_gatts_attr_md_t&lt;/code&gt; to &lt;code&gt;BLE_GATTS_VLOC_USER&lt;/code&gt;.  You will need to make sure that you use persistent memory for the characteristics (like a global or static local variable rather than just a stack local).&lt;/p&gt;
&lt;p&gt;See &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v1.0.0%2Fstructble__gatts__attr__md__t.html"&gt;http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v1.0.0%2Fstructble__gatts__attr__md__t.html&lt;/a&gt; and search the forum for &lt;code&gt;vloc&lt;/code&gt; for more info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>