<?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>Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47195/error-while-configuring-cccd-metadata-in-ble-characteristics-a-beginners-tutorial</link><description>I&amp;#39;m using nRF52840 with SDK15.0.0 
 Following this tutorial : https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial 
 AT STEP 2.H my module is Advertising i can connect and then see the service</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 May 2019 14:00:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47195/error-while-configuring-cccd-metadata-in-ble-characteristics-a-beginners-tutorial" /><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/187010?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 14:00:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:006f623a-0a17-4504-adfd-88ee640226c8</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Now you can verify the answers to your 2 threads&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7608._5F00_Verify_2D00_answer_2D00_nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/187006?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 13:48:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f2366ed-71ab-40b2-ba8a-71b05bf1e0dc</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;yes awneil i agree, i changed values in define for test but your way is better&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/187004?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 13:45:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:399977a2-45aa-40d1-afe6-949df1caa122</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Changing the values of the #defines is a &lt;strong&gt;&lt;em&gt;Really Bad Idea&lt;/em&gt; !!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f62e.svg" title="Open mouth"&gt;&amp;#x1f62e;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Because, when you do that, the name of the #define becomes a &lt;em&gt;&lt;strong&gt;lie&lt;/strong&gt;&lt;/em&gt;!&lt;/p&gt;
&lt;p&gt;If you want to be able to quickly change the setting throughout your code, then do something like&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define MY_BLE_GATTS_VLOCK  BLE_GATTS_VLOC_STACK&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and only use the MY_&lt;span&gt;BLE_GATTS_VLOC in you code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is standard software engineering good practice - nothing specifically to do with Nordic.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186999?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 13:29:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7523bd56-f893-4439-bcd7-b6934d54f174</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;BTW, if you want more getting started material to look after this tutorial I would recommend taking a look at this repo next &lt;a href="https://github.com/NordicPlayground/nRF52-Bluetooth-Course"&gt;https://github.com/NordicPlayground/nRF52-Bluetooth-Course&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186997?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 13:28:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa244421-b91b-40be-b9eb-815e463f9078</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;yes i saw his answer thx.&lt;/p&gt;
&lt;p&gt;but that was the way i could fix my problem...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And i saw that they replace&amp;nbsp;&lt;span&gt;BLE_GATTS_VLOC_STACK&amp;nbsp; by&amp;nbsp;BLE_GATTS_VLOC_USER everywhere in code files but it&amp;#39;s not a very nice solution, if there one line forgotten i can get troubles...&amp;nbsp; that&amp;#39;s why&amp;nbsp;i prefer use #define ...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;however I&amp;#39;ll try to do it your way...&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186994?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 13:21:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72bb1236-1354-4482-a10d-69e3ce55508c</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Geoffroy,&lt;/p&gt;
&lt;p&gt;See the last answer from Håkon in your previous question.&lt;/p&gt;
&lt;p&gt;And the second post is using Softdevice S130 which is for nRF51 series, and is 3 years old so it&amp;#39;s not valid for SDK v15.0.0 and nRF52840. The post was also only valid for serialization which we are not using in the tutorial.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186976?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 12:49:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15fd4538-ddd6-4d1f-9b78-bae05bce084b</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;Hi marjeris,&lt;/p&gt;
&lt;p&gt;I understand what you&amp;#39;re telling me but it&amp;#39;s in contradiction with my previous question :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46739/device-crash-when-adding-new-ble-service-ble-services-beginner-tutorial"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/46739/device-crash-when-adding-new-ble-service-ble-services-beginner-tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and also with this other post :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/12218/how-to-support-ble_gatts_vloc_user"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/12218/how-to-support-ble_gatts_vloc_user&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186972?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 12:36:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82814968-da03-4d1a-a8e8-cd67644c0f1a</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Geoffroy,&lt;/p&gt;
&lt;p&gt;Please don&amp;#39;t change the header files. It would make it impossible for you to keep track of which values you are using then. The correct values are&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/** @defgroup BLE_GATTS_VLOCS GATT Value Locations
 * @{ */
#define BLE_GATTS_VLOC_INVALID       0x00  /**&amp;lt; Invalid Location. */
#define BLE_GATTS_VLOC_STACK         0x01  /**&amp;lt; Attribute Value is located in stack memory, no user memory is required. */
#define BLE_GATTS_VLOC_USER          0x02  /**&amp;lt; Attribute Value is located in user memory. This requires the user to maintain a valid buffer through the lifetime of the attribute, since the stack
                                                will read and write directly to the memory using the pointer provided in the APIs. There are no alignment requirements for the buffer. */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you want the attribute data stored in the stack memory you set&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	cccd_md.vloc                = BLE_GATTS_VLOC_STACK;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;instead of having to set it to 0x01.&lt;/p&gt;
&lt;p&gt;If you want the attribute data stored in user memory you set&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	cccd_md.vloc                = BLE_GATTS_VLOC_USER;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;instead of having to set it to 0x02.&lt;/p&gt;
&lt;p&gt;Does this makes sense? You are not suppose to change the header files, just use them for reference.&lt;/p&gt;
&lt;p&gt;When you changed the macro for BLE_GATTS_VLOCK_STACK to 0x02, you were actually defining the attribute value location to be BLE_GATTS_VLOCK_USER.&lt;/p&gt;
&lt;p&gt;As you can read from the comments in the header file if you choose BLE_GATTS_VLOCK_USER the attribute value is located in user memory, but this requires the user to mantain a valid buffer through the lifetime of the attribute and you need to store the data in the buffer yourself, so this was why the example was not working.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186689?ContentTypeID=1</link><pubDate>Mon, 13 May 2019 11:59:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb23949-aa83-44e3-8b4c-8bddf0bf3331</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;My problem seems to be solve !!! &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;in ble_gatts.h, because of&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46739/device-crash-when-adding-new-ble-service-ble-services-beginner-tutorial"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/46739/device-crash-when-adding-new-ble-service-ble-services-beginner-tutorial&lt;/a&gt;, i had the code :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BLE_GATTS_VLOC_INVALID       0x00
#define BLE_GATTS_VLOC_STACK         0x02
#define BLE_GATTS_VLOC_USER          0x02&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i changed to :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BLE_GATTS_VLOC_INVALID       0x00
#define BLE_GATTS_VLOC_STACK         0x01
#define BLE_GATTS_VLOC_USER          0x01&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;then no more errors ...&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll do few more verifications to check all is fine compared to this tutorial...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186618?ContentTypeID=1</link><pubDate>Mon, 13 May 2019 09:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91e30b6e-a7d4-42cc-9862-c5a157f14bb3</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;i just checked values :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;		SEGGER_RTT_printf(0, &amp;quot;read_perm : 0x%#02x\n&amp;quot;, char_md.p_cccd_md-&amp;gt;read_perm);
		SEGGER_RTT_printf(0, &amp;quot;write_perm : 0x%#02x\n&amp;quot;, char_md.p_cccd_md-&amp;gt;write_perm);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and i get read_perm : 0x11 and write_perm : 0x11 it seems good.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186615?ContentTypeID=1</link><pubDate>Mon, 13 May 2019 09:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bec5971-7528-4857-8e23-b1c3125191de</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Continued from previous thread:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46981/characteristic-tutorial-error-when-adding-a-characteristic-to-a-service/186578#186578"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/46981/characteristic-tutorial-error-when-adding-a-characteristic-to-a-service/186578#186578&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error while configuring cccd metadata, in ble-characteristics-a-beginners-tutorial</title><link>https://devzone.nordicsemi.com/thread/186564?ContentTypeID=1</link><pubDate>Mon, 13 May 2019 07:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81bcce62-473e-4c2e-b09b-e5c88745d622</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;if i comment this line :&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;char_md.p_cccd_md           = &amp;amp;cccd_md;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;err_code is 0x00&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i don&amp;#39;t know if it can help, but i printed&amp;nbsp;char_md.p_cccd_md value : 0x2000FEBC,&lt;/p&gt;
&lt;p&gt;in file&amp;nbsp;ble_app_template_gcc_nrf52.ld i have values :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;MEMORY
{
  FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xda000
  RAM (rwx) :  ORIGIN = 0x20002274, LENGTH = 0xdd8c
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tryed to declare cc_md in static :&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static ble_gatts_attr_md_t cccd_md;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;here i get&amp;nbsp;&lt;span&gt;char_md.p_cccd_md value : 0x20002F00, i still have err_code 0x07&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>