<?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>nRF52840 nrfx_uart TX working, RX not</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43138/nrf52840-nrfx_uart-tx-working-rx-not</link><description>For nRF52840 (Rigado BMD-340), SDK 15.0.0, custom board: 
 I&amp;#39;m trying to implement nrfx_uart directly to communicate to another microcontroller. I&amp;#39;ve configured it for blocking mode. In this mode, I&amp;#39;ve been able to transmit (115200 8N1) a message from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 31 Jan 2019 07:54:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43138/nrf52840-nrfx_uart-tx-working-rx-not" /><item><title>RE: nRF52840 nrfx_uart TX working, RX not</title><link>https://devzone.nordicsemi.com/thread/168789?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 07:54:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3660950c-1500-4fa8-b190-bd3107ffd30f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Great job&amp;nbsp;on finding the source of the issue! Things like these are hard to debug, so kudos on finding the source this fast. Have a nice day, and contact us again if there&amp;#39;s any more issues/questions &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;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 nrfx_uart TX working, RX not</title><link>https://devzone.nordicsemi.com/thread/168768?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 19:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df5f6cdd-ab79-4605-8a4d-b83014c1fac2</guid><dc:creator>nrarmen</dc:creator><description>&lt;p&gt;Confirmed: The problem was calling nrfx_uart_rx_enable during an init routine while the other microcontroller was asleep (and thus RX line low). This cause ERRORSRC to read 0x0C (and eventually 0x0D) before I tried nrfx_uart_rx.&lt;/p&gt;
&lt;p&gt;The solution was to call nrfx_uart_rx_enable immediately before nrfx_uart_rx (in blocking mode) and then for good measure, call nrfx_uart_rx_disable immediate after&amp;nbsp;nrfx_uart_rx returned.&lt;/p&gt;
&lt;p&gt;Thanks for the help,&amp;nbsp;&lt;span&gt;H&amp;aring;kon!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 nrfx_uart TX working, RX not</title><link>https://devzone.nordicsemi.com/thread/168766?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 18:04:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53f86415-407f-4764-9795-3e91194a4881</guid><dc:creator>nrarmen</dc:creator><description>&lt;p&gt;TX is P0.06 and RX is P0.08&lt;/p&gt;
&lt;p&gt;Regarding ERRORSRC: The error happens on the first UART transmission / reception and that&amp;#39;s when I see all 3 flags noted above are set. I don&amp;#39;t read this register in code. I was just reading it through the debugger after I hit the breakpoint when the function fails.&lt;/p&gt;
&lt;p&gt;The nrfx_uart_rx function returns &lt;span&gt;NRFX_ERROR_INTERNAL.&amp;nbsp;The contents of the buffer passed to nrfx_uart_rx is garbage, though I&amp;#39;m not sure if that&amp;#39;s from heap allocation (malloc&amp;#39;d to 16 bytes, never freed) or nrfx_uart_rx putting bytes there.&lt;/span&gt;&amp;nbsp;I&amp;#39;m requesting 10 bytes of data to be read&amp;nbsp;(nBytes = 10), which is the&amp;nbsp;entire length of the response I&amp;#39;m expecting.&lt;/p&gt;
&lt;p&gt;The function returns at nrfx_uart.c line 442 (line 27 below). Here&amp;#39;s the snippet for your convenience:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bool rxrdy;
bool rxto;
bool error;
do
{
    do
    {
        error = nrf_uart_event_check(p_instance-&amp;gt;p_reg, NRF_UART_EVENT_ERROR);
        rxrdy = nrf_uart_event_check(p_instance-&amp;gt;p_reg, NRF_UART_EVENT_RXDRDY);
        rxto  = nrf_uart_event_check(p_instance-&amp;gt;p_reg, NRF_UART_EVENT_RXTO);
    } while ((!rxrdy) &amp;amp;&amp;amp; (!rxto) &amp;amp;&amp;amp; (!error));

    if (error || rxto)
    {
        break;
    }
    rx_byte(p_instance-&amp;gt;p_reg, p_cb);
} while (p_cb-&amp;gt;rx_buffer_length &amp;gt; p_cb-&amp;gt;rx_counter);

p_cb-&amp;gt;rx_buffer_length = 0;
if (error)
{
    err_code = NRFX_ERROR_INTERNAL;
    NRFX_LOG_WARNING(&amp;quot;Function: %s, error code: %s.&amp;quot;,
                     __func__,
                     NRFX_LOG_ERROR_STRING_GET(err_code));
    return err_code;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Update 1: ERRORSRC is set to 12 when rx_enable is called. This is probably expected because RX pin is not high at this time because the other microcontroller is asleep. I will move this call after the other microcontroller is awake.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 nrfx_uart TX working, RX not</title><link>https://devzone.nordicsemi.com/thread/168749?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 15:04:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccb3f919-2247-4da7-a1bc-2d2303d50ed8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which GPIOs are you using for TXD and RXD?&lt;/p&gt;
[quote user=""]Reading address 0x40002480 (UART0 ERRORSRC, right?) gives a value of 0x0D, i.e. BREAK, ERROR, and OVERRUN are all present.[/quote]
&lt;p&gt;&amp;nbsp;This register accumulates errors, so if you do not clear it, it might show errors from an earlier session.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Remember to clear this register after reading.&lt;/p&gt;
&lt;p&gt;What does the nrfx_uart_rx() function return?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Do you have any ideas about what else I can try to get nrfx_uart_rx to work?[/quote]
&lt;p&gt;What do you pass as nBytes into ::read()? Have you tried setting this to poll one-and-one byte to see if that makes any difference?&lt;/p&gt;
&lt;p&gt;Have you debugged the solution to see where it returns in the function?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>