<?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 Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32379/uart-hardware-flow-control-does-not-seem-to-work---connecting-two-nrf52840-dev-boards-together</link><description>Hi all, I am trying to get my head around UART Flow control on Nordic nRF52. I cannot get it working... I have two nRF52840 dev boards (PCA10056) that I connected between each others: Board 1 (Sender) Board 2 (Receiver) P0.3 ------------------- P0.4 P0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Apr 2018 08:41:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32379/uart-hardware-flow-control-does-not-seem-to-work---connecting-two-nrf52840-dev-boards-together" /><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/127980?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 08:41:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5350e00-d817-4bc0-b285-8c26c66b95c3</guid><dc:creator>Olivier</dc:creator><description>&lt;p&gt;You are right :-) I should have realised the MCU frequency is much faster than UART. Adding a delay in the reception demonstrate the HW flow control. I changed the reception as follow compare to the code above and I can see the CTS:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    puts(&amp;quot;Receiver&amp;quot;);

    while (true)
    {
        uint8_t cr;
        while (app_uart_get(&amp;amp;cr) != NRF_SUCCESS);
	    nrf_delay_ms(2);
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/1122.uart.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can now confirm UART Hardware Flow control works :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/127961?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 07:25:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c08db2b2-1beb-4bfa-9a7b-d0a2d39b0264</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;As far as I understand, the RTS/CTS lines does not go high/off (active low means that off is high) until it can&amp;#39;t handle any more inputs. Since all your application is doing is receiving the messages, the application can manage to handle the buffers fast enough, and hence, it will not change the RTS/CTS lines. Even though it is sending in one direction, does not mean that it has to block in the other direction.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&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><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/127881?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 15:42:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cf61409-5ab2-4553-9732-13ffd5624c20</guid><dc:creator>Olivier</dc:creator><description>&lt;p&gt;I have trying to stress the UART by sending a lot of characters to fill the UART FIFO of the receiver and see the CTS signal changing. But I cannot get CTS signal changing. Here is the code I am using:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;app_uart.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#if defined (UART_PRESENT)
#include &amp;quot;nrf_uart.h&amp;quot;
#endif
#if defined (UARTE_PRESENT)
#include &amp;quot;nrf_uarte.h&amp;quot;
#endif

#ifdef SENDER
#define UART_RX_PIN_NUMBER  8  /* Received characters from the terminal */
#define UART_TX_PIN_NUMBER  3  /* Send it to P0.3 */
#define UART_CTS_PIN_NUMBER 4  /* CTS: P0.4 */
#define UART_RTS_PIN_NUMBER 28 /* RTS: P0.28 */
#else
#define UART_RX_PIN_NUMBER  3  /* Receive characters from Sender */
#define UART_TX_PIN_NUMBER  6  /* Send characters to the terminal */
#define UART_CTS_PIN_NUMBER 28 /* RTS: P0.28 */
#define UART_RTS_PIN_NUMBER 4  /* RTS: P0.4 */
#endif

#define MAX_TEST_DATA_BYTES     (15U)                /**&amp;lt; max number of test bytes to be used for tx and rx. */
#define UART_TX_BUF_SIZE 256                         /**&amp;lt; UART TX buffer size. */
#define UART_RX_BUF_SIZE 256                         /**&amp;lt; UART RX buffer size. */

void uart_error_handle(app_uart_evt_t * p_event)
{
    if (p_event-&amp;gt;evt_type == APP_UART_COMMUNICATION_ERROR)
    {
        APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
    }
    else if (p_event-&amp;gt;evt_type == APP_UART_FIFO_ERROR)
    {
        APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
    }
}

#define UART_HWFC    APP_UART_FLOW_CONTROL_ENABLED

/**
 * @brief Function for main application entry.
 */
int main(void)
{
    uint32_t err_code;

    bsp_board_leds_init();

    const app_uart_comm_params_t comm_params =
      {
          UART_RX_PIN_NUMBER,
	  UART_TX_PIN_NUMBER,
	  UART_RTS_PIN_NUMBER,
	  UART_CTS_PIN_NUMBER,
          UART_HWFC,
          false,
          NRF_UART_BAUDRATE_115200
      };

    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);

#ifdef SENDER
    puts(&amp;quot;Sender&amp;quot;);

    // Send a lot of data to see RTS
    while (true)
    {
        app_uart_put(&amp;#39;a&amp;#39;);
    }
#else
    puts(&amp;quot;Receiver&amp;quot;);

    while (true)
    {
        uint8_t cr;
        while (app_uart_get(&amp;amp;cr) != NRF_SUCCESS);
    }
#endif
}


/** @} */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The signals:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7317.uart.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/127397?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 10:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1746daa5-e20e-4aa9-b13f-dd2870585516</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The RTS(request to send) and CTS(clear to send) signals are active low, so you should see that they are low by default. They will go high only if something happens so that they are not able to receive a message, e.g. if the receive buffer is full.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you may know, RTS is the input and CTS is the output&amp;nbsp;and they are cross connected. So they will not actually send a request, but check that the RTS is ok before sending.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&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><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/126119?ContentTypeID=1</link><pubDate>Tue, 27 Mar 2018 12:43:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c48f537-fa86-41f2-be8d-85653380d3ae</guid><dc:creator>Olivier</dc:creator><description>&lt;p&gt;I have just tried with a slightly modified version of SDK\examples\peripheral\uart to be used between two nRF52840 DK boards with HW flow control.&lt;/p&gt;
&lt;p&gt;The boards are connected as follow:&lt;/p&gt;
&lt;pre&gt;Board 1 (Sender)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Board 2 (Receiver)
P0.3 (TX)  ------------------- P0.3 (RX)
P0.4  (RTS) ------------------ P0.4 (CTS)
P0.28 (CTS) ------------------ P0.28 (RTS)&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt; I changed the code as follow (I am using nRF5_SDK_14.2.0):&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;--- a/nRF5_SDK_14.2.0_17b948a/examples/peripheral/uart/main.c&lt;br /&gt;+++ b/../../../main.c&lt;br /&gt;@@ -62,6 +62,17 @@&lt;br /&gt;&amp;nbsp;#include &amp;quot;nrf_uarte.h&amp;quot;&lt;br /&gt;&amp;nbsp;#endif&lt;br /&gt;&amp;nbsp;&lt;br /&gt;+#ifdef SENDER&lt;br /&gt;+#define UART_RX_PIN_NUMBER&amp;nbsp; 8&amp;nbsp; /* Received characters from the terminal */&lt;br /&gt;+#define UART_TX_PIN_NUMBER&amp;nbsp; 3&amp;nbsp; /* Send it to P0.3 */&lt;br /&gt;+#define UART_CTS_PIN_NUMBER 4&amp;nbsp; /* CTS: P0.4 */&lt;br /&gt;+#define UART_RTS_PIN_NUMBER 28 /* RTS: P0.28 */&lt;br /&gt;+#else&lt;br /&gt;+#define UART_RX_PIN_NUMBER&amp;nbsp; 3&amp;nbsp; /* Receive characters from Sender */&lt;br /&gt;+#define UART_TX_PIN_NUMBER&amp;nbsp; 6&amp;nbsp; /* Send characters to the terminal */&lt;br /&gt;+#define UART_CTS_PIN_NUMBER 28 /* RTS: P0.28 */&lt;br /&gt;+#define UART_RTS_PIN_NUMBER 4&amp;nbsp; /* RTS: P0.4 */&lt;br /&gt;+#endif&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;//#define ENABLE_LOOPBACK_TEST&amp;nbsp; /**&amp;lt; if defined, then this example will be a loopback test, which means that TX should be connected to RX to get data loopback. */&lt;br /&gt;&amp;nbsp;&lt;br /&gt;@@ -126,9 +137,10 @@ static void uart_loopback_test()&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;#else&lt;br /&gt;&amp;nbsp;/* When UART is used for communication with the host do not use flow control.*/&lt;br /&gt;-#define UART_HWFC APP_UART_FLOW_CONTROL_DISABLED&lt;br /&gt;+//#define UART_HWFC APP_UART_FLOW_CONTROL_ENABLED&lt;br /&gt;&amp;nbsp;#endif&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;/**&lt;br /&gt;&amp;nbsp; * @brief Function for main application entry.&lt;br /&gt;@@ -141,10 +153,10 @@ int main(void)&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const app_uart_comm_params_t comm_params =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RX_PIN_NUMBER,&lt;br /&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TX_PIN_NUMBER,&lt;br /&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTS_PIN_NUMBER,&lt;br /&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTS_PIN_NUMBER,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_RX_PIN_NUMBER,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_TX_PIN_NUMBER,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_RTS_PIN_NUMBER,&lt;br /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_CTS_PIN_NUMBER,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_HWFC,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_UART_BAUDRATE_115200&lt;br /&gt;@@ -159,6 +171,12 @@ int main(void)&lt;br /&gt;&lt;br /&gt;I cannot see the RTS/CTS signal change. I was expecting to see changes with RTS and CTS signals.&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Nordic_2D00_UART_2D00_example.png" /&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/125031?ContentTypeID=1</link><pubDate>Mon, 19 Mar 2018 14:42:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:137bc423-9916-48bd-8a0b-37bb3eb22eea</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Have you tested any of the uart examples, either SDK\examples\peripheral\uart or SDK\examples\peripheral\serial?&lt;/p&gt;
&lt;p&gt;Do you see the same behavior there?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/124646?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2018 18:05:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:199a9ee9-7cd1-4ba4-b4fd-de2d2ce1d8b8</guid><dc:creator>Olivier</dc:creator><description>&lt;p&gt;Actually the logic analyzer see the framing error. But I cannot find the error in my code.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/FramingError.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/124642?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2018 17:31:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6588063-359b-4051-a5ea-549e54ffbb2b</guid><dc:creator>Olivier</dc:creator><description>&lt;p&gt;Thanks Matt, you are right. By reversing the wire and the pinmux it did not help...&lt;/p&gt;
&lt;p&gt;I have made some progress (and I also added some logging using the other UART). I edited the code with the latest version&lt;/p&gt;
&lt;p&gt;Now, the receiver complains:&lt;/p&gt;
&lt;pre&gt;Error3 ret:0x3 (error_reg:0x4)&lt;br /&gt;&lt;br /&gt;From the doc (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52840.ps/uarte.html?cp=2_0_0_33_9_4#register.ERRORSRC"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52840.ps/uarte.html?cp=2_0_0_33_9_4#register.ERRORSRC),&lt;/a&gt; it means it is a FRAMING error (A valid stop bit is not detected on the serial data input after all bits in a character have been received.).&lt;/pre&gt;
&lt;p&gt;I am guessing I forgot something when sending my command. But I cannot find what is missing from the sender...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Hardware Flow control does not seem to work - Connecting two nRF52840 dev boards together</title><link>https://devzone.nordicsemi.com/thread/124631?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2018 16:02:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e501dad-1515-49e3-a327-8eb0af4d38ab</guid><dc:creator>Matt</dc:creator><description>&lt;p&gt;Why do you need the &amp;quot;#if SENDER ... #else... #endif&amp;quot; when you have already done the physical cross wiring between the two units?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>