<?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>Battery service &amp;amp; debug problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14302/battery-service-debug-problem</link><description>Hello, 
 I try to add battery service in ble_app_uart , but it has some problem. 
 The Problem is that I can see the Battery service on the phone , but it doesn&amp;#39;t change by ADC . 
 the Operation is under SDK9 &amp;amp; s110 . 
 By the way , how to find errors</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jun 2016 15:06:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14302/battery-service-debug-problem" /><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54570?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 15:06:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c38a1057-7d1c-413a-b695-7ff48be6201d</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;In your last image you have written DEBUGBLE_STACK_SUPPORT_REQD in one word while it is supposed to be DEBUG and BLE_STACK_SUPPORT_REQD. Also, try to enable &amp;quot;C99 mode&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54569?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2016 16:16:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:521e7554-b62b-4b2b-8fc3-e844a3fde8b3</guid><dc:creator>Greed</dc:creator><description>&lt;p&gt;Thanks.
Battery Service can work.
But i still can&amp;#39;t see the error in debug mode.
There is my operation .
First , I push the &amp;quot;step over&amp;quot; button.
Second , It was stop at bsp_init().
Third , error_code doesn&amp;#39;t have value in &amp;quot;call stack + locals&amp;quot; window.
Like the picture below.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6318.1.jpg" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;If I use this &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/?answer=60126#post-id-60126"&gt;solution&lt;/a&gt; , I will see the error.Like the picture below.
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7433.2.PNG" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54568?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2016 08:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4f0ca26-3438-46a9-8357-ae6d637cd785</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;See my edited answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54567?ContentTypeID=1</link><pubDate>Mon, 06 Jun 2016 15:12:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0fdd2a8-c341-4002-862d-578442b18f4c</guid><dc:creator>Greed</dc:creator><description>&lt;p&gt;I updated some information, thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54566?ContentTypeID=1</link><pubDate>Mon, 06 Jun 2016 14:37:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49132039-3f80-4168-b9d6-c9c6954ac5fc</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;What do you mean by &amp;quot;but it doesn&amp;#39;t change by ADC&amp;quot;? Can you upload your project files in a .zip-file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54565?ContentTypeID=1</link><pubDate>Mon, 06 Jun 2016 14:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a410698b-7257-4117-a477-961f53bb611f</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I can&amp;#39;t see your pictures. Can you please edit your original post and insert them there? Maybe you can post your main.c file as well?
EDIT: never mind. I can see your pictures now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54564?ContentTypeID=1</link><pubDate>Mon, 06 Jun 2016 14:28:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2695f524-8399-4832-a39c-2efbb43120ff</guid><dc:creator>Greed</dc:creator><description>&lt;p&gt;Hi,
First , I set the breakpoint at adc_init() , and push the &amp;#39;run&amp;#39; button.&lt;/p&gt;
&lt;p&gt;Second , I push the &amp;#39;step&amp;#39; button.
It will stop , but i can&amp;#39;t see the error_code value at Call Stack + Locals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Battery service &amp; debug problem</title><link>https://devzone.nordicsemi.com/thread/54563?ContentTypeID=1</link><pubDate>Mon, 06 Jun 2016 11:54:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:539f0af9-0c60-42ee-a3d5-b7f2658d850c</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi. You can see how to use the err_code and APP_ERROR_CHECK() &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/?answer=60126#post-id-60126"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You should also be able to see the value of err_code if you look in the &amp;quot;Call Stack + Locals&amp;quot; field.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4075.Capture.PNG" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;Do you get an error when you use the ADC?&lt;/p&gt;
&lt;p&gt;EDIT:&lt;/p&gt;
&lt;p&gt;It looks like your battery_level_meas_timeout_handler() timer is never called. This is because you are calling APP_TIMER_INIT() twice. You call it first inside timers_init(), as is standard procedure in the SDK. Then you create your battery timer with app_timer_create(). Then you call APP_TIMER_INIT() again, effectively overwriting the battery timer you just created. So the first thing you need to do is to uncommend APP_TIMER_INIT() in your main() function. If you start your debugger now you will see that ble_conn_params_init() returns an error. If you enter ble_conn_params_init() you will see that the error occurs when app_timer_create() is called. The returned error is error 4; NRF_ERROR_NO_MEM. This error is returned if the timer operations queue is full and what you need to do is to change&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define APP_TIMER_MAX_TIMERS            (2 + BSP_APP_TIMERS_NUMBER)                 /**&amp;lt; Maximum number of simultaneously created timers. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define APP_TIMER_MAX_TIMERS            (3 + BSP_APP_TIMERS_NUMBER)                 /**&amp;lt; Maximum number of simultaneously created timers. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In your main file. This will allocate more memory to the app timer module.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>