<?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>Using pin 6 as GPIO in SPI functionality</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43575/using-pin-6-as-gpio-in-spi-functionality</link><description>How do I find where else in the program pin 6 is being used and disable its other functionalities in the BLE_UART example? 
 
 I am trying to read data from a sensor via SPI communication and then transfer the data the SPI reads via bluetooth to the Nordic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Feb 2019 13:55:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43575/using-pin-6-as-gpio-in-spi-functionality" /><item><title>RE: Using pin 6 as GPIO in SPI functionality</title><link>https://devzone.nordicsemi.com/thread/171911?ContentTypeID=1</link><pubDate>Tue, 19 Feb 2019 13:55:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:076667ce-3591-4f54-be7a-d975f795b004</guid><dc:creator>Simon</dc:creator><description>[quote user="noob_with_ucontrollers"]I was wondering, if I need the uart functionality, could I re-assign uart TX&amp;nbsp; and RX pins somewhere in the project? Which file/settings should I look into to reassign these pins to sth else so I can both use pin 6 as gpio and use uart functions?[/quote]
&lt;p&gt;&amp;nbsp;The UART RX and TX pins are configured in the function&amp;nbsp;&lt;em&gt;uart_init()&amp;nbsp;&lt;/em&gt;in &lt;em&gt;main.c.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Regarding the second question, you should make a new thread and present your problem there. In that way, the threads&amp;nbsp;will only include content related to the initial question, and it is easier and quicker for people to find answers to their questions.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using pin 6 as GPIO in SPI functionality</title><link>https://devzone.nordicsemi.com/thread/171491?ContentTypeID=1</link><pubDate>Sat, 16 Feb 2019 00:19:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42768c3f-dc4a-4858-921a-ed07a2994166</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;Thank you &lt;a href="https://devzone.nordicsemi.com/members/simon"&gt;Simon Ferres&lt;/a&gt;Simon. Deleting all calls to the uart functions and the NRF_LOG functions solves this problem.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I was wondering, if I need the uart functionality, could I re-assign uart TX&amp;nbsp; and RX pins somewhere in the project? Which file/settings should I look into to reassign these pins to sth else so I can both use pin 6 as gpio and use uart functions?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, I am not sure if I am supposed to start a new thread/post for this but even though my pin 6 works fine and the SPI communication is working on my custom PCB device, the nus_data_send () function does not send the SPI data to the NRF_TOOLBOX app on my phone.... I&amp;#39;ve tried calling the nus_data_send() function in the NUS_DATA_HANDLER as well as in main () program and in the spi_event_handler but it doesn&amp;#39;t send the data from the SPI instead it sends some random garbage values&amp;nbsp;to the app.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1550276388939v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is how I call the nus_data_send(). I initialize data_array with values from the RX buf of SPI.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;err_code1 = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);
                        if ((err_code1 != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
                            (err_code1 != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
                            (err_code1 != NRF_ERROR_NOT_FOUND))
                        {
                            APP_ERROR_CHECK(err_code1);
                        }


&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using pin 6 as GPIO in SPI functionality</title><link>https://devzone.nordicsemi.com/thread/171074?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 10:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16978cd0-7694-415f-8e94-cde6da6d4db1</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;The reason advertising stops when you remove&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;uart_init()&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is because&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;printf()&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is called before&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;advertising_start().&amp;nbsp;&lt;/em&gt;The function&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;printf()&amp;nbsp;&lt;/em&gt;uses the UART&amp;nbsp;parameters to print the data, but since the parameters are never set, the programs hangs at&amp;nbsp;&lt;em&gt;printf()&amp;nbsp;&lt;/em&gt;and never calls&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;advertising_init()&lt;/em&gt;. If you want to use pin 6, then you won&amp;#39;t be able to receive logging through the interface MCU and USB, since pin 6 is connected to the TX line. The solution is to comment out the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;printf()&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;and the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;app_uart_put()&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/em&gt;functions as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using pin 6 as GPIO in SPI functionality</title><link>https://devzone.nordicsemi.com/thread/170727?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 19:54:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:297c41f7-a254-4927-a583-22e762e9a873</guid><dc:creator>noob_with_ucontrollers</dc:creator><description>&lt;p&gt;That makes sense. I commented out the uart_init() function in main and ran the program on my device. Pin 6 works fine (i.e. goes high and low according to program).&amp;nbsp;&lt;br /&gt;However, when I&amp;nbsp; remove the uart_init() function, the device stops advertising. I didn&amp;#39;t know the uart was important for the ble functionality? How do I remove the uart functions without disrupting the ble or nus functionality?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks Simon!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using pin 6 as GPIO in SPI functionality</title><link>https://devzone.nordicsemi.com/thread/170630?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 13:00:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5403b88-85e6-4338-ba81-63772e606e9c</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;The reason you won&amp;#39;t find the use of pin 6 in the sdk_config.h file is because it is declared somewhere else. The ble_app_uart example doesn&amp;#39;t use the UART backend for logging, and as a consequence does not have any of the defines in the sdk_config.h file, and &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/29932/pwm-doesn-t-work-on-pin-4-and-pin-6"&gt;this&lt;/a&gt; solution doesn&amp;#39;t help you.&lt;/p&gt;
&lt;p&gt;However, the example uses the function &lt;em&gt;app_uart_put(..), &lt;/em&gt;which is called directly from main, and through&amp;nbsp;&lt;em&gt;printf()--&amp;gt;app_uart_put() &lt;/em&gt;as well&lt;em&gt;. &lt;/em&gt;The pins TX and RX pins are decided through the function&amp;nbsp;&lt;em&gt;APP_UART_FIFO_INIT(), &lt;/em&gt;which is called from main in the function &lt;em&gt;uart_init(..)&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Enough talk. Pin 6 is assigned as TX pin in the function&amp;nbsp;&lt;em&gt;uart_init(..)&amp;nbsp;&lt;/em&gt;in main.c of the ble_app_uart example.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>