<?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: Characteristics Per Service Limit</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/270/sd-characteristics-per-service-limit</link><description>Is there a limit to the number of characteristics per (custom) service? 
 After some testing, it looks like 20 is the maximum (21 causes the device to stop functioning) - is this corrrect and is it documented somewhere? 
 Thanks :)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Aug 2016 18:40:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/270/sd-characteristics-per-service-limit" /><item><title>RE: SD: Characteristics Per Service Limit</title><link>https://devzone.nordicsemi.com/thread/1465?ContentTypeID=1</link><pubDate>Thu, 04 Aug 2016 18:40:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f80acd9b-620d-4495-8606-32d1cce7b168</guid><dc:creator>jtrovato</dc:creator><description>&lt;p&gt;What soft device is this for? Is this information current? Is that same limitation on the S130 SD 2.0.0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD: Characteristics Per Service Limit</title><link>https://devzone.nordicsemi.com/thread/1468?ContentTypeID=1</link><pubDate>Tue, 16 Dec 2014 20:54:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2df777f-1329-407f-976d-d87b05058085</guid><dc:creator>Jens Meder</dc:creator><description>&lt;p&gt;I guess there is still no option to increase the size of the GATT table? This limit is causing some inconveniences for our project at the moment. Would be a awesome if you could include that in your next update or at least increase the size to let&amp;#39;s say 3KB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD: Characteristics Per Service Limit</title><link>https://devzone.nordicsemi.com/thread/1467?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2013 08:53:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24664b07-7582-40ef-ac5b-cac83cc0dfa2</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;ve checked this again, and I found out that I was wrong about the exact size of this table, but correct apart from that. There isn&amp;#39;t any particular limit of the number of characteristics.&lt;/p&gt;
&lt;p&gt;When you combine characteristics, there will be fewer attributes in the table, giving less overhead, which is perfectly reasonable considering the way things work. I unfortunately don&amp;#39;t have an exact number for the overhead per attribute.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve edited my answer below slightly for clarity.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD: Characteristics Per Service Limit</title><link>https://devzone.nordicsemi.com/thread/1466?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2013 08:26:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6753f50-de91-4cc4-a316-4ae787793428</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Actually, in terms of my attributes, 72 bytes out of a total of 94 bytes is actually being stored in flash memory using the VLOC_USER option. So really, only 22 bytes of attributes is being stored on the SD stack.&lt;/p&gt;
&lt;p&gt;This led me to me believe that the limit is based on the number of characteristics and not the amount of stack data they consume...&lt;/p&gt;
&lt;p&gt;Combining &lt;strong&gt;nine&lt;/strong&gt; 2-byte characteristics into a &lt;strong&gt;single&lt;/strong&gt; characteristic of 18-bytes stopped the crashing which further supports this assumption.&lt;/p&gt;
&lt;p&gt;However, I also understand that there is overhead in addition to the attribute data for each characteristic (in reference to your final sentence).&lt;/p&gt;
&lt;p&gt;So, how large is the overhead (in bytes) for each characteristic (i.e. stack required not including attribute data)?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD: Characteristics Per Service Limit</title><link>https://devzone.nordicsemi.com/thread/1464?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2013 08:17:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e9a3a7c-992d-4752-8955-14cc930adff9</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;The way this works is that there is a static 1.5 kB of memory allocated for the GATT table internally in the softdevice. These can be used for any combination of services, characteristics and descriptors, so there isn&amp;#39;t a specific limit as such. Each attribute that is in the attribute table consumes of this memory block, both with its size and some overhead per attribute.&lt;/p&gt;
&lt;p&gt;There is currently no way to increase these 1.5 kB. The only thing you can do is to change characteristics from VLOC_STACK to VLOC_USER. This will move the actual characteristic value out of these 1.5 kB and into the application&amp;#39;s RAM space, and hence allow you to add more characteristics. Please note that the effect of doing such move is biggest for characteristics with large values.&lt;/p&gt;
&lt;p&gt;If you try to add more that what there is room for, you will get an error code back, which will normally make your application end up in app_error_handler on top of main.c. This will by default do a reset, but if you uncomment the debug assert handler, it will instead hang in a loop allowing you to inspect where things failed and with what error code.&lt;/p&gt;
&lt;p&gt;Edit: Changed size to the correct 1.5 kB, and changed some parts for clarity.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>