<?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>GPIOTE using Pin13-16 on 52DK and BMD-300</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24501/gpiote-using-pin13-16-on-52dk-and-bmd-300</link><description>I&amp;#39;m using a pin for trigger switch input with the following codes 
 nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
 in_config.pull = NRF_GPIO_PIN_PULLUP;
 err_code = nrf_drv_gpiote_in_init(TRG, &amp;amp;in_config, in_pin_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Aug 2017 18:03:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24501/gpiote-using-pin13-16-on-52dk-and-bmd-300" /><item><title>RE: GPIOTE using Pin13-16 on 52DK and BMD-300</title><link>https://devzone.nordicsemi.com/thread/96462?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2017 18:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d13a482b-307c-4727-9283-4ef53dfc283a</guid><dc:creator>xhr0428</dc:creator><description>&lt;p&gt;Hi Jørn, I have created a case. ID is 38387. Please take a look.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE using Pin13-16 on 52DK and BMD-300</title><link>https://devzone.nordicsemi.com/thread/96459?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2017 06:07:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e66afdf7-1b1c-4398-80f3-f996c3ddda5a</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;I would need to see all your main code to assess this I think. I just removed BSP_INIT_BUTTONS from the unchanged characteristic tutorial code and it works as expected. I suspect there is something else in your code that generates that error. If your code is confidential you can create a mypage case at &lt;a href="http://www.nordicsemi.com/"&gt;nordicsemi.com&lt;/a&gt;, and refer to this case. If it isn&amp;#39;t confidential you can just upload your main.c file to your original question here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE using Pin13-16 on 52DK and BMD-300</title><link>https://devzone.nordicsemi.com/thread/96463?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 23:57:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5d0145e-540a-45d0-99fa-93416eae367f</guid><dc:creator>xhr0428</dc:creator><description>&lt;p&gt;Hi Jørn, removing BSP_INIT_BUTTONS from the bop_init() gets the following error:&lt;/p&gt;
&lt;p&gt;Name : m_error_data&lt;/p&gt;
&lt;p&gt;Details:{fault_id = 16385, pc = 0, error_info = 536936404, p_assert_info = 0x0, p_error_info = 0x2000ffd4, err_code = 8, line_num = 1177, p_file_name = 0x2be6c &amp;quot;../../../main.c&amp;quot;}&lt;/p&gt;
&lt;p&gt;What&amp;#39;s the issue here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE using Pin13-16 on 52DK and BMD-300</title><link>https://devzone.nordicsemi.com/thread/96461?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 17:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f0d8478-8c1a-4f1c-b797-a62df888d068</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;The following code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code = bsp_init(BSP_INIT_LED,APP_TIMER_TICKS(100, APP_TIMER_PRESCALER),bsp_event_handler);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Should only initialize the LEDS present on the board, as defined in the board header file. It is only necessary to call if you want to keep the functionality offered by the bsp module in regards of led indication of current state. If you cannot see the device advertising it might be because there are additional problems generating an error. You could try to debug and see if the function returns an error code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE using Pin13-16 on 52DK and BMD-300</title><link>https://devzone.nordicsemi.com/thread/96460?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 16:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d4d9cc7-5357-431c-a1bd-7ec77edb1267</guid><dc:creator>xhr0428</dc:creator><description>&lt;p&gt;Hi Jørn, Thanks for the reply. Creating a custom.h and changing button definition solved the issue.&lt;/p&gt;
&lt;p&gt;But the other approach, removing BSP_INIT_BUTTONS from the bop_init() didn&amp;#39;t seem to work. Here is the code I have&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code = bsp_init(BSP_INIT_LED,APP_TIMER_TICKS(100, APP_TIMER_PRESCALER), bsp_event_handler);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Another question is do I have to call buttons_leds_init() in the first place? If I comment this function out, I couldn&amp;#39;t see advertising as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE using Pin13-16 on 52DK and BMD-300</title><link>https://devzone.nordicsemi.com/thread/96458?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 11:12:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:913ab761-0d05-4b78-83fd-2cd1db7ac733</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hello xr0428&lt;/p&gt;
&lt;p&gt;In the characteristics tutorial the function buttons_leds_init() is called from main. This in turn calls&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS,APP_TIMER_TICKS(100, APP_TIMER_PRESCALER), bsp_event_handler);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This function is part of the board support (bsp) module, and it configures the buttons and leds of the board you are using. For the 52832DK the board defines are found in the pca10040.h header file.
The bsp_init function configures the button pins as GPIOTE inputs with low power events.&lt;/p&gt;
&lt;p&gt;When you add your code for pins 13-16 you are trying to initialize GPIOTE for the same pins as the bsp_init function do. This will then trigger the NRF_ERROR_INVALID_STATE error.&lt;/p&gt;
&lt;p&gt;If you are using a custom board you can create a header file called custom_board.h, and remove pca10040.h from the include list. You can place this file in the same directory as the main.c file, as this path is already added. Then remove BOARD_PCA10040 from the preprocessor symbols and add BOARD_CUSTOM (as defined in boards.h). Your custom_board.h should then contain all pin defines similar to what pca10040.h does.&lt;/p&gt;
&lt;p&gt;Alternatively you can remove BSP_INIT_BUTTONS from the bsp_init() arguments. The function will then not configure the buttons, and you can configure them yourself as you please.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jørn Frøysa&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>