<?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>No RX on UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9573/no-rx-on-uart</link><description>Hi, 
 I&amp;#39;m using 51822 to control GSM module via UART (57600, no flow control).
My device is USB and battery powered.
After I program the chip I HAVE to disconnect all the power in order to start system clean and have it working.
If I don&amp;#39;t completely</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Oct 2015 07:45:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9573/no-rx-on-uart" /><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35371?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2015 07:45:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e87cf2a1-89c9-4540-bd0b-6a85f1da5315</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Good that you figured out the problem .. good luck.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35370?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 21:21:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b70c29e8-64a3-4172-810e-2aa298fb37b4</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;Thanks for being so patient with me. Your previous answer actually does solve the problem, there was a bug in how I handled timer for timing out the readout from UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35368?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 09:35:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25b9d9c0-3e48-40e0-b7e9-52b770eb4b68</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Yes sorry, it was EVENTS_RXDRDY , dont remember the format from top of my head sometimes.
I fixed my previous comment.&lt;/p&gt;
&lt;p&gt;What is the size of the command that GSM is sending? should be definitely more than 6 bytes.
Can you change the baudrate on both sides to very low say 4800 and see if that helps.
If that does not help, then i need the line sniff data/image or some code to look into.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35367?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 09:09:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56aa4098-8c4e-4cf1-9889-7b60b2bee245</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;Doesnt help, still getting error 1&lt;/p&gt;
&lt;p&gt;I assume NRF_UART-&amp;gt;RXDRDY is NRF_UART0-&amp;gt;EVENTS_RXDRDY&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35372?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 08:50:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83ef4662-144b-4704-bcde-475e5ab0825f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;pre&gt;&lt;code&gt;uint32_t error;
       if(NRF_UART-&amp;gt;EVENTS_ERROR !=0)
       {
            NRF_UART-&amp;gt;EVENTS_ERROR = 0;
            error = NRF_UART-&amp;gt;ERRORSRC;
            NRF_UART-&amp;gt;ERRORSRC = error;

// flush the RX FIFO by reading and ignoring them

 

   while (NRF_UART-&amp;gt;EVENTS_RXDRDY != 0) 
    { 
        error = NRF_UART-&amp;gt;RXD; 
        NRF_UART-&amp;gt;EVENTS_RXDRDY = 0;
        //Give a moment for more data in FIFO to move into RXD register
        nrf_delay_ms(1);
    }
   }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35369?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 08:32:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc210f62-da10-49f0-89dd-5ab10aa522b7</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;I do understand why I get initial error 13 - its because when GSM reboots it pulls RX line low. But then after that I clear the error and UART should just work, but it doesnt for some reason. I keep getting error 1 (overrun) and I cant recover from it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35366?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 20:07:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98b7d720-301a-4889-8199-f498108ba8e6</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;Its indeed basic, so probably im doing something really wrong.
The sequence that you described is correct. Currently i just have the lines connected to UART-USB interface on the PC, so I just see that nrf sends commands and GSM replies. I can make a picture on oscilloscope as well if that helps.&lt;/p&gt;
&lt;p&gt;Please find photos attached. Measured at the same time from &lt;a href="https://www.dropbox.com/s/3xle0xgry4blafk/GSM_terminal.jpg?dl=0"&gt;UART USB&lt;/a&gt; on PC and on &lt;a href="https://www.dropbox.com/s/dzpotgydlb7cd3h/GSM_oscilloscope.jpg?dl=0"&gt;oscilloscope&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35365?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 19:04:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bd65795-f004-4eb3-9e49-ab15cd331fb9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I would like to see the TX and RX on a logic analyzer or some other line sniffer. Without softdevice what you are trying to do is quite basic and it should have worked.&lt;/p&gt;
&lt;p&gt;You said that every 3 seconds the timer expires and if no reply from GSM is received, then nrf sends the command again. Can you please confirm that
nrf sends command -&amp;gt; GSM module replies -&amp;gt; nrf does not get reply and times out -&amp;gt;nrf sends command again -&amp;gt; GSM replies.&lt;/p&gt;
&lt;p&gt;If you can confirm this (how are you sniffing the TX and RX lines? can you put an image of it here?) then we know that atleast GSM module is not doing anything wrong and sending data with correct baudrate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35364?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 11:35:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69908636-91f8-48bd-8906-22c307a93720</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;Yes thats what I tried to do. The thing is that Im actually trying to actively read UART (using the simple UART method) and I have a timer to prevent hanging. So the timeout is set to 3 seconds, if i dont receive anything in 3 seconds I send a command again to GSM and try to read.&lt;/p&gt;
&lt;p&gt;So you are saying i have to read the RX data, but there is nothing coming out of RX, basically I get stuck on this line:&lt;/p&gt;
&lt;p&gt;while (NRF_UART0-&amp;gt;EVENTS_RXDRDY != 1 &amp;amp;&amp;amp; !gsmTimeout){};&lt;/p&gt;
&lt;p&gt;I also make sure that GSM module is up and doesnt send anything at all before I clear UART, so it seems like UART cant recover from that problem and I dont understand why.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35363?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 10:59:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07ddf273-10b2-42de-a878-2d2ea40bb782</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You can enable the interrupt when this error event occurs, and in the interrupt handler which is triggered by any error, you can recover the uart by&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t error;
   if(NRF_UART-&amp;gt;EVENTS_ERROR !=0)
   {
        NRF_UART-&amp;gt;EVENTS_ERROR = 0;
        error = NRF_UART-&amp;gt;ERRORSRC;
        NRF_UART-&amp;gt;ERRORSRC = error;
   }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will clear the error and uart is usable again. But if you have not read the RXD byte before GSM sends next character, then overrun error will occur agan.
The above proposed way is brute force and does not handle specific errors uniquely, but is better than restarting the chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35362?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 09:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16113bb7-4491-405c-a8dd-1459c32d2b92</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;Is there anything on nrf side that I could do to fix that? Can I reset UART somehow to recover from this? If I connect the output to a terminal on PC I dont see any extra data being sent, so i cant say that GSM does something wrong.&lt;/p&gt;
&lt;p&gt;GSM might send a corrupted character when it reboots, but then afterwards it doesnt send anything unless it gets a request from nrf. But nrf seems unable to recover from erroneous state.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35361?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 08:34:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85443f02-daed-47c7-bd04-39511c83a9ed</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;if you received 1101&amp;#39;b This means that you have got&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;overrun error. Which means that your RXD FIFO was full and yet there was new character received. Means your application is not reading bytes fast enough from uart. This happens if you transmit bytes from GSM larger than UART RX fifo size (6 bytes) and have not read anything from your nRF51 side.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Framing error. Your GSM module and nRF chip got out of sync as no valid stop bit was detected.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;break condition detected.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;error 2) and 3) occurred as the RX line was low for more than it should. you should check why your GSM module is sending such data!!&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35360?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 08:16:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c63f153c-d46f-4f8c-81eb-4d5b06fb4411</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;Actually I just checked and I get 13 in ERRORSRC. How do I deal with it?
It doesnt happen if after programming I completely power off the system and then turn it on again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35359?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 08:00:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8710fb3e-074b-4166-a711-0092714ef8cb</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hmm, have you checked if the nRF chip has generated any error like framing error or so?
If you are not using softdevice, then this is the only explanation i can think of that there are some errors while receiving the data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35358?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 07:50:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66bb9810-eedc-4017-bc3d-5338117c862f</guid><dc:creator>Sergy</dc:creator><description>&lt;p&gt;Im not using SoftDevice as I wrote before, so no BLE communications and there is no other interrupts happening before the first UART communication completes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No RX on UART</title><link>https://devzone.nordicsemi.com/thread/35357?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 05:29:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a035aea-5fb4-4276-961c-3e5eb13a0f96</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;UART needs HFCLK, not the Low frequency clock. Look at the image below from nRF51 Product Specification V3.1&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6813.Capture.PNG" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;There is not enough information for us to narrow down the problem.
Is your nRF device having any BLE activity along with UART traffic? If so then without flowcontrol it is bound to miss packets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>