<?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 Communication between nrf52840 and nrf9160 on nrf9160 dk</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58034/uart-communication-between-nrf52840-and-nrf9160-on-nrf9160-dk</link><description>Hello, 
 
 We have an nrf9160 dk-pca10090 board. 
 
 We want to know if there is a way to make the two processors (nrf52840 and nrf9160) communicate using uart. 
 
 Kindly point us to a sample uart program to achieve this. 
 
 Thanks 
 Regards</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Mar 2020 10:24:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58034/uart-communication-between-nrf52840-and-nrf9160-on-nrf9160-dk" /><item><title>RE: UART Communication between nrf52840 and nrf9160 on nrf9160 dk</title><link>https://devzone.nordicsemi.com/thread/237376?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 10:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b300301-790e-4c76-b442-d3a6fcbb106c</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="smauelGIS"]however&amp;nbsp;we do not have any communication&lt;span&gt;&amp;nbsp;between 9160 and 52840, specifically from 52840 to 9160.&lt;/span&gt;[/quote]
&lt;p&gt;Try setting&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOARD_PCA10090_INTERFACE0_MCU=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BOARD_PCA10090_INTERFACE1_MCU=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;in the nRF52840 project.&amp;nbsp;&lt;/span&gt;See &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kconfig/CONFIG_BOARD_PCA10090_INTERFACE0_MCU.html?highlight=config_board_pca10090_interface0_mcu#cmdoption-arg-config-board-pca10090-interface0-mcu"&gt;this link&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Communication between nrf52840 and nrf9160 on nrf9160 dk</title><link>https://devzone.nordicsemi.com/thread/235461?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 13:17:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbc96c76-8d69-4407-a456-0c677b5a6533</guid><dc:creator>smauelGIS</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We have applied the above, we wrote the code below;&lt;/p&gt;
&lt;p&gt;On 52840&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;misc/printk.h&amp;gt;
#include &amp;lt;uart.h&amp;gt;
#include &amp;lt;drivers/console/uart_pipe.h&amp;gt;


static u8_t uart_buf[1024];
static struct device *uart_pipe_dev;
int count = 0;

uart_pipe_recv_cb uart_cb(u8_t *buf, size_t *off){
  printk(&amp;quot;received data on 52&amp;quot;);
  return (uart_pipe_recv_cb)uart_buf;
}


void main(void)
{
        printk(&amp;quot;Started application uart send and read on 52 \n&amp;quot;);
       uart_pipe_register(uart_buf,sizeof(uart_buf),uart_cb);
        while (1) {
            count++;
            u8_t* data = &amp;amp;count;            
            int sent = uart_pipe_send(data,sizeof(data));
            if(sent&amp;gt;-1){
              printk(&amp;quot;sent data %d, with size %d \n&amp;quot;, count,sizeof(data));
            }else{
              printk(&amp;quot;Could not send data \n&amp;quot;);
            }
            k_sleep(2000);
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On 9160&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;misc/printk.h&amp;gt;
#include &amp;lt;uart.h&amp;gt;
#include &amp;lt;drivers/console/uart_pipe.h&amp;gt;


static u8_t uart_buf[1024];
static struct device *uart_pipe_dev;
int count = 0;


uart_pipe_recv_cb uart_cb(u8_t *buf, size_t *off){ 
  printk(&amp;quot;received \n&amp;quot;);
  
  return buf;
}


void main(void)
{
        printk(&amp;quot;Started application uart send and read on 91 \n&amp;quot;);
       u8_t uart_buf_init;
       uart_pipe_register(&amp;amp;uart_buf_init,sizeof(uart_buf_init),uart_cb);
        while (1) {
            count = count + 1;
            u8_t* data = &amp;amp;count;            
            int sent = uart_pipe_send(data,sizeof(data));
            if(sent&amp;gt;-1){
              printk(&amp;quot;sent data %d, with size %d \n&amp;quot;, count,sizeof(data));
            }else{
              printk(&amp;quot;Could not send data \n&amp;quot;);
            }
            k_sleep(2000);
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;however&amp;nbsp;we do not have any communication&lt;span&gt;&amp;nbsp;between 9160 and 52840, specifically from 52840 to 9160.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The only thing we had was a loopback on 9160 when we put a cable from pin P0.17 to P0.18. Could you please share sample code or what specifically we have to do to get this done.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks and Regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Communication between nrf52840 and nrf9160 on nrf9160 dk</title><link>https://devzone.nordicsemi.com/thread/235304?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 04:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:630df2f7-e70d-4d1f-a81a-e24a495e1481</guid><dc:creator>miked531</dc:creator><description>&lt;p&gt;I was able to adapt the uart_pipe code (in ncs v1.2 at ./zephyr/drivers/console/uart_pipe.c) with the following changes for the 9160 image:&lt;/p&gt;
&lt;p&gt;prj.conf:&lt;br /&gt;CONFIG_UART_PIPE=y&lt;br /&gt;CONFIG_UART_PIPE_ON_DEV_NAME=&amp;quot;UART_2&amp;quot;&lt;br /&gt;CONFIG_UART_CONSOLE_LOG_LEVEL_INF=y&lt;br /&gt;### configure the uart between 9160 and 52840&lt;br /&gt;CONFIG_UART_2_NRF_UARTE=y&lt;br /&gt;CONFIG_UART_2_NRF_FLOW_CONTROL=y&lt;br /&gt;CONFIG_UART_INTERRUPT_DRIVEN=y&lt;/p&gt;
&lt;p&gt;child_secure_partition_manager.conf:&lt;br /&gt;CONFIG_SPM_NRF_UARTE2_NS=y&lt;/p&gt;
&lt;p&gt;nrf9160_pca10090ns.overlay:&lt;br /&gt;/ {&lt;br /&gt; chosen {&lt;br /&gt; zephyr,bt-uart=&amp;amp;uart2;&lt;br /&gt; };&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;uart2 {&lt;br /&gt; current-speed = &amp;lt;1000000&amp;gt;;&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; tx-pin = &amp;lt;18&amp;gt;;&lt;br /&gt; rx-pin = &amp;lt;17&amp;gt;;&lt;br /&gt; rts-pin = &amp;lt;21&amp;gt;;&lt;br /&gt; cts-pin = &amp;lt;19&amp;gt;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;And for building the image for the nrf52840:&lt;/p&gt;
&lt;p&gt;prj.conf:&lt;br /&gt;CONFIG_UART_PIPE=y&lt;br /&gt;CONFIG_UART_PIPE_ON_DEV_NAME=&amp;quot;UART_1&amp;quot;&lt;br /&gt;CONFIG_UART_CONSOLE_LOG_LEVEL_INF=y&lt;br /&gt;CONFIG_UART_1_NRF_UARTE=y&lt;br /&gt;CONFIG_UART_1_NRF_FLOW_CONTROL=y&lt;/p&gt;
&lt;p&gt;nrf52840_pca10090.overlay:&lt;br /&gt;/ {&lt;br /&gt; chosen {&lt;br /&gt; zephyr,uart-pipe=&amp;amp;uart1;&lt;br /&gt; };&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;uart1 {&lt;br /&gt; compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;&lt;br /&gt; current-speed = &amp;lt;1000000&amp;gt;;&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; tx-pin = &amp;lt;17&amp;gt;;&lt;br /&gt; rx-pin = &amp;lt;20&amp;gt;;&lt;br /&gt; rts-pin = &amp;lt;15&amp;gt;;&lt;br /&gt; cts-pin = &amp;lt;22&amp;gt;;&lt;br /&gt;};&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>