<?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>Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44347/device-not-advertising-when-added-dfu-service-into-the-applcation</link><description>I am trying to add DFU service to my custom application, I have taken ble_app_hrs_s132 with DFU as a reference and added all the required files and made required changes in my application but when I flashed the code into the board, the board is not advertising</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Mar 2019 10:08:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44347/device-not-advertising-when-added-dfu-service-into-the-applcation" /><item><title>RE: Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/thread/174766?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 10:08:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a1d0273-1f35-4661-8b2a-7a519d5c65f2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If you go to the Reference of the function&amp;nbsp;nrf_drv_gpiote_init() in nrf_drv_gpiote.h you can find this:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt; * @brief Function for initializing the GPIOTE module.&lt;br /&gt; *&lt;br /&gt; * @details Only static configuration is supported to prevent the shared &lt;br /&gt; * resource being customized by the initiator.&lt;br /&gt; *&lt;br /&gt; * @retval NRF_SUCCESS If initialization was successful.&lt;br /&gt; * @retval NRF_ERROR_INVALID_STATE If the driver was already initialized.&lt;br /&gt; */&lt;br /&gt;ret_code_t nrf_drv_gpiote_init(void);&lt;/p&gt;
&lt;p&gt;And error code 0x08 is equal to&amp;nbsp;&lt;span&gt;NRF_ERROR_INVALID_STATE&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This meant you already initialize the gpiote driver some where else. Please check in your code.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/thread/174733?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 08:24:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2afc7da-3a74-4a0c-a8e4-80485dd6aebf</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I Debugged the code as you said.&lt;/p&gt;
&lt;p&gt;// Initialze driver.&lt;br /&gt; err_code = nrf_drv_gpiote_init();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;I am getting error in the above function and the err_code&amp;nbsp; it is throwing is 0x00000008.&lt;/p&gt;
&lt;p&gt;Could you please help me in fixing this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/thread/174270?ContentTypeID=1</link><pubDate>Tue, 05 Mar 2019 13:33:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64f12cee-3b98-4a8b-b9e4-33b0adcaedbf</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure why it should restart, please make sure you change the optimization level to 0, add DEBUG into the preprocessor symbols.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you can see the error return 0 , I don&amp;#39;t think there would be any restart here. If you can step to APP_ERROR_CHECK, how would it restart ? Have you tried to step into&amp;nbsp;&lt;span&gt;nrf_drv_gpiote_in_init() ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/thread/174136?ContentTypeID=1</link><pubDate>Tue, 05 Mar 2019 06:28:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf879924-51af-4a93-83f7-e58799704a21</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;err_code = nrf_drv_gpiote_in_init(13, &amp;amp;in_config, button_duration_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The above function restarting the system.But the returned err_code value is 0.&lt;/p&gt;
&lt;p&gt;I am not able to figure out why it is restarting, could you please help me?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/thread/174060?ContentTypeID=1</link><pubDate>Mon, 04 Mar 2019 15:17:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42b57cc4-fcbe-4001-8185-909a002c9f6f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Again, please follow the debugging guide. You need to check for the error code AFTER you call a function. In your code, you have&amp;nbsp;APP_ERROR_CHECK(err_code); at line 18 without any value assigned to it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/thread/173998?ContentTypeID=1</link><pubDate>Mon, 04 Mar 2019 13:23:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b61446ac-86c6-4604-b662-879e3bd3ca47</guid><dc:creator>kishor babu</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thanks for the reply, I am able to solve the issue.&lt;/p&gt;
&lt;p&gt;I have added&amp;nbsp;&lt;/p&gt;
&lt;p&gt;p_ble_enable_params-&amp;gt;common_enable_params.vs_uuid_count = 2; in softdevice_handler.c then it is advertising.&lt;/p&gt;
&lt;p&gt;Now I am facing another issue where in the same code I have added a gpio interrupt, but when configuring&amp;nbsp; input pin for enabling interrupt it is restarting the system.&lt;pre class="ui-code" data-mode="c_cpp"&gt;///**@brief Function for initializing the GPIOTE handler module.
// */

// Button event handler.
static void button_duration_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
   static uint32_t button_pushed_time;
		static uint32_t button_released_time;
		static uint32_t button_pressed_time;
	   uint32_t err_code;
	
    if (action == APP_BUTTON_PUSH)
    {
        
						     
					        //err_code = app_timer_start(m_led_a_timer_id, APP_TIMER_TICKS(200, APP_TIMER_PRESCALER), NULL);
			            printf(&amp;quot;\r\n in the button handler&amp;quot;);
                  APP_ERROR_CHECK(err_code);
								  app_timer_cnt_get(&amp;amp;button_pushed_time);
					        button_pushed_time=app_timer_sec(button_pushed_time);
			            while(!nrf_gpio_pin_read(13));
			             app_timer_cnt_get(&amp;amp;button_released_time);
			             button_released_time=app_timer_sec(button_released_time);
							   	app_timer_cnt_diff_compute(button_released_time, button_pushed_time, &amp;amp;button_pressed_time);  
					         if((button_pressed_time&amp;lt;3))
							   	{
							    	nrf_drv_gpiote_out_clear(19);
                    nrf_drv_gpiote_out_set(20);	
								  }
                  else if(button_pressed_time&amp;gt;=3)
							     {
		               nrf_drv_gpiote_out_set(19);
                   nrf_drv_gpiote_out_clear(20);	     
							     }
			             
								
									
                     
    }

 }




// Function for configuring GPIO.
static void gpio_config()
{
    ret_code_t err_code;

    // Initialze driver.
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);
	nrf_gpio_cfg_output(19);
    nrf_gpio_cfg_output(20);
    // Set output pins (this will turn off the LED&amp;#39;s).
    nrf_drv_gpiote_out_set(19);
    nrf_drv_gpiote_out_set(20);

    // Make a configuration for input pints. This is suitable for both pins in this example.
    nrf_gpio_cfg_input(13, NRF_GPIO_PIN_PULLUP);
    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
    in_config.pull = NRF_GPIO_PIN_PULLUP;

    // Configure input pins for buttons, with separate event handlers for each button.
    err_code = nrf_drv_gpiote_in_init(13, &amp;amp;in_config, button_duration_handler);
    APP_ERROR_CHECK(err_code);
    // Enable input pins for buttons.
    nrf_drv_gpiote_in_event_enable(13, true);

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Above are the functions for button_event_handler and for configuring the gpio.&lt;/p&gt;
&lt;p&gt;could you please help me in solving this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not advertising when added DFU service into the applcation.</title><link>https://devzone.nordicsemi.com/thread/173985?ContentTypeID=1</link><pubDate>Mon, 04 Mar 2019 13:04:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ad88f2f-fe3d-4083-b5ac-49ef627435b8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Kishor,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When your code doesn&amp;#39;t work as expected, for example not advertising, you can debug.&lt;/p&gt;
&lt;p&gt;To debug, you can follow&lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/#60126"&gt; this guide.&amp;nbsp;&lt;/a&gt;&amp;nbsp;We want to know which function&amp;nbsp; at which file causing assertion and with which error code.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>