<?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>BLE multiple services and characteristics not working, error code 4 after service_init() function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54704/ble-multiple-services-and-characteristics-not-working-error-code-4-after-service_init-function</link><description>Hello, 
 
 I am new to Nordic platform, previously i had worked on TI controller. 
 I have three questions to ask: 
 1) My firmware consists of four services, each service has around 8-10 characterisitics. Now i have initialized four services. Its working</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Nov 2019 08:01:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54704/ble-multiple-services-and-characteristics-not-working-error-code-4-after-service_init-function" /><item><title>RE: BLE multiple services and characteristics not working, error code 4 after service_init() function</title><link>https://devzone.nordicsemi.com/thread/222522?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 08:01:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80db94d8-e279-4c6a-88b7-8e2830290995</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll need to change the NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE in order to make room for more characteristics. In turn, this will increase the Softdevice&amp;#39;s RAM usage, which means that you may have to change RAM start and RAM size for the application after this increase. More details on the matter in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32750/error-add-multi-characteristic-to-service"&gt;this case&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE multiple services and characteristics not working, error code 4 after service_init() function</title><link>https://devzone.nordicsemi.com/thread/222289?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 10:19:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28cb4f7c-54f4-400c-9c5a-39a4e63913dd</guid><dc:creator>Namdev</dc:creator><description>&lt;p&gt;in the service init the last function which is getting initialized returns the error. if i add an extra characterisitic to any of the service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I personally feel i need to increase the RAM size but i am still not sure why we need to improve the RAM size. i am just adding the multiple characterisitics under a service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have implemented in the same way as mentioned in the other question posted in the forum.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE multiple services and characteristics not working, error code 4 after service_init() function</title><link>https://devzone.nordicsemi.com/thread/221739?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 07:23:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c1c3d3e-17ef-47cf-a029-4767b31b424a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Namdev&lt;/p&gt;
&lt;p&gt;What function is it that returns this error? Try stepping through the code in order to see which function it is that returns error code 4.&lt;/p&gt;
&lt;p&gt;You can check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/21385/ble-characteristics-tutorial---multiple-values/192187#192187"&gt;this &lt;/a&gt;and &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/21477/how-is-ble_conn_handle_invalid-changed-in-multiple-services"&gt;this &lt;/a&gt;link in order to check that you&amp;#39;re adding multiple characteristics/services to your application correctly.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE multiple services and characteristics not working, error code 4 after service_init() function</title><link>https://devzone.nordicsemi.com/thread/221488?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 08:51:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b655a67c-1e4b-49c3-9502-17d54d5fca3f</guid><dc:creator>Namdev</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I am using SES(Segger embedded studio).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the problem is:&lt;/p&gt;
&lt;p&gt;there are four services. I have added 4 characteristics in service 1.&lt;/p&gt;
&lt;p&gt;again 3 characteristics in service 2, 3 characterisitcs in service 3 and 5 characteristics in service 4.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now if i add even a single characteristic in any of the service it will return error code 4.&lt;/p&gt;
&lt;p&gt;static void services_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;br /&gt; ble_cus_init_t cus_init;&lt;br /&gt; ble_calib_init_t calib_init;&lt;br /&gt; ble_oper_init_t oper_init;&lt;br /&gt; ble_config_init_t config_init;&lt;br /&gt; ble_device_init_t device_init;&lt;/p&gt;
&lt;p&gt;nrf_ble_qwr_init_t qwr_init = {0};&lt;/p&gt;
&lt;p&gt;// Initialize Queued Write Module.&lt;br /&gt; qwr_init.error_handler = nrf_qwr_error_handler;&lt;/p&gt;
&lt;p&gt;err_code = nrf_ble_qwr_init(&amp;amp;m_qwr, &amp;amp;qwr_init);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;memset(&amp;amp;calib_init, 0, sizeof(calib_init));&lt;br /&gt;err_code = service 1(&amp;amp;c_cus, &amp;amp;calib_init);&lt;br /&gt;&amp;nbsp;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;memset(&amp;amp;oper_init, 0, sizeof(oper_init))&lt;br /&gt; err_code = service2(&amp;amp;o_cus, &amp;amp;oper_init);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;memset(&amp;amp;config_init, 0, sizeof(config_init))&lt;br /&gt;&amp;nbsp;err_code = service3(&amp;amp;g_cus, &amp;amp;config_init);&lt;br /&gt;&amp;nbsp;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; memset(&amp;amp;device_init, 0, sizeof(device_init));&lt;/p&gt;
&lt;p&gt;err_code = service4(&amp;amp;d_cus, &amp;amp;device_init);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;/*It is crashing after it completes this initialization*/&lt;br /&gt; &lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE multiple services and characteristics not working, error code 4 after service_init() function</title><link>https://devzone.nordicsemi.com/thread/221471?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 07:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:023ee2cc-6b0a-4d09-9e4c-ae515d5d0b35</guid><dc:creator>HuanVH</dc:creator><description>&lt;p&gt;Find RAM in this &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/adjustment-of-ram-and-flash-memory"&gt;post&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE multiple services and characteristics not working, error code 4 after service_init() function</title><link>https://devzone.nordicsemi.com/thread/221470?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 07:18:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31c6579f-0ccb-4edd-941d-5ab8b4ee7fef</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Namdev&lt;/p&gt;
&lt;p&gt;Depending on your IDE, the build window (at least in SES) tells you how much your RAM/Flash needs to increase if that&amp;#39;s the problem. What IDE are you using anyway? Also, are you able to see what function the app_error_fault_handler is called from? When in the application does this error occur.&lt;/p&gt;
&lt;p&gt;You can also check if this error is called when you include one specific characteristic to a specific service or if it always occurs when you try adding characteristic number X total.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>