<?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 configuration and communication with an external controller</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73381/uart-configuration-and-communication-with-an-external-controller</link><description>Hello Everyone, 
 I am developing one product using nRF52840 MCU, in this project my master controller is nRF52840 MCU and the host is STM-based MCU. 
 My goal is to make master and host communicate with each other using UART protocol. 
 So, here I referred</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Apr 2021 14:45:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73381/uart-configuration-and-communication-with-an-external-controller" /><item><title>RE: UART configuration and communication with an external controller</title><link>https://devzone.nordicsemi.com/thread/303233?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 14:45:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4c03008-9d7e-4328-bf15-f5b69feafe0a</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/73381/uart-configuration-and-communication-with-an-external-controller/303169#303169"]Did you succeed with getting the UART communication between the nRF and STM working?[/quote]
&lt;p&gt;- Using USB to TTL board I am able to Put data from nRF as of now. I have removed STM as of now but it is a project requirement so I will check it as I go. &lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/73381/uart-configuration-and-communication-with-an-external-controller/303169#303169"]You don&amp;#39;t necessarily have to do it differently with Freertos. [/quote]
&lt;p&gt;- I did not get this. &lt;/p&gt;
&lt;p&gt;My end project is, I have an STM board with its host and nRF as Master, Master sends commands to Host via UART.&lt;/p&gt;
&lt;p&gt;And this system is integrated with HVAC, so there is a wireless protocol that Openthread I am going to use to give commands using thread protocol. Here, I have a Gateway system which is also thread protocol, so If I give the command to Gateway, Gateway will send it to Master(nRF) via a wireless protocol, and then our nRF Master sends further to Host (STM) using UART protocol. So the requirement is development should be in freeRTOS.&lt;/p&gt;
&lt;p&gt;And I am new to this freeRTOS, with no prior experience with RTOS. So it could guide how to link files and how to create tasks for GPIO interrupt, UART, and others. or any nRF examples which has GPIO interrupts task in RTOS or others. It will really help me to understand build fast.&lt;/p&gt;
&lt;p&gt;Currently, I am going through some online videos regarding freeRTOS concepts.&lt;/p&gt;
&lt;p&gt;Please share if any.&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART configuration and communication with an external controller</title><link>https://devzone.nordicsemi.com/thread/303169?ContentTypeID=1</link><pubDate>Tue, 06 Apr 2021 13:10:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48b87299-5b71-4f08-b07f-9d2311a97a95</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Did you succeed with getting the UART communication between the nRF and STM working? You don&amp;#39;t necessarily have to do it differently with Freertos. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART configuration and communication with an external controller</title><link>https://devzone.nordicsemi.com/thread/302846?ContentTypeID=1</link><pubDate>Thu, 01 Apr 2021 11:23:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbb6bba2-f4d4-49dd-b8cd-511e4cae5b19</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;I would like to configure the UART in freeRTOS, I am new to this, can you please guide me to configure UART in freeRTOS and execute the same.&lt;/p&gt;
&lt;p&gt;Please the step-by-step guide to understand.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART configuration and communication with an external controller</title><link>https://devzone.nordicsemi.com/thread/302668?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 04:43:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8d7a974-446d-474e-bd28-05ce8d749d03</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thank you so much for the response,&lt;/p&gt;
&lt;p&gt;No, what I mean is after changing pins to other GPIO I would like to connect Putty (to check data) to nRF&amp;#39;s GPIOs and STM MCU UART pins, so if any data put() from nRF, STM should receive that and if any data put() from STM, nRF should receive that and display received data on putty.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/73381/uart-configuration-and-communication-with-an-external-controller/302620#302620"]I suggest you try pin P0.26 and P0.27 (or some other GPIOs that are available) and only test the communication between the two boards.[/quote]
&lt;p&gt;- means, to use other pins we just need to give pin numbers to Tx and Rx, there is no need for any pin configuration functions. am I correct?.&lt;/p&gt;
&lt;p&gt;Hey, I tried the pin change as per your suggestion, Now what I did is, the nRF dev-kit I directly connected the TTL board (UAB to TTL board), below is the connection and code&lt;/p&gt;
&lt;p&gt;nRF Tx (P0.26) - TTL Rx pin&lt;/p&gt;
&lt;p&gt;nRF Rx (P0.27) - TTL Tx pin&lt;/p&gt;
&lt;p&gt;below is my code,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define UART_TX_BUF_SIZE 256                         /**&amp;lt; UART TX buffer size. */
#define UART_RX_BUF_SIZE 256                         /**&amp;lt; UART RX buffer size. */

#define UART_TX_PIN   NRF_GPIO_PIN_MAP(0,26)
#define UART_RX_PIN   NRF_GPIO_PIN_MAP(0,27)


#define UART_HWFC APP_UART_FLOW_CONTROL_DISABLED

char * send_cmd = &amp;quot;Hello_Wellcome!&amp;quot;;

void uart_err_handler (app_uart_evt_t *p)
{

      uint32_t i;
      for(i = 0; i &amp;lt; sizeof(send_cmd); i++)
      {
          while (app_uart_put(send_cmd[i]) != NRF_SUCCESS);
          
      }
}
/**
 * @brief Function for main application entry.
 */
int main(void)
{
   uint32_t err_code;

   bsp_board_init(BSP_INIT_LEDS);

   const app_uart_comm_params_t com_parm = 
   {
      UART_RX_PIN,
      UART_TX_PIN,
      RTS_PIN_NUMBER,
      CTS_PIN_NUMBER,
      UART_HWFC,
      false,
      NRF_UART_BAUDRATE_115200
   };

      APP_UART_FIFO_INIT(&amp;amp;com_parm,
                         UART_RX_BUF_SIZE,
                         UART_TX_BUF_SIZE,
                         uart_err_handler,
                         APP_IRQ_PRIORITY_LOWEST,
                         err_code);

    APP_ERROR_CHECK(err_code);

   while(true)
   {

   }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here, I am not able to display data on TTL&amp;#39;s putty. Unless I press any key from pc keyboard. After keypress, it starts continuously printing data on putty (that to only &amp;quot;Hell&amp;quot;) did not display all data.&lt;/p&gt;
&lt;p&gt;Can you please check the code where did I go wrong? Why it is required any key from pc keyboard?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART configuration and communication with an external controller</title><link>https://devzone.nordicsemi.com/thread/302620?ContentTypeID=1</link><pubDate>Tue, 30 Mar 2021 14:28:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a567de45-2318-4d01-8338-faeb49ad9440</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You should not have multiple transmitters on an UART bus (Putty from PC + nRF +STM) as it doesn&amp;#39;t have any addressing mechanism. I suggest you try pin P0.26 and P0.27 (or some other GPIOs that are available) and only test the communication between the two boards. For the nRF at least, you can use RTT logging to display data received on UART.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>