<?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 DK - UART Stops</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43127/nrf52840-dk---uart-stops</link><description>Hi All, 
 I&amp;#39;ve got an nRF 52840 PDK and I&amp;#39;m connecting a GPS module ( Adafruit Ultimate GPS Logger Shield ) to it to read the data using nrf_serial.h library. I get about 5-10 messages from the GPS module before the feed stops. Using oscilloscope, I can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 May 2019 06:19:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43127/nrf52840-dk---uart-stops" /><item><title>RE: nRF52840 DK - UART Stops</title><link>https://devzone.nordicsemi.com/thread/185327?ContentTypeID=1</link><pubDate>Mon, 06 May 2019 06:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe76e5eb-3fa3-4a87-be9f-4cc886549412</guid><dc:creator>AbdulSamad</dc:creator><description>&lt;p&gt;Hello Edven,&lt;/p&gt;
&lt;p&gt;It appears that I had a bit of an issue using the I2C functions when I was trying to read values from the sensor. It was a little difficult. Using the following functions helped in reading from and writing to the sensor.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;char readBytes(char address, unsigned char *values, char length)
// Read an array of bytes from device
// values: external array to hold data. Put starting register in values[0].
// length: number of bytes to read
{
#if DEBUG_ENABLED
  NRF_LOG_INFO(&amp;quot;Start readBytes&amp;quot;);
  for (int i = 0; i &amp;lt; length; ++i)
    NRF_LOG_INFO(&amp;quot;data[%d]: %02x&amp;quot;, i, values[i]);
  NRF_LOG_FLUSH();
#endif
  ret_code_t _error = nrf_drv_twi_tx(&amp;amp;m_twi, address, values, 1, true);
  APP_ERROR_CHECK(_error);
#if DEBUG_ENABLED
  NRF_LOG_INFO(&amp;quot;Waiting for transfer completion.&amp;quot;);
  NRF_LOG_FLUSH();
#endif
  while (m_tx_done == false)
    ;
  m_tx_done = false;
  //#if DEBUG_ENABLED
  //  for (int i = 0; i &amp;lt; length; ++i)
  //    NRF_LOG_INFO(&amp;quot;data[%d]: %02x&amp;quot;, i, values[i]);
  //#endif
  if (_error == 0) {
    ret_code_t _error = nrf_drv_twi_rx(&amp;amp;m_twi, address, values, length);
    APP_ERROR_CHECK(_error);
    while (m_rx_done == false)
      ;
#if DEBUG_ENABLED
    NRF_LOG_INFO(&amp;quot;Rx readBytes&amp;quot;);
    for (int i = 0; i &amp;lt; length; ++i)
      NRF_LOG_INFO(&amp;quot;data[%d]: %02x&amp;quot;, i, values[i]);
    NRF_LOG_INFO(&amp;quot;End readBytes\r\n&amp;quot;);
    NRF_LOG_FLUSH();
#endif
    m_rx_done = false;

    return 1;
  } else
    return 0;
}

char writeBytes(char address, unsigned char *values, char length) {
  ret_code_t _error = nrf_drv_twi_tx(&amp;amp;m_twi, address, values, length, false);
  APP_ERROR_CHECK(_error);
  while (m_tx_done == false)
    ;
  m_tx_done = false;
  return 1;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As you can see, I&amp;#39;m using NRF_LOG_INFO() macros to speed up the debug (instead of UART).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I re-visited this part about 2 weeks ago and I couldn&amp;#39;t remember the old issues I posted about &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; Thanks for the troubleshooting hints and also offering to reproduce the issue UART! Cheers&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 DK - UART Stops</title><link>https://devzone.nordicsemi.com/thread/170230?ContentTypeID=1</link><pubDate>Sun, 10 Feb 2019 04:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0638c216-9695-4172-87f6-94e991f68bc2</guid><dc:creator>AbdulSamad</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Pardon the late reply! I&amp;#39;ve been caught up in a few other projects and looks like I&amp;#39;ll have to come back to this in a while. Thank you for the debugging suggestions. I&amp;#39;ll go through them one by one and post an update later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 DK - UART Stops</title><link>https://devzone.nordicsemi.com/thread/168850?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 11:27:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56b4f3d8-9cb3-4d29-9e0b-3a54f89ebd99</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;How long does your application run before it stops responding?&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t see anything obviously wrong with your setup. Can you test a couple of things?&lt;/p&gt;
&lt;p&gt;Does it work, or work longer if you only use one of the UARTS?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does the behavior change if you use the sleep_handler?&lt;/p&gt;
&lt;p&gt;When it stops receiving, is the application still running through your main loop? Or does it stop somewhere?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there any way for me to reproduce this issue? Is it possible to zip the project that you use and send it so that I can test it on a DK? If so, can you give some instructions on how to reproduce? Note that I don&amp;#39;t have the GPS, but maybe I can simulate one by sending messages through an UART terminal to the DK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 DK - UART Stops</title><link>https://devzone.nordicsemi.com/thread/168782?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 06:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13c45b69-3c23-470d-95cb-3a95a7c7e9b5</guid><dc:creator>AbdulSamad</dc:creator><description>&lt;p&gt;Brief update on the progress:&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried a few things to see what&amp;#39;s going on.&lt;/p&gt;
&lt;p&gt;1. As I&amp;#39;m using two UARTs, I decided to change the VCP pins (UART0) to different pins on the board eg P0.30 and P0.31. No luck there. So, I reverted to original settings and use VCP as normal.&lt;/p&gt;
&lt;p&gt;2. Temporarily, as I&amp;#39;m not using Rx pin on the GPS module, I decided to utilize it to send messages and use an FTDI chip to read the data from P0.31. It works for longer but it stops after 5-6 mins. Although the ret_code from nrf_serial_read is printed out on VCP, it&amp;#39;s always showing up as 0x00 which indicates NRF_SUCCESS even after the output at P0.31 stops; I&amp;#39;m a bit dubious about how reliable this test can be given that VCP output stops even in the default serial example.&lt;/p&gt;
&lt;p&gt;So, at this point, the questions that I have in mind are:&lt;/p&gt;
&lt;p&gt;a. Is this problem due to the interface MCU as mentioned in some other posts? Is there any workaround for it? Is there any way to isolate the interface MCU after&amp;nbsp;downloading the code?&lt;/p&gt;
&lt;p&gt;b. Is there&amp;nbsp;anything special needed for UART initialization?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>