<?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>How to make LOG_INF and LOG_ERR print over UART0 in nrf9160?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73368/how-to-make-log_inf-and-log_err-print-over-uart0-in-nrf9160</link><description>In the past I was able to get the Serial LTE Example application working over UART0 on the pins used in my custom board. I did so by adding a file called nrf9160dk_nrf9160.overlay with the lines &amp;amp;uart0 { current-speed = &amp;lt;115200&amp;gt;; status = &amp;quot;okay&amp;quot;; tx-pin</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Mar 2021 20:13:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73368/how-to-make-log_inf-and-log_err-print-over-uart0-in-nrf9160" /><item><title>RE: How to make LOG_INF and LOG_ERR print over UART0 in nrf9160?</title><link>https://devzone.nordicsemi.com/thread/302817?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 20:13:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1bacfe2-5cd3-4383-b14b-8e6b1685d24b</guid><dc:creator>JWizard</dc:creator><description>&lt;p&gt;Hi Markus,&lt;br /&gt;&lt;br /&gt;So I kept trying different things and I came up with something that seems to work okay.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I completely removed the .overlay from the SPM folder and changed my overlay in the mqtt_simple folder to&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;uart0 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;current-speed = &amp;lt;115200&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; tx-pin = &amp;lt;1&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rx-pin = &amp;lt;0&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rts-pin = &amp;lt;0xFFFFFFFF&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; cts-pin = &amp;lt;0xFFFFFFFF&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;uart1 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;current-speed = &amp;lt;115200&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; tx-pin = &amp;lt;29&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rx-pin = &amp;lt;28&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rts-pin = &amp;lt;27&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; cts-pin = &amp;lt;26&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;Basically I just swapped the pins and disabled the RTS and CTS for UART0. Seems like it really wanted UART1 to be enabled, because now I get this on my external MCU (edited to remove anything that might be identifying)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*** Booting Zephyr OS build v2.4.99-ncs1 ***&lt;br /&gt;[00:00:00.205,566] &amp;lt;inf&amp;gt; at_host: UART check failed: 12. Dropping buffer and retrying.&lt;br /&gt;[00:00:00.215,667] &amp;lt;inf&amp;gt; mqtt_simple: The MQTT simple sample started&lt;br /&gt;[00:00:00.215,667] &amp;lt;inf&amp;gt; mqtt_simple: Provisioning certificates&lt;br /&gt;[00:00:00.537,261] &amp;lt;inf&amp;gt; mqtt_simple: Disabling PSM and eDRX&lt;br /&gt;[00:00:00.544,799] &amp;lt;inf&amp;gt; mqtt_simple: LTE Link Connecting...&lt;br /&gt;+CEREG: **REDACTED**&lt;br /&gt;+CSCON: 1&lt;br /&gt;+CEREG: **REDACTED**&lt;br /&gt;[00:00:08.957,733] &amp;lt;inf&amp;gt; mqtt_simple: LTE Link Connected!&lt;br /&gt;[00:00:09.139,678] &amp;lt;inf&amp;gt; mqtt_simple: IPv4 Address found **REDACTED**&lt;br /&gt;[00:00:09.139,709] &amp;lt;inf&amp;gt; mqtt_simple: TLS enabled&lt;br /&gt;[00:00:13.368,621] &amp;lt;inf&amp;gt; mqtt_simple: MQTT client connected&lt;br /&gt;[00:00:13.368,621] &amp;lt;inf&amp;gt; mqtt_simple: Subscribing to: **REDACTED** len 16&lt;br /&gt;[00:00:13.547,607] &amp;lt;inf&amp;gt; mqtt_simple: SUBACK packet id: 1234&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So far so good, only why does it say &amp;quot;at_host: UART check failed?&amp;quot; Best guess is at_host wanted to check UART 1 and nothing is connected to pins 26-29. On the up side I can issue AT commands and I get responses and everything checks out.&lt;br /&gt;&lt;br /&gt;On the down side I&amp;#39;ve got an error message in the bootup that I don&amp;#39;t understand. If I can use at_host through UART0 why is UART1 necessary and what is the true meaning of the error message?&lt;br /&gt;&lt;br /&gt;I&amp;#39;ll mark this as the answer anyway since it answers the question I asked directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make LOG_INF and LOG_ERR print over UART0 in nrf9160?</title><link>https://devzone.nordicsemi.com/thread/302790?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 15:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f070dad-d164-49d2-b15c-687d974bbfe2</guid><dc:creator>JWizard</dc:creator><description>&lt;p&gt;Hi Markus,&lt;br /&gt;&lt;br /&gt;I received the information about the second overlay file here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64677/changing-uart0-pins-for-custom-nrf9160-board"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/64677/changing-uart0-pins-for-custom-nrf9160-board&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This file was located at ncs/v1.5.0/nrf/samples/spm&lt;br /&gt;&lt;br /&gt;I removed it and rebuilt. It doesn&amp;#39;t seem to have made any difference either way.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make LOG_INF and LOG_ERR print over UART0 in nrf9160?</title><link>https://devzone.nordicsemi.com/thread/302781?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 14:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57b4f32a-bdc1-4159-b3d1-6d2700f38967</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;Thanks for the clarification!&lt;/p&gt;
&lt;p&gt;The changes you made in nrf9160dk_nrf9160ns.overlay look correct to me.&lt;/p&gt;
&lt;p&gt;But I wonder why you added one more overlay file in the SPM directory? I’m not sure if this is necessary. Where exactly is the file located in your project?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make LOG_INF and LOG_ERR print over UART0 in nrf9160?</title><link>https://devzone.nordicsemi.com/thread/302643?ContentTypeID=1</link><pubDate>Tue, 30 Mar 2021 17:19:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37019af4-6155-4c83-9fc9-bb3d7ae2b01f</guid><dc:creator>JWizard</dc:creator><description>&lt;p&gt;Hi Markus,&lt;br /&gt;&lt;br /&gt;Thank you for the quick reply.&lt;br /&gt;&lt;br /&gt;My zephyr.dts checks out exactly as you show given the changes I wanted to see.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;uart0: uart@8000 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; reg = &amp;lt; 0x8000 0x1000 &amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; interrupts = &amp;lt; 0x8 0x1 &amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; label = &amp;quot;UART_0&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; current-speed = &amp;lt; 0x1c200 &amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; tx-pin = &amp;lt; 0x1 &amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rx-pin = &amp;lt; 0x0 &amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rts-pin = &amp;lt; 0xffffffff &amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; cts-pin = &amp;lt; 0xffffffff &amp;gt;;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;code&gt;chosen {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,flash-controller = &amp;amp;flash_controller;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,entropy = &amp;amp;cryptocell_sw;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,console = &amp;amp;uart0;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,shell-uart = &amp;amp;uart0;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,uart-mcumgr = &amp;amp;uart0;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,flash = &amp;amp;flash0;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,sram = &amp;amp;sram0_ns;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; zephyr,code-partition = &amp;amp;slot0_ns_partition;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; };&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It was already like this, but I did a fresh build anyway. No change in behavior. Nothing on UART0, not even the boot messages if I reset the chip.&lt;br /&gt;&lt;br /&gt;Let me clarify how I do the overlays in case something has changed since this method was given to me:&lt;br /&gt;&lt;br /&gt;1) In the mqtt_simple project directory I placed a new file called nrf9160dk_nrf9160ns.overlay (note the &amp;quot;ns&amp;quot;)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;uart1 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;status = &amp;quot;disabled&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;uart0 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; current-speed = &amp;lt;115200&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; tx-pin = &amp;lt;1&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rx-pin = &amp;lt;0&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rts-pin = &amp;lt;0xFFFFFFFF&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; cts-pin = &amp;lt;0xFFFFFFFF&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;2) In the SPM directory I&amp;nbsp;added nrf9160dk_nrf9160.overlay (note the lack of &amp;quot;ns&amp;quot;)&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/* Needed to get NRF_PWMn defined. */&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;amp;pwm1 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;pwm2 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;pwm3 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;uart0 {&lt;/code&gt;&lt;br /&gt;&lt;code&gt; current-speed = &amp;lt;115200&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; status = &amp;quot;okay&amp;quot;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; tx-pin = &amp;lt;1&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rx-pin = &amp;lt;0&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; rts-pin = &amp;lt;0xFFFFFFFF&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; cts-pin = &amp;lt;0xFFFFFFFF&amp;gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The PWM stuff was already there.&lt;/p&gt;
&lt;p&gt;Adding these lines in ncs V1.3.1 allowed me to run the at_client or the serial_lte_modem application on my custom board. I could issue AT commands over UART0 from my external mcu, and see the responses. I would see the bootup messages over UART0 when I reset the chip.&lt;br /&gt;&lt;br /&gt;I use Segger Embedded Studio. When I &amp;quot;Open NRF SDK project...&amp;quot; I select nrf9160dk_nrf9160ns as the Board Name.&lt;br /&gt;&lt;br /&gt;Also, I just tried this method on the ncs/v1.5.0/nrf/samples/nrf9160/at_client and it did not work. &lt;br /&gt;&lt;br /&gt;It works on the ncs v1.3.1 and does not work on ncs v1.5.0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make LOG_INF and LOG_ERR print over UART0 in nrf9160?</title><link>https://devzone.nordicsemi.com/thread/302613?ContentTypeID=1</link><pubDate>Tue, 30 Mar 2021 14:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a6dd109-84c1-48cc-9a1a-663039fec908</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;you can check a couple of things in the zephyr.dts file, which is located in the ../build/zephyr folder of your application.&lt;/p&gt;
&lt;p&gt;1. The UART0 device should have the same properties as specified in the overlay file (see example below, which is from an application build without overlay for target nrf9160dk_nrf9160).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uart0: uart@8000 {
				compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
				reg = &amp;lt; 0x8000 0x1000 &amp;gt;;
				interrupts = &amp;lt; 0x8 0x1 &amp;gt;;
				status = &amp;quot;okay&amp;quot;;
				label = &amp;quot;UART_0&amp;quot;;
				current-speed = &amp;lt; 0x1c200 &amp;gt;;
				tx-pin = &amp;lt; 0x1d &amp;gt;;
				rx-pin = &amp;lt; 0x1c &amp;gt;;
				rts-pin = &amp;lt; 0x1b &amp;gt;;
				cts-pin = &amp;lt; 0x1a &amp;gt;;
			};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. UART0 must be assigned to &lt;span style="color:rgba(51, 102, 255, 1);font-size:small;"&gt;&lt;span style="font-family:&amp;#39;Droid Sans Mono&amp;#39;, monospace, monospace, &amp;#39;Droid Sans Fallback&amp;#39;;"&gt;&lt;span&gt;zephyr,console&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;in the /chosen node.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;chosen {
		zephyr,flash-controller = &amp;amp;flash_controller;
		zephyr,entropy = &amp;amp;cryptocell_sw;
		zephyr,console = &amp;amp;uart0;
		zephyr,shell-uart = &amp;amp;uart0;
		zephyr,uart-mcumgr = &amp;amp;uart0;
		zephyr,flash = &amp;amp;flash0;
		zephyr,sram = &amp;amp;sram0_ns;
		zephyr,code-partition = &amp;amp;slot0_ns_partition;
	};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you have any more questions!&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>