<?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>simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58502/simple-uart-example-nrf9160dk</link><description>I am new to the nRF9160dk board. I have been able to compile and run some of the sample programs. I am now looking to have a simple program to talk to external uarts 0 and 1. I have found a githib project https://github.com/Rallare/fw-nrfconnect-nrf/tree</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Mar 2020 16:53:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58502/simple-uart-example-nrf9160dk" /><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/240112?ContentTypeID=1</link><pubDate>Mon, 16 Mar 2020 16:53:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48b4737e-49fa-4a47-81f7-3b662394e7ab</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;this can be closed. The ticket is answered for the using the UART on the nRF9160dk board.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/238106?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 16:07:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a6b03e1-154d-47e3-ae11-729f8bb7f842</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tjm1"]is there a way to get UART_0 pins GPIO 28/29 out to an edge connector?[/quote]
&lt;p&gt;&amp;nbsp;Yes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="tjm1"]If I wire up the nRF9160 part on a board by itself will UART_0 come to P0.28 and P0.29?[/quote]
&lt;p&gt;&amp;nbsp;No, not without some extra steps.&lt;/p&gt;
&lt;p&gt;UART_0 and UART_1 are by default routed to the VCOM0 and 1 pins of the on-board debugger. However, you can change this using the board controller (the nRF52840 on the DK).&lt;/p&gt;
&lt;p&gt;You can read more about the board controller &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.2.0/zephyr/boards/arm/nrf52840_pca10090/doc/index.html#board-controller-firmware"&gt;here&lt;/a&gt;, and on the &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/board_controller.html"&gt;infocenter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attached a modified version of Zephyr&amp;#39;s hello_world sample where I have added CONFIG_BOARD_PCA10090_UART0_ARDUINO=y to the prj.conf. The sample is then built for the nrf52840_pca10090 board and flashed to the board controller. Remember to set SW5 on the DK to &amp;quot;nRF52&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-48b01faac53c45b0a2dab0f5c674a256/zephyr.hex"&gt;devzone.nordicsemi.com/.../zephyr.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="tjm1"]if we have our own board will the pins come out correctly? is there anything we would need to do special to get the pins out externally on our own board?[/quote]
&lt;p&gt;&amp;nbsp;On a custom board, it should not be a problem. However, you might want to change which pins are used in the device tree. While you can do that by changing the .dts files in the boards/nrf9160_pca10090 folder, I recommend you instead define your own board. You can read more here: &lt;a href="https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/nrf-connect-sdk-tutorial---part-3-temporary#h11sk6ks1jkp1figkuq6gxw1m1rctdp0"&gt;https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/nrf-connect-sdk-tutorial---part-3-temporary#h11sk6ks1jkp1figkuq6gxw1m1rctdp0&lt;/a&gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/238088?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 15:03:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50ece500-ff89-4dbf-b6c1-0408f48bd2f9</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;Didrik&lt;/p&gt;
&lt;p&gt;I was able to move the directory around under the sample directory and it is working for me now. I can use the virtual COM port UART_0&lt;/p&gt;
&lt;p&gt;for both input and output. Thanks for your help and suggestions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;is there a way to get UART_0 pins GPIO 28/29 out to an edge connector? I want to be able to connect to a real COM port. If I wire up the nRF9160 part on a board by itself will UART_0 come to P0.28 and P0.29? this is the idea we are evaluating the device using the nRF9160dk but we will design our own board. so can I get these pins to an external connector? if we have our own board will the pins come out correctly? is there anything we would need to do special to get the pins out externally on our own board?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/238085?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 14:56:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66c22c8c-5277-4170-986c-b0f1f2433c22</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;How do you connect to the board?&lt;/p&gt;
&lt;p&gt;Can you send me your &amp;lt;buildfolder&amp;gt;/zephyr/zephyr.dts file?&lt;/p&gt;
&lt;p&gt;Again, the code works fine for me. I have attached the project that I used, with a pre-compiled hex file so you can see if there are any differences.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-48b01faac53c45b0a2dab0f5c674a256/uart_5F00_loopback.zip"&gt;devzone.nordicsemi.com/.../uart_5F00_loopback.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/237793?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 14:00:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4759f557-0273-4854-af51-6ac888390f02</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;Didrik&lt;/p&gt;
&lt;p&gt;I tried the terminal emulator Termite. I do not see any characters on the input. chIn never gets changed from its initial value of &amp;#39;x&amp;#39;;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;below is my prj.conf file. should this be something different. I am sure it is something simple I have left out. any ideas?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_SERIAL=y&lt;br /&gt;CONFIG_TRUSTED_EXECUTION_NONSECURE=y&lt;br /&gt;CONFIG_UART_INTERRUPT_DRIVEN=n&lt;br /&gt;CONFIG_MAIN_STACK_SIZE=4096&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;just to make sure I have repaste dthe code I am running.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;zephyr.h&amp;gt;&lt;br /&gt;//#include &amp;lt;misc/printk.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/printk.h&amp;gt;&lt;br /&gt;//#include &amp;lt;uart.h&amp;gt;&lt;br /&gt;#include &amp;lt;drivers/uart.h&amp;gt;&lt;/p&gt;
&lt;p&gt;static u8_t uart_buf[1024];&lt;/p&gt;
&lt;p&gt;void main(void)&lt;br /&gt;{&lt;br /&gt; unsigned char chIn = &amp;#39;x&amp;#39;;&lt;br /&gt; int resIn = 0;&lt;/p&gt;
&lt;p&gt;struct device *uart = device_get_binding(&amp;quot;UART_0&amp;quot;);&lt;/p&gt;
&lt;p&gt;printk(&amp;quot;Sensor Test Start!\n&amp;quot;);&lt;br /&gt; while(1)&lt;br /&gt; {&lt;br /&gt; resIn = uart_poll_in(uart,&amp;amp;chIn);&lt;br /&gt; printk(&amp;quot;%d %c\r\n&amp;quot;,resIn,chIn);&lt;br /&gt; if(resIn == 0)&lt;br /&gt; {&lt;br /&gt; printk(&amp;quot;chIn: %c&amp;quot;,chIn);&lt;br /&gt; uart_poll_out(uart,chIn);&lt;br /&gt; }&lt;br /&gt; k_sleep(1000);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;printk(&amp;quot;UART loopback start!\n&amp;quot;);&lt;br /&gt; while (1)&lt;br /&gt; {&lt;br /&gt; k_cpu_idle();&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/237770?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 13:25:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71aeb4ae-2db6-4435-89cc-b6413a79fd33</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Could you try with a different terminal emulator, such as &lt;a href="https://www.compuphase.com/software_termite.htm"&gt;Termite&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/237741?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 12:51:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84eec348-915b-4941-9f4a-459f6c83abed</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;Didrik&lt;/p&gt;
&lt;p&gt;yes I know -1 is no character available. I am hitting the keyboard and holding the key down. it does not see any input on the TeraTerm port.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;PM: NS image at 0xc000&lt;br /&gt;SPM: NS MSP at 0x20021178&lt;br /&gt;SPM: NS reset vector at 0xcc25&lt;br /&gt;SPM: prepare to jump to Non-Secure image.&lt;br /&gt;*** Booting Zephyr OS build v2.1.99-ncs1 ***&lt;br /&gt;Sensor Test Start!&lt;br /&gt;-1 x&lt;br /&gt;-1 x&lt;br /&gt;-1 x&lt;br /&gt;-1 x&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/237672?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 10:00:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67293612-9e8b-4b76-a1c0-cf850a4463a3</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;The code you sent me worked for me:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-48b01faac53c45b0a2dab0f5c674a256/uart_5F00_loopback.txt"&gt;devzone.nordicsemi.com/.../uart_5F00_loopback.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(the -1 means that there were no input)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/237541?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 17:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e0183fc-6c3a-47b3-a7d5-5ef836cbebd2</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;Didrik&lt;/p&gt;
&lt;p&gt;I will look at the board controller link you referred me too. I want to do something very simple. I want to have a loop where I can read characters and echo them. The example is below. I do not want interrupts. I want a simple polling method. I want to poll for an input character and&amp;nbsp;wait until I see a 0 (chacter available) and print it. the example below never sees a character. I get a &amp;quot;-35 x&amp;quot; for&amp;nbsp;&lt;span&gt;printk(&amp;quot;%d %c\r\n&amp;quot;,resIn,chIn); line. I am using TeraTerm for UART0 and I can see the printk and uart_poll_out() messages.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;any idea why I do not see any characters&amp;nbsp;on uart_poll_in(). I can output the character using uart_poll_out() so I know the uart is selected correctly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;zephyr.h&amp;gt;&lt;br /&gt;//#include &amp;lt;misc/printk.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/printk.h&amp;gt;&lt;br /&gt;//#include &amp;lt;uart.h&amp;gt;&lt;br /&gt;#include &amp;lt;drivers/uart.h&amp;gt;&lt;/p&gt;
&lt;p&gt;static u8_t uart_buf[1024];&lt;/p&gt;
&lt;p&gt;void main(void)&lt;br /&gt;{&lt;br /&gt; unsigned char chIn = &amp;#39;x&amp;#39;;&lt;br /&gt; int resIn = 0;&lt;/p&gt;
&lt;p&gt;struct device *uart = device_get_binding(&amp;quot;UART_0&amp;quot;);&lt;/p&gt;
&lt;p&gt;printk(&amp;quot;Sensor Test Start!\n&amp;quot;);&lt;br /&gt; while(1)&lt;br /&gt; {&lt;br /&gt; resIn = uart_poll_in(uart,&amp;amp;chIn);&lt;br /&gt; printk(&amp;quot;%d %c\r\n&amp;quot;,resIn,chIn);&lt;br /&gt; if(resIn == 0)&lt;br /&gt; {&lt;br /&gt; printk(&amp;quot;%c&amp;quot;,chIn);&lt;br /&gt; uart_poll_out(uart,chIn);&lt;br /&gt; }&lt;br /&gt; k_sleep(1000);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;printk(&amp;quot;UART loopback start!\n&amp;quot;);&lt;br /&gt; while (1) &lt;br /&gt; {&lt;br /&gt; k_cpu_idle();&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: simple UART example nrf9160dk</title><link>https://devzone.nordicsemi.com/thread/237517?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 15:22:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33614bb6-77c7-4b76-901c-3aaa283339e3</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;The pins used are connected to the debugger, which also acts as a UART&amp;lt;-&amp;gt;USB bridge, so you will not see any activity on the headers (this can be changed by the board controller, you can read more &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/boards/arm/nrf52840_pca10090/doc/index.html"&gt;here&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;On your computer, you should see the nRF91DK as 3 virtual COM ports. One of them will display the log from the DK. In a terminal (such&amp;nbsp; as TeraTerm), you should then be able to write something, and see it printed back by the device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>