<?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>UART pin change</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65046/uart-pin-change</link><description>Hello, 
 I&amp;#39;m using SDK v16.0. I&amp;#39;m trying to change the default UART pins from 6,8 to 45,46. In the pca10056.h I have made following changes. 
 
 
 But I still see log on pin 6 and 8. 
 I also tried to change pins in sdk_config.h like following, but no</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Aug 2020 13:36:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65046/uart-pin-change" /><item><title>RE: UART pin change</title><link>https://devzone.nordicsemi.com/thread/266005?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 13:36:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fa146f8-8fe9-43be-a0f3-62f480f3181d</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Aftab,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you using the NRF_LOG module and UART at the same time?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There are several similar cases on Devzone that might help you.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46109/error-code-0x08-nrf_error_invalid_state-is-returned-by-uart_init/226458#226458"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/46109/error-code-0x08-nrf_error_invalid_state-is-returned-by-uart_init/226458#226458&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37735/app_uart_fifo_init-returns-nrf_error_invalid_state-error-0x00000008"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37735/app_uart_fifo_init-returns-nrf_error_invalid_state-error-0x00000008&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19767/app_uart_fifo_init-crashes"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/19767/app_uart_fifo_init-crashes&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If they still cannot help, please create a new for it.&amp;nbsp;This issue is far away from the original issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART pin change</title><link>https://devzone.nordicsemi.com/thread/265945?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 11:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1a31a36-4f20-41d0-b6ae-36ac40ffcbc9</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;I&amp;#39;m not using any development kit, we have our custom board. Basically we were using default pin 6/8 for UART logging. Then we had to assign these pins for some other peripheral. Now pin 45/46 are reserved for UART and no peripheral is connected to them. We just wanted to output the logs on these pins.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is the error I get on terminal:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;error&amp;gt; app: ERROR 8 [NRF_ERROR_INVALID_STATE]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The error is on last line of the following code snippet:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void uart_init(void)
{   
    uint32_t err_code;
    const app_uart_comm_params_t comm_params =
      {
          DTM_RX_PIN,
          DTM_TX_PIN,
          RTS_PIN_NUMBER,
          CTS_PIN_NUMBER,
          APP_UART_FLOW_CONTROL_DISABLED,
          false,
          DTM_BITRATE
      };

    APP_UART_FIFO_INIT(&amp;amp;comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_error_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);

    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART pin change</title><link>https://devzone.nordicsemi.com/thread/265941?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 11:13:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13fb09c9-f83a-4552-ab87-d9461d503a93</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Aftab,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you using&amp;nbsp;&lt;/span&gt;&lt;span&gt;on nRF52840DK? If so, I don&amp;#39;t think&lt;/span&gt;&lt;span&gt;&amp;nbsp;there are P0.45, P0.46 on nRF52840DK. You might consider other pins.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Not sure what is your code. Could you test with&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/uart_example.html"&gt;UART Example&lt;/a&gt;?&amp;nbsp;Are you able to see data on the serial port before modifying the pin setting?&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART pin change</title><link>https://devzone.nordicsemi.com/thread/265908?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 08:36:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:816be099-b049-4946-95e4-dc3f7f4a8ec3</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;I added these lines to sdk_config.h, code compiled but no data on serial port:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define APP_UART_ENABLED 1
#define UART_ENABLED 1
#define UART0_CONFIG_USE_EASY_DMA 1
#define APP_UART_DRIVER_INSTANCE 0
#define APP_FIFO_ENABLED 1&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART pin change</title><link>https://devzone.nordicsemi.com/thread/265890?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 07:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cbad1a5-f695-42c5-9f83-573c1590d4b3</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Aftab,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Aftab"]&lt;p&gt;&lt;/p&gt;&lt;p&gt;In the &lt;strong&gt;app_uart.c&amp;nbsp;&lt;/strong&gt;file it seems that I need to enable APP_UART, this pre-processor directive is disabling the whole file:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;#if NRF_MODULE_ENABLED(APP_UART)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You need to enable the&amp;nbsp;app_uart - UART driver in the sdk_config.h as&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;e&amp;gt; APP_UART_ENABLED - app_uart - UART driver
//==========================================================
#ifndef APP_UART_ENABLED
#define APP_UART_ENABLED 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Aftab"]why do we need to add this code, why not change some pin settings?[/quote]
&lt;p&gt;You can just change the pin setting or rename the pin in the&amp;nbsp;app_uart_comm_params_t as that case. It depends on your&amp;nbsp;usage.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I&amp;#39;m using SDK v16.0. I&amp;#39;m trying to change the default UART pins from 6,8 to 45,46. In the &lt;strong&gt;pca10056.h&lt;/strong&gt; I have made following changes.[/quote]
&lt;p&gt;&amp;nbsp;Are you using &lt;span&gt;on nRF52840DK? If so, I don&amp;#39;t think&lt;/span&gt;&amp;nbsp;there are P0.45, P0.46 on nRF52840DK. You might consider other pins.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART pin change</title><link>https://devzone.nordicsemi.com/thread/265811?ContentTypeID=1</link><pubDate>Fri, 21 Aug 2020 14:30:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1bc34f6-478a-4528-a0c4-9f10fa55e419</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;I get this error after adding above files:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;undefined reference to `app_uart_init&amp;#39;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;app_uart.c&amp;nbsp;&lt;/strong&gt;file it seems that I need to enable APP_UART, this pre-processor directive is disabling the whole file:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#if NRF_MODULE_ENABLED(APP_UART)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;BTW, why do we need to add this code, why not change some pin settings?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART pin change</title><link>https://devzone.nordicsemi.com/thread/265784?ContentTypeID=1</link><pubDate>Fri, 21 Aug 2020 13:13:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72798bd8-13be-4621-9713-86e95107d392</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Aftab,&amp;nbsp;&lt;/p&gt;
[quote user=""]But it throws error: Cannot find definition of&amp;nbsp;&lt;strong&gt;app_uart_comm_params_t&lt;/strong&gt;[/quote]
&lt;p&gt;You have to include&amp;nbsp;&lt;span&gt;app_uart.h and&amp;nbsp;app_uart.c under&amp;nbsp;&lt;/span&gt;nRF5_SDK\components\libraries\uart. See&amp;nbsp;&lt;a title="Including header files" href="https://infocenter.nordicsemi.com/topic/ug_gsg_ses/UG/gsg/add_headers_ses.html?cp=1_1_2_7_5_1"&gt;Including header files&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a title="Adding source files" href="https://infocenter.nordicsemi.com/topic/ug_gsg_ses/UG/gsg/add_file_ses.html?cp=1_1_2_7_5_0"&gt;Adding source files&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>