<?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>nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91083/nrf52-uart-lock-up-in-ncs-connect</link><description>We are seeing an issue where we are connecting to an LTE/GPS chip via interrupt UART. Things work great until have an irregular amount of time, communication to the LTE chip is no longer possible. If we remove power from the LTE chip and then power it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Aug 2022 09:27:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91083/nrf52-uart-lock-up-in-ncs-connect" /><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/383630?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2022 09:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35695cfc-d9e1-4895-84db-79f4c70be6e9</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Have you tried uart_irq_rx_disable/uart_irq_rx_enable?&lt;/p&gt;
&lt;p&gt;You could also look into the&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/pm/device.html"&gt;Power Management module&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Though I still believe the best way to handle this would be to figure out what is actually going wrong&amp;nbsp;so you can avoid ending up in this crashed state at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/383541?ContentTypeID=1</link><pubDate>Sat, 27 Aug 2022 02:12:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a9b3c98-644c-4766-a1dd-fb4358fe6867</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;Using NCS. Is there a way to restart/re-init the UART? Right now when this happens, rebooting the nRF52 is the only option that fixes it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/383333?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 14:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:768d9089-42c6-458a-89e4-6610f6034fc3</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;I see, then logging is already enabled, strange that you&amp;#39;re not getting any warnings.&lt;/p&gt;
&lt;p&gt;Have you done any debugging to figure out exactly where in your code something goes wrong?&lt;/p&gt;
&lt;p&gt;Also, it looks like you&amp;#39;re using the&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/peripherals/uart.html"&gt;Zephyr UART API&lt;/a&gt;, have you considered using the&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/uarte/driver.html"&gt;nrfx UARTE driver&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/383130?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 16:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f197b5fc-ad45-4ef2-b8e9-7f02c79daca3</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;Currently set to&amp;nbsp;LOG_LEVEL_DBG which isn&amp;#39;t outputting anything. What level would we need to get more indepth info? We also wouldn&amp;#39;t want to show this level of detail until the issue occurs. Is there a way to restart/re-init the UART on the nRF52?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/382311?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 14:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6549ed3-b091-4071-9d7c-a82b0d0fbc5a</guid><dc:creator>Einarh</dc:creator><description>[quote user="NautDesigner"]Nothing to log. Just send data and nothing returns.[/quote]
&lt;p&gt;What do you mean? If something goes wrong there is likely something getting logged:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/382309?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 14:05:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4de9c559-07f4-44fd-bba8-45ca32ea50b2</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;Interrupt driven UARTE. Nothing to log. Just send data and nothing returns.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void uart_irq_handler(const struct device *dev)
{
int read = 0;

	uart_irq_update(dev);

	if (uart_irq_rx_ready(dev)) {
      struct rx_uart_data_t *buf = k_malloc(sizeof(struct rx_uart_data_t));
		read = uart_fifo_read(dev, buf-&amp;gt;data, RX_BUF_SIZE);

	   k_fifo_put(&amp;amp;rx_fifo, buf);

	}

	if (uart_irq_tx_ready(dev)) {
		struct tx_uart_data_t *buf = k_fifo_get(&amp;amp;tx_fifo, K_NO_WAIT);
      if (!buf) {
         uart_irq_tx_disable(dev);
         return;
      }

	   uart_fifo_fill(dev, buf-&amp;gt;data, buf-&amp;gt;len);

      while (!uart_irq_tx_complete(dev)) {
			/* Wait for the last byte to get
			 * shifted out of the module
			 */
		}
      if (k_fifo_is_empty(&amp;amp;tx_fifo)) 
		   uart_irq_tx_disable(dev);
      k_free(buf);

	}
}

static void interrupt_driven(const struct device *dev)
{
	uart_irq_callback_set(dev, uart_irq_handler);
	uart_irq_rx_enable(dev);
}

void initUart() {
   uart = device_get_binding(&amp;quot;UART_1&amp;quot;);
    //uart = device_get_binding(&amp;quot;LPUART&amp;quot;);
	__ASSERT(uart, &amp;quot;Failed to get UART device&amp;quot;);
	interrupt_driven(uart);
}

void enableUART() {
   pm_device_action_run(uart, PM_DEVICE_ACTION_RESUME);
}

void disableUART() {
   if (!device_is_ready(uart)) {
		return;
	}

   pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/382302?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 13:54:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88449fc2-74f6-49dd-8a04-f1109be839ad</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Sounds like it would be a good idea to activate more logging to investigate what goes wrong.&lt;/p&gt;
&lt;p&gt;It would be easier to debug this if you had a specific error message to work with.&lt;/p&gt;
&lt;p&gt;Also, what UART driver/API are you using?&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/382280?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 12:45:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0ed9061-442a-4344-99f3-24596be8cda2</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;Ongoing communication with the modem is fine for 30 minutes to several hours of constant communication. And it is just repeating the same sequence over and over.&lt;/p&gt;
&lt;p&gt;Based on the lights, we thought it may have been received TX commands, but that may not be the case. It could just be that we are turning if off, turning it back on again to try and get the UART to sync up again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/382168?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 08:17:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51b002ff-63a1-4ab9-bc5e-2577e809d8f1</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hello!&lt;/p&gt;
[quote user=""]Things work great until have an irregular amount of time[/quote]
&lt;p&gt;Can you please expand on what you mean by this?&lt;/p&gt;
[quote user="NautDesigner"]From what I can see, it is RX that is the problem, not TX[/quote]
&lt;p&gt;Can you also explain how you came to this conclusion?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 UART Lock Up in NCS Connect</title><link>https://devzone.nordicsemi.com/thread/382112?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 22:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b810ca3c-edc2-40e0-9dcb-31f5781f6afa</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;From what I can see, it is RX that is the problem, not TX.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>