<?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 interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87442/uart-interrupt</link><description>Hi nice people, I am working on developing using visual studio and Make environment. I am trying to function UART tx/rx interrupt works but no luck. The TX and RX works perfect in blocking mode but it is not on interrupt mode. I am going to provide snippets</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 May 2022 12:55:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87442/uart-interrupt" /><item><title>RE: UART interrupt</title><link>https://devzone.nordicsemi.com/thread/365995?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 12:55:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84d6b578-a7f3-4e1a-b396-00319c463b0c</guid><dc:creator>Edvin</dc:creator><description>[quote user="Hossam "]again:&lt;br /&gt;err_code = nrfx_uarte_init();&lt;br /&gt;or&lt;br /&gt;err_code = nrfx_uart_init();[/quote]
&lt;p&gt;Well, your previous reply didn&amp;#39;t say that. Not important. Thank you for clarifying.&lt;/p&gt;
[quote user="Hossam "]i didnt use them for testing because when i have tried to compile uart examples, i got error in some libraries like putchar function ..etc.&lt;br /&gt;and i am not going to waste my time to solve compiling error for examples should run without any issue&amp;nbsp;[/quote]
&lt;p&gt;They should compile without errors. If they do not, it may mean that you have changed files in the SDK, and in that case it is impossible to know what your calls to nrfx_uarte_init() or nrfx_uart_init() functions do, so this could actually indicate that the SDK that you are currently using is not working properly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Perhaps you can try to download an unzip a new unmodified version of the SDK, and see if:&lt;/p&gt;
&lt;p&gt;1: The examples compile without issues.&lt;/p&gt;
&lt;p&gt;2: your example works if you copy paste it into that SDK.&lt;/p&gt;
&lt;p&gt;You can download the SDKs from &lt;a href="https://www.nordicsemi.com/Products/Development-software/nRF5-SDK/Download?lang=en#infotabs"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART interrupt</title><link>https://devzone.nordicsemi.com/thread/365910?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 08:58:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:465c9049-023c-4042-a8cf-733771ec770f</guid><dc:creator>Hossam </dc:creator><description>&lt;p&gt;Edvin, it seems u didnt read my replay to your questions well.&lt;br /&gt;&lt;br /&gt;again:&lt;br /&gt;err_code = nrfx_uarte_init();&lt;br /&gt;or&lt;br /&gt;err_code = nrfx_uart_init();&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span&gt;err_code becomes nrf_success&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;for SDK examples i got followed the logic of this examples but i didnt use them for testing.&lt;br /&gt;&lt;br /&gt;i didnt use them for testing because when i have tried to compile uart examples, i got error in some libraries like putchar function ..etc.&lt;br /&gt;and i am not going to waste my time to solve compiling error for examples should run without any issue&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART interrupt</title><link>https://devzone.nordicsemi.com/thread/365902?ContentTypeID=1</link><pubDate>Tue, 03 May 2022 08:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29465982-1f1f-4773-b165-bfffbb201898</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I think you misunderstood my question.&lt;/p&gt;
&lt;p&gt;what does nrfx_uart_init() return means that if you create a variable, uint32_t err_code; and set it equal to the return value of nrfx_uart_init()/nrfx_uarte_init(), what is the value of err_code after that?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t err_code;

err_code = nrfx_uarte_init();
NRF_LOG_INFO(&amp;quot;err_code = %d&amp;quot;, err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, what was the result (err_code) after nrfx_uarte_init()?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And did you test the unmodified ble_app_uart example? Are you telling me that that doesn&amp;#39;t work either? If so, what hardware are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART interrupt</title><link>https://devzone.nordicsemi.com/thread/365820?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 14:26:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b306f028-008d-43ff-b746-69f1c578c7bc</guid><dc:creator>Hossam </dc:creator><description>&lt;p&gt;I wrote above that i got the same results after changing the APIs from UART to UARTE&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART interrupt</title><link>https://devzone.nordicsemi.com/thread/365793?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 13:07:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c17a7d39-3cfb-435b-b7dc-06be2ac606dd</guid><dc:creator>Edvin</dc:creator><description>[quote user="Hossam "]i did and the same result&amp;nbsp;[/quote]
&lt;p&gt;What was the result?&lt;/p&gt;
[quote user="Hossam "]i followed that example&amp;nbsp;[/quote]
&lt;p&gt;Not exactly, because the ble_app_uart uses nrfx_uarte_init(), and not nrfx_uart_init().&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Did you test the unmodified ble_app_uart example?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART interrupt</title><link>https://devzone.nordicsemi.com/thread/365764?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 12:22:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6d76983-4133-4e48-9b21-16bb077c95dc</guid><dc:creator>Hossam </dc:creator><description>&lt;p&gt;thank you for replay edvin&lt;br /&gt;&lt;br /&gt;it returs nrf_succes&amp;nbsp;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87442/uart-interrupt/365741#365741"]what does nrfx_uart_init() return?[/quote]
&lt;p&gt;i did and the same result&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87442/uart-interrupt/365741#365741"]If you want to use the non-blocking uart, I also suggest that you test the nrfx_uarte_init, instead of nrfx_uart_init()[/quote]
&lt;p&gt;i followed that example&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87442/uart-interrupt/365741#365741"]You can follow the definitions:[/quote]
&lt;p&gt;&lt;br /&gt;let me add more:&lt;br /&gt;-&amp;nbsp; the code works perfect in blocking mode.&lt;br /&gt;- when transmitting, the first time it sends successfully but after that becomes busy all the time and not issuing a complete flag to trigger the interrupt&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART interrupt</title><link>https://devzone.nordicsemi.com/thread/365741?ContentTypeID=1</link><pubDate>Mon, 02 May 2022 11:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50ea4864-4dbe-45fd-a95d-c01324e4743c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;For future correspondance, please use the &amp;quot;Inser&amp;quot;-&amp;gt;&amp;quot;Code&amp;quot; when you intend to paste large code snippets, as it makes it easier to read.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In general, if you haven&amp;#39;t tested, I can recommend the UART implementation from the SDK\examples\ble_peripheral\ble_app_uart example.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you want to use the nrfx_uart_init() directly, what does nrfx_uart_init() return?&lt;/p&gt;
&lt;p&gt;If you want to use the non-blocking uart, I also suggest that you test the nrfx_uarte_init, instead of nrfx_uart_init(). Again, look at the implementation from the ble_app_uart example. You can follow the definitions:&lt;/p&gt;
&lt;p&gt;uart_init() (from main.c) -&amp;gt;&lt;/p&gt;
&lt;p&gt;APP_UART_FIFO_INIT() -&amp;gt;&lt;/p&gt;
&lt;p&gt;app_uart_init() -&amp;gt;&lt;/p&gt;
&lt;p&gt;nrf_drv_uart_init() -&amp;gt;&lt;/p&gt;
&lt;p&gt;nrfx_uarte_init()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>