<?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>nrf_gpio_set and clear function are not working with softdevice enabled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37003/nrf_gpio_set-and-clear-function-are-not-working-with-softdevice-enabled</link><description>Hey Everyone 
 I have written a code for using lora rn2483 with nrf52840 using the uart protocol which is configured on 7 and 5 pin. The program was working fine untill i enabled softdevice and included all the files in it. 
 The gpio set and clear function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Aug 2018 12:20:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37003/nrf_gpio_set-and-clear-function-are-not-working-with-softdevice-enabled" /><item><title>RE: nrf_gpio_set and clear function are not working with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/142391?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 12:20:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48f796cd-2c27-4376-8c4f-942471799e7d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you checking the error code returned from&amp;nbsp;app_uart_put/get?&lt;/p&gt;
&lt;p&gt;Do you use&amp;nbsp;nrf_gpio_pin_set/clear functions on the same pins you run UART peripheral on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_gpio_set and clear function are not working with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/142285?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 04:03:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aa86059-7a8b-4f2c-a822-0033a2499fb1</guid><dc:creator>Rajat</dc:creator><description>&lt;p&gt;I have set the optimization level to NONE.&lt;/p&gt;
&lt;p&gt;Does this problem have anything to with app_uart_put/get functions?&lt;/p&gt;
&lt;p&gt;When i tried writing app_uart_put(&amp;#39;A&amp;#39;) to UART pins(in a while(1) loop). I can see that only once ,instead of multiple times. I am using a logic analyzer to view the UART output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_gpio_set and clear function are not working with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/142283?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 03:44:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d26bd53-9ed9-4b72-b5ed-036b647523c9</guid><dc:creator>Rajat</dc:creator><description>&lt;p&gt;Yes i have defined the symbol DEBUG_CODE. I will try the optimization part and let you know how it goes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_gpio_set and clear function are not working with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/142170?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 12:49:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33608646-a473-47c0-bf22-e8b73fa393bd</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Have you defined the symbol&amp;nbsp;DEBUG_CODE, in order for&amp;nbsp;read_until to be compiled into the application? The red dot with questionmark means that this line is not included in the application. It have most likely been optimized away by the compiler, as the state is known at compile time. Try turning off optimiaztion in your project settings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_gpio_set and clear function are not working with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/142114?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 09:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1293398-00b4-48d8-8c87-69122469c6e1</guid><dc:creator>Rajat</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thanks for quick action!&lt;br /&gt;I am provding the piece of code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If i put a breakpoint on the line read_until function.&lt;/p&gt;
&lt;p&gt;The debugger never stops at that point , however if i put a breakpoint on bsp_board_led_on function ,the debugger pauses at that point.&lt;/p&gt;
&lt;p&gt;If i put a breakpoint on nrf_gpio_pin_set function, The breakpoint red dot shows a question mark on it.&lt;/p&gt;
&lt;p&gt;What does it mean and what can be the issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am using UART on pin 5 as TX and pin 7 as RX. with HWFC DISABLED.&lt;/p&gt;
&lt;p&gt;PIN RST IS P0.04&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
bsp_board_init(BSP_INIT_LEDS);                    /*INITIALIZE ON BOARD LEDS*/
uart_init_terra(rx_pin,tx_pin);                   /*UART MODULE  INITIALIZED WITH 57600 and pin7 and pin5 as rx and tx*/
nrf_delay_ms(200);                                
nrf_gpio_cfg_output(PIN_RST);                     /*RST(P0.04) AS OUTPUT*/
//uart_write_data(&amp;quot;&amp;quot;,1);                            /**/
app_uart_flush();
nrf_delay_ms(200);
bsp_board_led_on(BSP_BOARD_LED_0);                /*TURN ON THE LED*/

nrf_gpio_pin_clear(PIN_RST);                      /*RST PIN LOW*/
nrf_delay_ms(500);
nrf_gpio_pin_set(PIN_RST);                        /*RST PIN HIGH*/
nrf_delay_ms(500);

#ifdef DEBUG_CODE
read_until(0x0A);
printf(&amp;quot;Data : %s&amp;quot;, vikram);
clear_buffer();
#endif
}

void read_until(char end)
{

volatile int cnt=0;

while((vikram[cnt++]=uart_read_data())!=end );                  /*READING AND APPENDING DATA 
                                                                UNTILL END IS REACHED*/
vikram[cnt]=0;
}

void clear_buffer()
{
volatile int m=0;
while(m!=25)
{
vikram[m++]=0;

}


char  uart_read_data(void)
{
char  rx_data;

while (app_uart_get(&amp;amp;rx_data) != NRF_SUCCESS);
return rx_data;
}

&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_gpio_set and clear function are not working with softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/142102?ContentTypeID=1</link><pubDate>Tue, 31 Jul 2018 09:03:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e456f69-e711-4a2a-b0f7-15a1aa57d4ed</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is nothing in the softdevice that prevents you from controlling GPIOs. Which pins are you trying to set/clear?&lt;/p&gt;
&lt;p&gt;Please post code showing what you are doing, and explain in more details how it is not working.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>