<?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>nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97918/nrf9160-dk-uarte-baremetal-rx-driver---unknown-byte-size</link><description>Hello, 
 I am trying to have a minimal bare metal based driver for nrf9160 UARTE with an unknown frame size. 
 I assume that ENDRX interrupt is triggered when RXD.MAXCNT bytes are received and RXRDY interrupt is triggered when every byte is received.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Mar 2023 08:05:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97918/nrf9160-dk-uarte-baremetal-rx-driver---unknown-byte-size" /><item><title>RE: nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/thread/418228?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 08:05:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a084be7c-dbe1-428a-9346-881827e823f4</guid><dc:creator>PawanNordic</dc:creator><description>&lt;p&gt;Thanks Hakon for the input,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try and get back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/thread/418224?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2023 07:45:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a74e3b57-e213-4c17-9328-5e907d417bc8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;You are setting up DMA after-the-fact, and this will be problematic.&lt;/p&gt;
&lt;p&gt;Setup your DMA RXD.PTR in the init routine.&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: nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/thread/418169?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2023 17:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45d55a1c-3573-4515-abab-bb0c223ab42d</guid><dc:creator>PawanNordic</dc:creator><description>&lt;p&gt;Hello Hakon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am trying to establish UARTE EVENTS_RXDRDY Interrupt handling on a minimal bare metal firmware and I observe that the ISR is hit only once. Maybe the mcu goes to some fault condition thereafter.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My simple code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void my_Usart2_init(void)
{
    /* GPIO init */
    nrf_gpio_cfg_default(1);
    nrf_gpio_pin_set(1);
    nrf_gpio_cfg_default(0);
    nrf_gpio_pin_set(0);

    NRF_UARTE2-&amp;gt;PSEL.TXD = 1;
    NRF_UARTE2-&amp;gt;PSEL.RXD = 0;
    NRF_UARTE2-&amp;gt;TASKS_STOPTX = 1;
    NRF_UARTE2-&amp;gt;TASKS_STOPRX = 1;    

    NRF_UARTE2-&amp;gt;BAUDRATE = (uint32_t)UARTE_BAUDRATE_BAUDRATE_Baud115200;

    /*Initialize DMA*/
    NRF_UARTE2-&amp;gt;INTENCLR = 0xffffffffUL;
    NRF_UARTE2-&amp;gt;INTENSET =
        (UARTE_INTEN_ENDTX_Enabled &amp;lt;&amp;lt; UARTE_INTEN_ENDTX_Pos) |
        (UARTE_INTEN_RXDRDY_Enabled &amp;lt;&amp;lt; UARTE_INTEN_RXDRDY_Pos) |
        (UARTE_INTEN_ERROR_Enabled &amp;lt;&amp;lt; UARTE_INTEN_ERROR_Pos);

    /* APP IRQ */
    Sys_clearFastAppIrq(UARTE2_SPIM1_SPIS1_TWIM1_TWIS1_IRQn);
    Sys_enableFastAppIrq(UARTE2_SPIM1_SPIS1_TWIM1_TWIS1_IRQn,
                         APP_LIB_SYSTEM_IRQ_PRIO_HI,
                         UARTE2_IRQHandler);
    NRF_UARTE2-&amp;gt;ENABLE = UARTE_ENABLE_ENABLE_Enabled;

}

volatile uint8_t datahere;
void __attribute__((__interrupt__)) UARTE2_IRQHandler(void)
{
    if(NRF_UARTE2.instance-&amp;gt;EVENTS_RXDRDY != 0)
    {   
        NRF_UARTE2.instance-&amp;gt;EVENTS_RXDRDY = 0;
        (NRF_UARTE2.instance-&amp;gt;RXD.PTR) = (uint32_t)&amp;amp;datahere;
        NRF_UARTE2.instance-&amp;gt;TASKS_STARTRX = 1;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I need some expert help or a register level simple example on UARTE Rx please.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Pawan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/thread/417172?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2023 15:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:702ba17d-7f88-4ac8-a725-9d72530d3eee</guid><dc:creator>PawanNordic</dc:creator><description>&lt;p&gt;Thanks Hakon, I will check it out..&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Pawan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/thread/416742?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2023 09:58:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b268ffe1-b763-47f7-b615-a0ed6d8ebb4a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Pawan,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="PawanNordic"]No, I&amp;#39;m just using the TXD RXD lines. I would like to have an interrupt when the RXD line goes idle after recieving an unknown number of bytes. Is this possible?[/quote]
&lt;p&gt;This isn&amp;#39;t a feature that the UARTE peripheral has. This must be added by you, if this is a requirement.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would recommend that you look into the uart asynchronous API from zephyr, where you can set a timeout on the RX operation.&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: nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/thread/416636?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 16:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86dafb28-977b-4246-96c1-1a6294e72370</guid><dc:creator>PawanNordic</dc:creator><description>&lt;p&gt;Hello Hakon,&lt;/p&gt;
&lt;p&gt;No, I&amp;#39;m just using the TXD RXD lines. I would like to have an interrupt when the RXD line goes idle after recieving an unknown number of bytes. Is this possible?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Pawan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 dk UARTE Baremetal Rx Driver - Unknown Byte Size</title><link>https://devzone.nordicsemi.com/thread/416536?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2023 12:42:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3e9acb1-c710-405f-97f4-0a5eb45faf5c</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;
[quote user=""]&lt;strong&gt;Is there an idle line detect mechanism in nrf9160&lt;/strong&gt;? I plan to have at least two UARTs in my project with Rx capability.[/quote]
&lt;p&gt;Are you thinking about flow control, using CTS/RTS in addition to RXD/TXD? If so, yes, the hardware supports this.&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></channel></rss>