<?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>Baremetal UART TXD blocked due to HWFC regardless MACRO definition</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24948/baremetal-uart-txd-blocked-due-to-hwfc-regardless-macro-definition</link><description>Well, it is one of my explorations in NRF51822. I am working on a bare-metal UART demo, so far there are no output from TXD. 
 Configuration 
 
 MDK5 + STLINK/V2, with optional OpenOCD in Windows/Linux 
 nRF51822 breakout with pitch converter. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Sep 2017 03:39:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24948/baremetal-uart-txd-blocked-due-to-hwfc-regardless-macro-definition" /><item><title>RE: Baremetal UART TXD blocked due to HWFC regardless MACRO definition</title><link>https://devzone.nordicsemi.com/thread/98249?ContentTypeID=1</link><pubDate>Wed, 06 Sep 2017 03:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2908f92-e337-48ea-bbc9-1489a6c3073a</guid><dc:creator>allankliu</dc:creator><description>&lt;p&gt;I found it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const app_uart_comm_params_t comm_params =
  {
      RX_PIN_NUMBER,
      TX_PIN_NUMBER,
      RTS_PIN_NUMBER,
      CTS_PIN_NUMBER,
      APP_UART_FLOW_CONTROL_ENABLED,
      false,
      UART_BAUDRATE_BAUDRATE_Baud115200
  };
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The struct variable enabled FLOW_CONTROL as true, while HWFC is useless. We have to disable it as following code.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const app_uart_comm_params_t comm_params =
  {
      RX_PIN_NUMBER,
      TX_PIN_NUMBER,
      RTS_PIN_NUMBER,
      CTS_PIN_NUMBER,
      APP_UART_FLOW_CONTROL_DISABLED,//APP_UART_FLOW_CONTROL_ENABLED,
      false,
      UART_BAUDRATE_BAUDRATE_Baud115200
  };
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can not replace it with HWFC, since in the stuct, it is a enum, not a macro.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;typedef struct
{
    uint32_t                rx_pin_no;    /**&amp;lt; RX pin number. */
    uint32_t                tx_pin_no;    /**&amp;lt; TX pin number. */
    uint32_t                rts_pin_no;   /**&amp;lt; RTS pin number, only used if flow control is enabled. */
    uint32_t                cts_pin_no;   /**&amp;lt; CTS pin number, only used if flow control is enabled. */
    app_uart_flow_control_t flow_control; /**&amp;lt; Flow control setting, if flow control is used, the system will use low power UART mode, based on CTS signal. */
    bool                    use_parity;   /**&amp;lt; Even parity if TRUE, no parity if FALSE. */
    uint32_t                baud_rate;    /**&amp;lt; Baud rate configuration. */
} app_uart_comm_params_t;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>