<?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>nrf9160 cannot enable uarte2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47076/nrf9160-cannot-enable-uarte2</link><description>Hi 
 I am using the mqtt_simple project and want to use the second UART (UARTE2) for other serial communication. 
 
 For quick test I have add the folloing in the main function: 
 struct device *uart1 = device_get_binding(&amp;quot;UART_1&amp;quot;); uart_irq_callback_set</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 May 2019 11:15:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47076/nrf9160-cannot-enable-uarte2" /><item><title>RE: nrf9160 cannot enable uarte2</title><link>https://devzone.nordicsemi.com/thread/186384?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 11:15:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88b951a9-1c3c-4250-8cfc-a5b52a5c5918</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I am glad you were able to get this working! In regards to the pin mapping, please see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45476/connecting-uart1-to-a-periph-on-nrf9160-dk"&gt;this thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 cannot enable uarte2</title><link>https://devzone.nordicsemi.com/thread/186255?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 16:33:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:265849d4-e49c-449c-ae12-def732cf3e1d</guid><dc:creator>PederOlav</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Last night I modified Kconfig file for SPM:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;config SPM_NRF_UARTE2_NS&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; bool &amp;quot;UARTE2 is Non-Secure&amp;quot;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; # default n&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; default y&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Default was n, and&amp;nbsp;and then I build SPM again.&lt;/p&gt;
&lt;p&gt;After I added to the mqtt_simple&amp;#39;s prj.conf file:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;# UART 1&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;CONFIG_UART_1_NRF_UARTE=y&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So now I have serial communication through the VCOM2 :-)&lt;/p&gt;
&lt;p&gt;So I did not use any overlay file to get this running.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But today I have wanted to use some IO pins for serial communication, not VCOM2.&lt;/p&gt;
&lt;p&gt;Then I read that I have to program the nrf52840 to achieve this (personally I would have prefer a more hardware related solution with open/close the signal paths on a development kit). So I changed the Kconfig file for the nrf52840_pca10090:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;prompt &amp;quot;nRF9160 UART1 routing&amp;quot;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;#default BOARD_PCA10090_UART1_VCOM&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;default BOARD_PCA10090_UART1_ARDUINO&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Set to default &lt;span&gt;BOARD_PCA10090_UART1_ARDUINO&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Since I used the hello_world sample, I added to the prj.conf file:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CONFIG_BOARD_PCA10090_UART1_ARDUINO=y&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I built and program zephyr\samples\hello_world to the nrf52840&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I lost my serial communication with VCOM2 which was expected, but I did not get the serial communication at the expected pins&amp;nbsp; (P0.00 - TXD, P0.01 - RXD, P0.14 - CTS and P0.15 RTS). I checked and found out that the voltage level was not 3.3V, but 1.8V and I am pretty sure I have TXD from nrf9160 on pin P0.01 and not RXD which is documented in nRF91_DK_User_Guide, Table 4: Board control routing&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I have serial communication through the IO pins also :-)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I do not know if it was an overlay file before I started or I made/copy it myself to be honest, but in the spm project I have an overlay file (which I need to have if not build error). The content of this overlay file is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;/* needed to get the NRF_UARTE2 defined */&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;amp;uart2 {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; status = &amp;quot;ok&amp;quot;;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;};&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To summarize, I have UARTE2 communication through the IO pins, or should I refer to the uart as UART_1. I am confused about the naming here.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 cannot enable uarte2</title><link>https://devzone.nordicsemi.com/thread/186108?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 08:42:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04a886fd-9045-4a60-8596-1d091d827867</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You need to add UART settings in an &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/application/index.html?highlight=overlay#device-tree-overlays"&gt;overlay file&lt;/a&gt;.&amp;nbsp;&lt;span&gt;How it&amp;#39;s done is that you create a &amp;quot;$BOARD.overlay&amp;quot; file, in this case named &amp;quot;nrf9160_pca10090ns.overlay&amp;quot; in the project you want to evaluate, for instance $ncs/samples/nrf9160/mqtt_simple/nrf9160_pca10090ns.overlay, which &amp;quot;describes&amp;quot; the peripherals used. Below is an example of this type of file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/* needed to get the NRF_UARTE2 defined */
&amp;amp;uart2 {
	current-speed = &amp;lt;1000000&amp;gt;;
	status = &amp;quot;ok&amp;quot;;
	tx-pin = &amp;lt;18&amp;gt;;
	rx-pin = &amp;lt;17&amp;gt;;
	rts-pin = &amp;lt;19&amp;gt;;
	cts-pin = &amp;lt;21&amp;gt;;
};

&amp;amp;uart1 {
	current-speed = &amp;lt;115200&amp;gt;;
	status = &amp;quot;ok&amp;quot;;
	tx-pin = &amp;lt;MY_TXD&amp;gt;;
	rx-pin = &amp;lt;MY_RXD&amp;gt;;
	rts-pin = &amp;lt;MY_RTS&amp;gt;;
	cts-pin = &amp;lt;MY_CTS&amp;gt;;
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You may have to add the same overlay, with UART2 only, to the SPM folder as well. But please try in MQTT_SIMPLE first.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;This cause errors:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Exception occurred in Secure State&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;***** HARD FAULT *****&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; Fault escalation (see below)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;***** BUS FAULT *****&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; Precise data bus error&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; BFAR Address: 0x50008120&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;***** Hardware exception *****&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Current thread ID = 0x20020284&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Faulting instruction address = 0x959a&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Fatal fault in ISR! Spinning...&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thiis error is due to the missing overlay file.&lt;br /&gt;&lt;br /&gt;Let me know how this works for you!&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>