<?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>GPIO configuration issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59878/gpio-configuration-issue</link><description>Hi nRF team, 
 
 I am configuring my GPIO pin with below code sample. 
 out_config = GPIOTE_CONFIG_OUT_SIMPLE(false); 
 err_code = nrfx_gpiote_out_init(MEM_SPI_SS_PIN, &amp;amp;out_config); APP_ERROR_CHECK(err_code); nrfx_gpiote_out_set(MEM_SPI_SS_PIN); 
 While</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Apr 2020 12:06:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59878/gpio-configuration-issue" /><item><title>RE: GPIO configuration issue</title><link>https://devzone.nordicsemi.com/thread/243894?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 12:06:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90180216-6599-488e-8e3e-7b2bb47d227a</guid><dc:creator>Lakshmikanth Satyavolu</dc:creator><description>&lt;p&gt;I think I found what the issue was.&lt;/p&gt;
&lt;p&gt;My code goes like below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nrfx_gpiote_out_config_t out_config;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But if I use the declaration of out_config and API call in the same line. It gets compiled.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nrfx_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Regards&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lakshmi&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO configuration issue</title><link>https://devzone.nordicsemi.com/thread/243892?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 12:04:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a13a62af-efa1-44d6-b90f-0930df9d40cd</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, if you can use GPIOTE_CONFIG_OUT_SIMPLE in pin_change_int, it is probably nothing wrong with that implementation.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Edvin Holmseth"]Do you use any other custom files than main.c and sdk_config? Is it possible to share the custom files? Perhaps the issue is there?[/quote]
&lt;p&gt;&amp;nbsp;As I mentioned in the first reply, the compiler errors that you get when you are missing brackets may be a bit cryptic. The compiler is not good at understanding where it is actually missing. This is not really related to nordic, but if you send me a project that can replicate the issue I can have a look. It is probably something before GPIOTE_CONFIG_OUT_SIMPLE in the file that you are using it (main.c?).&lt;/p&gt;
&lt;p&gt;Go through all the brackets in your custom files. Check that there are&amp;nbsp;equally many &amp;#39;{&amp;#39; and &amp;#39;}&amp;#39;, and that they are in the right order.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO configuration issue</title><link>https://devzone.nordicsemi.com/thread/243883?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 11:50:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0607b90-9ca5-4ca7-8e60-8e8d6e112538</guid><dc:creator>Lakshmikanth Satyavolu</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Edvin,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am using&amp;nbsp;nRF5_SDK_16.0.0.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;SDK\examples\peripheral\pin_change_int&lt;/strong&gt; is working alright in both in old copy of SDK too.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am using&amp;nbsp;&amp;nbsp;&lt;strong&gt;\examples\ble_peripheral\ble_app_hrs\pca10040\s132\ses project.&amp;nbsp; &lt;/strong&gt;And I am not using any custom files. I have just added GPIOTE configuration code in main.c&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Below is the code snippet you have asked for.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#define GPIOTE_CONFIG_OUT_SIMPLE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRFX_GPIOTE_CONFIG_OUT_SIMPLE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;/** @brief Macro for configuring a pin to use as output. GPIOTE is not used for the pin. */&lt;br /&gt;#define NRFX_GPIOTE_CONFIG_OUT_SIMPLE(init_high) \&lt;br /&gt; { \&lt;br /&gt; .action = NRF_GPIOTE_POLARITY_LOTOHI, \&lt;br /&gt; .init_state = init_high ? NRF_GPIOTE_INITIAL_VALUE_HIGH : NRF_GPIOTE_INITIAL_VALUE_LOW, \&lt;br /&gt; .task_pin = false, \&lt;br /&gt; }&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Lakshmi&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO configuration issue</title><link>https://devzone.nordicsemi.com/thread/243793?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 06:53:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f358540f-b90a-4456-af93-77fbbc4b3720</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;What SDK version do you use?&lt;/p&gt;
&lt;p&gt;If you look in the example found in SDK\examples\peripheral\pin_change_int&lt;/p&gt;
&lt;p&gt;you can see that this is used:&lt;/p&gt;
&lt;p&gt;nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Edvin Holmseth"]What does your GPIOTE_CONFIG_OUT_SIMPLE macro look like?[/quote]
&lt;p&gt;&amp;nbsp;If you right click GPIOTE_CONFIG_OUT, and click &amp;quot;Go To Definition&amp;quot;, what does it point to? Can you share that snippet?&lt;/p&gt;
&lt;p&gt;If it points to&amp;nbsp;NRFX_GPIOTE_CONFIG_OUT_SIMPLE, do the same with that one. What does NRFX_GPIOTE_CONFIG_OUT_SIMPLE point to if you click &amp;quot;Go To Definition&amp;quot;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When you tested this with a new unmodified SDK, did you use the same main.c file as earlier? Do you use any other custom files than main.c and sdk_config? Is it possible to share the custom files? Perhaps the issue is there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO configuration issue</title><link>https://devzone.nordicsemi.com/thread/243780?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 04:59:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01bdcb3d-b843-4a6e-8b4a-eae59a2c892b</guid><dc:creator>Lakshmikanth Satyavolu</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried with fresh copy of SDK without any of my code. Took an example project and added above lines of code. Issue still persists.&lt;/p&gt;
&lt;p&gt;If I commented out the&amp;nbsp;&amp;nbsp;&lt;em&gt;&lt;strong&gt;out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);&amp;nbsp;&amp;nbsp;&lt;/strong&gt;&lt;/em&gt; line, I am not seeing any errors.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Lakshmi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO configuration issue</title><link>https://devzone.nordicsemi.com/thread/243664?ContentTypeID=1</link><pubDate>Mon, 06 Apr 2020 13:02:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95f602fd-2baf-4aa3-8ad9-914ba3cd3c47</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Lakshmi,&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t look like there is anything wrong with the snippet that you included here. What does your GPIOTE_CONFIG_OUT_SIMPLE macro look like? Perhaps you by mistake added/removed something from that file?&lt;/p&gt;
&lt;p&gt;Does it happen if you try to do the same in a fresh, unmodified SDK?&lt;/p&gt;
&lt;p&gt;These types of compiler errors can be quite cryptic sometimes. It may not be related to GPIOTE_CONFIG_OUT_SIMPLE at all. Perhaps you are missing some brackets somewhere above the line:&lt;/p&gt;
&lt;p&gt;out_config = GPIOTE_CONFIG_OUT_SIMPLE(false); as well. Can you check that?&lt;/p&gt;
&lt;p&gt;Does the issue (or a similar issue) occur if you comment out all the lines from the snippet that you have included here as well?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>