<?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>Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1027/problem-using-uart-and-radio-in-esb-mode-on-nrf24le01</link><description>Hi 
 for few days I seem to got stack in using together UART and radio on nRF21LE01 in ESB mode
and I suspect irq_flags = hal_nrf_get_clear_irq_flags(); to be cause of my problem. 
 What I want to achieve is to communicate to terminal via UART messages</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Mar 2017 07:12:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1027/problem-using-uart-and-radio-in-esb-mode-on-nrf24le01" /><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4862?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 07:12:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7f528a0-9e3d-48c4-9311-8041ff07f85b</guid><dc:creator>mr_creosote</dc:creator><description>&lt;p&gt;here&amp;#39;s some example code i&amp;#39;m using.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//-------- UART begin
IP0 = 0x10;	// make uart higher priority than RF.
IP1 = 0x10;	// make uart higher priority than RF.
P0DIR = (P0DIR &amp;amp; ~0x08) | 0x10; // bxxx1-0xxx
hal_uart_init(UART_BAUD_38K4); 
while(hal_clk_get_16m_source() != HAL_CLK_XOSC16M);
...
...
...
//-------- do some UART stuff now. turn off RF IRQ
RF = 0; // disable RF IRQ
printf(&amp;quot;print one thing here.&amp;quot;);
printf(&amp;quot;print another thing here.&amp;quot;);
RF = 1; // enable RF IRQ
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4860?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2014 10:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95ca81b1-64fc-4ef3-ad20-33e413e5961f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Adam,&lt;/p&gt;
&lt;p&gt;Happy new year to you!&lt;/p&gt;
&lt;p&gt;Your understanding is correct.
The IP0/IP1 have a reset value of 0, meaning all interrupts have the same priority. This is as intended, as it is up to you which interrupts you use and how to use them.&lt;/p&gt;
&lt;p&gt;The IPx register is located at a 16 bit address, but the value inside the registers are 8 bit. You can use &amp;quot;sbit&amp;quot;, similar to what is done with the GPIOs (P00 for instance), but this register is mapped directly without sbit.
Setting the register can be done like this:
IPx |= (1 &amp;lt;&amp;lt; BIT_x); // set bit
IPx &amp;amp;= ~(1 &amp;lt;&amp;lt; BIT_x); // Clear bit&lt;/p&gt;
&lt;p&gt;BR
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4859?ContentTypeID=1</link><pubDate>Wed, 25 Dec 2013 07:53:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f4e5d94-78bd-4c88-a520-c57d660754f7</guid><dc:creator>Adam Czezowski</dc:creator><description>&lt;p&gt;Aha one more thing. IP0 and IP1 addresses are not located on 8-bit boundary hence sbits can not be used in Keil C51. This is very strange as in the manual they clearly have bit-per-bit settings. Omission on 8051 implementer or just annoyance?&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Adam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4858?ContentTypeID=1</link><pubDate>Wed, 25 Dec 2013 07:34:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a27c8e4a-0c85-4f9f-b14e-643e855bda1f</guid><dc:creator>Adam Czezowski</dc:creator><description>&lt;p&gt;Hi Håkon,&lt;/p&gt;
&lt;p&gt;Merry Christmas! Thank you for explanation of what is going on in my ISR and of the dead-lock condition. Since then I am tinkering with IP0 and IP1 registers. When I read content of these two register upon power-up they all are 0. Does this mean that after power is supplied to nrf24LE1 the default priority of all priority groups is at its lowest level 0 that is that all interrupts are treated equally?&lt;/p&gt;
&lt;p&gt;Is this normal and desired? I am coming from java programming background and still consider myself as newbie embedded programmer.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Adam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4857?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2013 10:06:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73139bc7-a136-4e53-a5ae-e21638f037b4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Adam,&lt;/p&gt;
&lt;p&gt;The UART print routine will call on function &amp;quot;hal_uart_putchar&amp;quot;, which again relies on the UART0_ISR. The hal_uart library is a blocking library, meaning it uses while-loops that needs UART0_ISR function to handle.&lt;/p&gt;
&lt;p&gt;When you are triggering an interrupt from another interrupt with the same priority, this will give you a deadlock-situation.
This is the situation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;print function called from NRF-interrupt&lt;/li&gt;
&lt;li&gt;print function will trigger UART-interrupt&lt;/li&gt;
&lt;li&gt;print function will loop until UART-ISR is one&lt;/li&gt;
&lt;li&gt;Cannot enter UART-ISR, as you are currently processing NRF_ISR.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You have two ways of avoiding this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Call print-routines only from main-context&lt;/li&gt;
&lt;li&gt;Set a higher priority on UART interrupt (using IP0 and IP1 registers)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4856?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2013 22:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13c0fdc9-146d-49cf-833b-8f81d54b3aaf</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;Hi Håkon&lt;/p&gt;
&lt;p&gt;sure they (ISR) should be kept short but I don&amp;#39;t understand why my code dos not work in my case at all. I am sending packet of data only when I press a button on my RX side so in this case timing should not be a problem.&lt;/p&gt;
&lt;p&gt;Are you aware of any other restrictions while in ISR?&lt;/p&gt;
&lt;p&gt;Thanks you and
Cheers&lt;/p&gt;
&lt;p&gt;Adam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4861?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2013 22:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b5fa9bf-5a38-4fd1-82e3-72ff45304b6b</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;Hi Håkon&lt;/p&gt;
&lt;p&gt;sure they (ISR) should be kept short but I don&amp;#39;t understand why my code dos not work in my case at all. I am sending packet of data only when I press a button on my RX side so in this case timing should not be a problem.&lt;/p&gt;
&lt;p&gt;Are you aware of any other restrictions while in ISR?&lt;/p&gt;
&lt;p&gt;Thanks you and
Cheers&lt;/p&gt;
&lt;p&gt;Adam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem using UART and radio in ESB mode on nRF24LE01.</title><link>https://devzone.nordicsemi.com/thread/4855?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2013 13:53:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d900ebe-a32d-4981-a141-fe287f9a7eee</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Calling UART prints from interrupt context is not recommended.
Note that your UART baudrate is quite low (9k6), which then uses almost 1 ms to send one byte. When sending 10-20 bytes while in the NRF_ISR() routine, you will get a timing error if your PTX is sending at a high frequency.
You normally want to keep ISR routines as short as possible.&lt;/p&gt;
&lt;p&gt;Try using global flags and send UART prints in your main loop instead, and lower the frequency that you are pushing packets over the RF link (add a delay on the PTX side).&lt;/p&gt;
&lt;p&gt;-H&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>