<?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>UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78414/uarte-configuration-with-nrf9160-and-zephyr</link><description>Hi, 
 we have developed our working UART code according to Zephyr documentation, and its working fine, 
 we find that this code works with EasyDMA . but my question is my uart2_fifo_callback function is calling for every byte, why its happening like this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Nov 2021 14:31:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78414/uarte-configuration-with-nrf9160-and-zephyr" /><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/340930?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 14:31:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecc52314-5d85-4437-af72-760e8213a061</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Rajender&lt;/p&gt;
&lt;p&gt;Do you make sure to wait until string1 is transmitted before sending string2?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Either you have to do this, or you have to store string2 in a buffer while waiting for string1 to complete, and then you can read it from the buffer and send it in the TX callback.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you look at the example I shared earlier in this case I do something like this, by putting all the TX data in a ring buffer, so that you can prepare more TX data while the UART is busy:&lt;br /&gt;&lt;a href="https://github.com/too1/ncs-uart-async-count-rx/blob/master/src/main.c#L111"&gt;https://github.com/too1/ncs-uart-async-count-rx/blob/master/src/main.c#L111&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/340816?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 03:31:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:825ac66d-0f8f-472d-8488-dcb44787e498</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I got one more issue in the UARTE execution,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;the issue is when we are sending the data string one by one its works fine, but when we send a string1 and then we send string2 before completely collecting&amp;nbsp; string1 in callback function then issue starts, from now on the callback function is getting the new length which is length of string2 and the data pointer points to middle of the string1, finally we are collecting combination of string1 and string2 so entire data format is collapsing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please help us,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Rajender&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/325324?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 13:33:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b4d86ee-97cf-428e-a15d-a08f42d595a2</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Rajender&lt;/p&gt;
&lt;p&gt;Thanks for the update, interesting to see that the flow control setting was the culprit. Good to know for the future &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I will close this case then.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/325209?ContentTypeID=1</link><pubDate>Tue, 17 Aug 2021 03:37:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39619e80-69fa-44ee-bf20-a3b75b9247a0</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes, the problem is in board files only, but these board files used to work fine without any extra hardware in INTERRUPT_DRIVEN_MODE&lt;/p&gt;
&lt;p&gt;finally now my TX and Rx both are working, after little bit modification in board files-&amp;gt;uart config&lt;/p&gt;
&lt;p&gt;i have changed my board files like this...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart2 {
	compatible = &amp;quot;nordic,nrf-uarte&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;115200&amp;gt;;
	tx-pin = &amp;lt;11&amp;gt;;
	rx-pin = &amp;lt;10&amp;gt;;
	rts-pin = &amp;lt;12&amp;gt;;
	cts-pin = &amp;lt;7&amp;gt;;
	/*hw-flow-control;*/
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now my UARTE configuration is like this, and its working fine&lt;/p&gt;
&lt;p&gt;Prior to this The &amp;quot;hw-flow-control&amp;quot; was not in comment so then only RX used to work when i comment &amp;quot;hw-flow-control&amp;quot; now its working with both RX and TX.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Rajender&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/325084?ContentTypeID=1</link><pubDate>Mon, 16 Aug 2021 11:26:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b54d3c64-b922-40ee-b717-63af3f47569d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Rajender&lt;/p&gt;
&lt;p&gt;Have you tested the code on an nRF9160DK to see if the problem is the same?&lt;/p&gt;
&lt;p&gt;Are you able to share the board files for your board with me, and also a schematic of the board if you have one?&lt;/p&gt;
&lt;p&gt;If you want I can make the case private, in case you don&amp;#39;t want to share your files in a public case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324765?ContentTypeID=1</link><pubDate>Fri, 13 Aug 2021 07:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c7e4d24-9feb-4553-9fe1-aa218c311077</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;we are using a custom board based on nrf9160,&lt;/p&gt;
&lt;p&gt;I found my .dts file in my zephyr/boards/arm/&amp;quot;board name&amp;quot;, i figured out my default pinout and baud rate and all for my UART_2,&lt;/p&gt;
&lt;p&gt;that&amp;#39;s why my rx interrupt is working properly and i can read the data properly&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;but my present problem is (TX) i am not able to send any data from my controller, but i can receive properly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have added This api to transmit&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int rett = uart_tx(dev_uart,read_ptr,read_len,1000);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and when i deep dive in further,&amp;nbsp; i found that in below function its going into &amp;quot;else &amp;quot; statement only which is error message:&amp;nbsp;Unknown ARM architecture.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static ALWAYS_INLINE unsigned int arch_irq_lock(void)
{
	unsigned int key;

#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
	__asm__ volatile(&amp;quot;mrs %0, PRIMASK;&amp;quot;
		&amp;quot;cpsid i&amp;quot;
		: &amp;quot;=r&amp;quot; (key)
		:
		: &amp;quot;memory&amp;quot;);
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
	unsigned int tmp;

	__asm__ volatile(
		&amp;quot;mov %1, %2;&amp;quot;
		&amp;quot;mrs %0, BASEPRI;&amp;quot;
		&amp;quot;msr BASEPRI, %1;&amp;quot;
		&amp;quot;isb;&amp;quot;
		: &amp;quot;=r&amp;quot;(key), &amp;quot;=r&amp;quot;(tmp)
		: &amp;quot;i&amp;quot;(_EXC_IRQ_DEFAULT_PRIO)
		: &amp;quot;memory&amp;quot;);
#elif defined(CONFIG_ARMV7_R)
	__asm__ volatile(
		&amp;quot;mrs %0, cpsr;&amp;quot;
		&amp;quot;and %0, #&amp;quot; TOSTR(I_BIT) &amp;quot;;&amp;quot;
		&amp;quot;cpsid i;&amp;quot;
		: &amp;quot;=r&amp;quot; (key)
		:
		: &amp;quot;memory&amp;quot;, &amp;quot;cc&amp;quot;);
#else
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */

	return key;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please help me&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Rajender&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324753?ContentTypeID=1</link><pubDate>Fri, 13 Aug 2021 06:54:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4531ace1-5d99-47b3-8b92-1c17731f6d63</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Rajender&lt;/p&gt;
&lt;p&gt;In order to configure pins and baudrate it is best to create an overlay file, which overwrites the default configuration for the UART_2 peripheral from dts.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This case describes how to create the overlay file for the UART peripheral on the nRF9160:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/65473/uart-gpio-configuration"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/65473/uart-gpio-configuration&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can you try this and see if you can spot any activity on the pins?&lt;/p&gt;
&lt;p&gt;If you are still having issues can you share the overlay file with me, and I will try to reproduce it on my end.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324594?ContentTypeID=1</link><pubDate>Thu, 12 Aug 2021 07:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4aa56fb-8334-4731-903e-e96665f94e32</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;after spending some time on this i got to know that&lt;/p&gt;
&lt;p&gt;when i transmit data using&amp;nbsp;uart_tx() this will return 0, (means-successful) but again it will trigger timeout function(static void tx_timeout()) then,&amp;nbsp;UART_TX_ABORTED event, and then&amp;nbsp;UART_TX_DONE event.&lt;br /&gt;but anyway data will not sends to the UART Terminal.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please help me to solve this.&lt;/p&gt;
&lt;p&gt;NOTE: I am attaching my project for your reference please check.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/UART_5F00_TEST.zip"&gt;devzone.nordicsemi.com/.../UART_5F00_TEST.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Rajender.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324575?ContentTypeID=1</link><pubDate>Thu, 12 Aug 2021 05:02:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f62afc6a-6b71-4542-b54d-c1343b9f9754</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Finally i have tested your project and its working fine, triggering interrupts according to the data buffer size and timeout delay,&lt;/p&gt;
&lt;p&gt;but it working only one direction, means if i send any data to uart port through my terminal software its receiving and i can see the data also, but when i add uart tx function then also its not sending data to uart port from my microcontroller, i have tried both uart_tx() or&amp;nbsp;z_impl_uart_tx() but no use&lt;br /&gt;NOTE: i did not enabled console also, Im using uart_2 for my uart communication&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please help me to understand&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Rajender&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324380?ContentTypeID=1</link><pubDate>Wed, 11 Aug 2021 07:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bf059d7-2b1f-404b-8876-217d2a46e790</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;Hi Torbjorn,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have created your project in my segger embedded studio, but i con not find any configuration in&amp;nbsp;uart_init() or anywhere else,&amp;nbsp; Where i can configure my UARTE properties(like baud rate, etc.,)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when i try to build and upload in to my nRF9160 board, its building and uploading fine, but now i can not see the output, i have tried all the baud rates given in my terminal software still no use.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;NOTE: i have changed some code and configs, Please check below--&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
#define UART_BUF_SIZE		10//16
#define UART_RX_TIMEOUT_MS	500//100&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;dev_uart = device_get_binding(&amp;quot;UART_2&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1628667636968v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please help to understand&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Rajender&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324360?ContentTypeID=1</link><pubDate>Wed, 11 Aug 2021 06:44:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9558fbe-1a6f-4251-b63b-15212b8b2687</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I solved this project creating issue,&lt;/p&gt;
&lt;p&gt;i will update on the UARTE soon&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Rajender&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324353?ContentTypeID=1</link><pubDate>Wed, 11 Aug 2021 06:00:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2d5a03b-171b-4f33-bea8-29d91a357d70</guid><dc:creator>Rajender</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank for your response,&lt;/p&gt;
&lt;p&gt;But when i try to open this project in the Segger Embedded Studio, its not opening, For your reference i am attaching a screenshot of the same.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/prjct-create-fail.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;you can check my environment options by referring next pic--&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/nrf_5F00_connect_2D00_options.JPG" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please help to solve this issue, so that i can verify my UARTE&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Rajender.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE configuration with nrf9160 and zephyr</title><link>https://devzone.nordicsemi.com/thread/324296?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 14:19:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb1d6f07-e2e2-4181-afb2-c58ed98caaf3</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Rajener&lt;/p&gt;
&lt;p&gt;I think it would be better to use the ASYNC version in this case. Then you can define a timeout, and rather than get a callback for each byte you will get a callback either if the RX buffer is full, or if the timeout is reached and there is no new data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I made a simple example to show how to use the UART ASYNC driver a while back:&lt;br /&gt;&lt;a href="https://github.com/too1/ncs-uart-async-count-rx/blob/master/src/main.c"&gt;https://github.com/too1/ncs-uart-async-count-rx/blob/master/src/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>