<?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>Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3097/maximum-number-of-characteristics</link><description>Hi
I am using S110 v6.0.0
I have written an app that has a single service and I then register the same characteristics until it fails. The properties is 0xA (read/write).
When I use _VLOC_STACK it runs out of memory and for value len=10 I can register</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Jul 2014 08:06:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3097/maximum-number-of-characteristics" /><item><title>RE: Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/thread/11505?ContentTypeID=1</link><pubDate>Mon, 14 Jul 2014 08:06:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7749382b-f51c-4906-b55e-22779b3bf1ab</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;Hi
If I always use VLOC_USER ...&lt;/p&gt;
&lt;p&gt;For 128 bit uuids ... (and Characteristics with 0xA property plus 20 byte length)&lt;/p&gt;
&lt;p&gt;With 1 svc, I can install 30 characteristics.
With 4 svcs it drops to 28 characteistics.
with 8 svcs it drops to 25 characteristics.&lt;/p&gt;
&lt;p&gt;If I use 16 bit uuid ... (and Characteristics with 0xA property plus 10 byte length), then&lt;/p&gt;
&lt;p&gt;With 1 svc, I can install 45 characteristics.
With 4 svcs it drops to 44 characteistics.
with 8 svcs it drops to 42 characteristics.&lt;/p&gt;
&lt;p&gt;This seems to suggest the gatt table is populated with the actual uuid numbers (2 or 16 bytes) and not the uuid handles.&lt;/p&gt;
&lt;p&gt;I have not yet moved over to the latest 7.0.0 stack. Anyone care to comment if it is likely to be different?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/thread/11504?ContentTypeID=1</link><pubDate>Sat, 12 Jul 2014 21:31:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:622d8c2f-3737-49bd-81ae-6a3db4988645</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;Hi
Thank you for the feedback. I managed to find the issue in my case. I was using VLOC_USER in all the places - even for the CCCD. Once I modified it to just have VLOC_USER for the char values I got further.
And yes, I provide p_value as a pointer to a buffer that I manage. What I do is ...
unsigned char myCharBufs[600];
int myCharBufFree=0;&lt;/p&gt;
&lt;p&gt;And then each time I register a value I copy the data to myCharBufs[myCharBufFree] and then do
myCharVufFree += Length_of_char_value;&lt;/p&gt;
&lt;p&gt;I have found that the maximum chars I can register is 30 if the uuid for the char is 128 bit. If the uuid is 16 bit , then I can register 44&lt;/p&gt;
&lt;p&gt;Hence the absolute maximum one is going to achieve in v6.0.0 is 44.&lt;/p&gt;
&lt;p&gt;Which seems to suggest that Nordic are populating the gatt table with the actual uuid values and NOT the 4 byte uuid handles.&lt;/p&gt;
&lt;p&gt;Many thanks for the feedback.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/thread/11503?ContentTypeID=1</link><pubDate>Sat, 12 Jul 2014 19:32:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1c4bbe5-a398-49e8-b93e-2f99675abb26</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;See ble_gatts_attr_t here &lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/5.2.0/html/a00270.html"&gt;devzone.nordicsemi.com/.../a00270.html&lt;/a&gt;
You should have to set the p_value to a buffer when using VLOC_USER.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/thread/11502?ContentTypeID=1</link><pubDate>Sat, 12 Jul 2014 11:06:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9605576d-3fe7-4179-86f3-6a40412381ec</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;I am using v6.0.0. Does anyone know if the behaviour on newer stack is different?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/thread/11501?ContentTypeID=1</link><pubDate>Sat, 12 Jul 2014 11:05:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f670bf2-9c71-41b9-8d18-953524d3122a</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;Another observation
I have test code that uses VLOC_STACK and I register chracteristics with various different properties.
They all successfully register.&lt;/p&gt;
&lt;p&gt;I then change the firmware so that where I use VLOC_STACK I specify VLOC_USER. In this case only the properties with 0xA value succeeds. All the others come back with INVALID_PARAM error code.&lt;/p&gt;
&lt;p&gt;Question, why should just changing the location of the memory make that happen?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/thread/11507?ContentTypeID=1</link><pubDate>Sat, 12 Jul 2014 08:28:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96d35ada-19fc-468d-9088-59fdcef65a95</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;Hi Thank you for getting back. You say &amp;quot;The rest of the characteristics can then be added with VLOC_USER.&amp;quot; Not true because even for VLOC_USER (for everything) it needs to use the &amp;#39;stack&amp;#39; memory for the uuid and the handles. That is why when I use VLOC_USER for everything I still run out of memory.&lt;/p&gt;
&lt;p&gt;A customer has asked for the 33 characteristics. They are king :-) we have to make it happen if in our powers. We pride ourselves in customer service.&lt;/p&gt;
&lt;p&gt;Another curious behaviour, which is very annoying as I cannot fathom the reason yet ...&lt;/p&gt;
&lt;p&gt;I have a test application where I register a character with property = 0x2A (read/write/indicatable) with VLOC_STACK and it works.&lt;/p&gt;
&lt;p&gt;I changed the application so that it has VLOC_USER ( I stress no other change) and now the function sd_ble_gatts_characteristic_add() is returning with an nrf error of 7 (INVALID PARAMETER)&lt;/p&gt;
&lt;p&gt;Why does just changing the location memory make the parameters fail?&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t find any documentation to tell me WHICH parameter is inva&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Maximum number of characteristics</title><link>https://devzone.nordicsemi.com/thread/11506?ContentTypeID=1</link><pubDate>Fri, 11 Jul 2014 22:49:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1984459b-b818-4820-83f7-efa42b5f4a87</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;You should be able to use a combination of both.&lt;/p&gt;
&lt;p&gt;The stack memory allotted is already reserved for GATT, so you can use that until you run out. The rest of the characteristics can then be added with VLOC_USER.&lt;/p&gt;
&lt;p&gt;It seems strange to have that many services and characteristics added though. Are you positive that you need to implement 33 characteristics for your needs?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>