<?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>NRF 52840 UART RX fails to receive data from a modem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64966/nrf-52840-uart-rx-fails-to-receive-data-from-a-modem</link><description>Hello, I am currently working on a nr52840 s140 Sdk 17.0 (dev kit) and a m using the peripheral/uart example code. 
 The UART TX &amp;amp; RX works perfectly when connecting to a TTL to USB converter with my PC. However, when I try to connect nr52840 with an</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Aug 2020 13:53:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64966/nrf-52840-uart-rx-fails-to-receive-data-from-a-modem" /><item><title>RE: NRF 52840 UART RX fails to receive data from a modem</title><link>https://devzone.nordicsemi.com/thread/265582?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 13:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb69fcb5-d9f7-45d2-9e2f-16985c7bdaec</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Have you tried to analyze the UART lines using a logic analyzer? Please try this to verify that there is actually data going through both ways (TX and RX). Is there any data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 52840 UART RX fails to receive data from a modem</title><link>https://devzone.nordicsemi.com/thread/265434?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 01:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35edd920-23f3-4fbb-a384-d527b4b9f9f9</guid><dc:creator>potter1234</dc:creator><description>&lt;p&gt;Hi Edvin,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;Allow me to add more detail.&lt;/p&gt;
&lt;p&gt;Yes, I expect to get data from&amp;nbsp;&lt;span&gt;&amp;nbsp;APP_UART_DATA event and I did receive something when the modem boots up (Some string like &amp;quot;APP RDY&amp;quot;). So, if&amp;nbsp;&amp;nbsp;APP_UART_DATA event will not be triggered, why was I getting some response from the modem in the beginning?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also tried printing&amp;nbsp; every event in the event handler, but I still failed to receive either APP_UART_DATA_READY or APP_UART_DATA from the modem, except at the beginning.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF 52840 UART RX fails to receive data from a modem</title><link>https://devzone.nordicsemi.com/thread/265369?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2020 14:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48203d6e-7211-44e9-80a0-3978fe37e0c9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I suggest you look at the implementation in the ble_app_uart example, which sets up the UART with an uart event handler.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I noticed that you are using the APP_UART_DATA event. This is where you expect to get the data, right? According to app_uart.h line 104:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; APP_UART_DATA,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /**&amp;lt; An event indicating that UART data has been received, and data is present in data field. This event is only used when no FIFO is configured. */&lt;/p&gt;
&lt;p&gt;So this event will not trigger.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suggest that you try to look for the APP_UART_DATA_READY event, and look at how this event is handled in main.c in the ble_app_uart example.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just noticed that your event handler looks like this. It should work, but make sure that if you add to these checks, that the brackets are correct. It might be tidier to use &amp;quot;else if ( event == EVENT_C) &amp;quot;as well, or even better, a switch case, like in the ble_app_uart example.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (event == EVENT_A)
{
    handle_event_a();
}
else if (event == EVENT_B)
{
    handle_event_b();
}
else
{
    if (event == EVENT_C)
    {
        handle_event_c();
    }
}
&lt;/pre&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></channel></rss>