<?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>UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109616/uart-not-powering-down-zephyr</link><description>Hi, 
 
 I am using nRF Connect SDK V2.3.0. How can I power down the UART? 
 
 I am using the Interrupt-driven UART API, interrupt driven on RX and polling on TX. I have disabled the console on the dtb and prj.conf. I am using both UARTs in my application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Apr 2024 07:29:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109616/uart-not-powering-down-zephyr" /><item><title>RE: UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/thread/479604?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 07:29:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eee4628-02ef-4337-a559-62aacf71b7d0</guid><dc:creator>Edvin</dc:creator><description>[quote user="JulianWilmot"]This causes a framing error (or other error) on the UART and then the UART does not want to power down.[/quote]
&lt;p&gt;What does this look like&amp;nbsp; in your application? Do you see it in the logs or something?&lt;/p&gt;
&lt;p&gt;I see that&amp;nbsp;pm_device_action_run() runs a few checks, and returns an error if it is not able to run properly. Do you see the return value of pmm_device_action_run not being 0? Can you try to step through this function to see how it behaves in your case?&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: UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/thread/479562?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2024 23:03:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:031d0624-9977-419a-8a9f-2c3a72ebf186</guid><dc:creator>JulianWilmot</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much for testing my application. That is excellent news.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have a theory of what is going on here. Like mentoined before I have a RS232 converter attached to UART0 that I power up. I think what is happening is because I cannot control when the UART gets initialised the RS232 converter gets powered up after the UART is initialised. This causes a framing error (or other error) on the UART and then the UART does not want to power down. By reading from the UART I suspect in the driver somewhere (in Zephyr) it clears the error flags.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So my question is how can I clear the error flags directly with Zephyr (without reading or waiting to receive data from the UART)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will test if it works if you can just tell me how to clear the errors. Thanks in advance. I believe we are close to solving this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Julian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/thread/479235?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2024 13:14:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28a4556e-6e54-4b93-8988-4b7eabcef6c7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Julian,&lt;/p&gt;
&lt;p&gt;I tested your application on a DK (slightly modified to have the buttons required to compile:&lt;/p&gt;
&lt;p&gt;#error &amp;quot;Unsupported board: gpspwren devicetree alias is not defined&amp;quot;&lt;/p&gt;
&lt;p&gt;And running the application using the PPK 2, I see this:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1713359350282v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;(I added a couple of more delay with some logging, so the timing may be different from what you are seeing)&lt;/p&gt;
&lt;p&gt;However, as you can see, when the grey marked area has a current consumption of 3.32µA, so I don&amp;#39;t think I am seeing what you are seeing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Did you test your application on an nRF52840DK? Do you see the same issue there? If you do see the same issue, can you please zip that modified application and upload that as well?&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><item><title>RE: UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/thread/479082?ContentTypeID=1</link><pubDate>Wed, 17 Apr 2024 02:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:140c84ac-bd8b-49d7-81bb-ee174fa136e8</guid><dc:creator>JulianWilmot</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope you are doing well. Certainly, I uploaded a project that reproduces what I am seeing (it is not my actual project source, but just a mockup to test with).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I did make some progress on this and got some new findings. Just a little bit of context for you. I use two uarts in my application UART0 (RS232 modem) and UART1 (RS485 device). When I have a modem simulator plugged into the RS232 port (UART0) and write an AT command to the modem and the modem responds and I then put both uarts into power down mode then it works as expected. It draws about 100uA. But when I just open a regular serial terminal (which does not respond back) then the device does not power down properly and the current draw is close to 1mA. When on the same setup I reply quickly back once I transmit the AT command over the serial terminal then the current draw is low again. So it seems I have to receive data first on UART0 before I can power down properly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any ideas&amp;nbsp;why I have to receive data first before sleeping, and why only on UART0 and not UART1? Also if I do not send/receive data and just put both UARTs into power down mode after the UART&amp;#39;s are ready then it does not work either.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Julian&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/echo_5F00_example.zip"&gt;devzone.nordicsemi.com/.../echo_5F00_example.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/thread/478956?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2024 11:37:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf07dea4-7b66-4bb5-97c3-84fd8c46974a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Julian,&lt;/p&gt;
[quote user="JulianWilmot"]Sorry for my terribly slow response[/quote]
&lt;p&gt;No worries &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;&lt;/p&gt;
&lt;p&gt;Is it possible to upload the application that you are currently using (or at least something that reproduces what you are seeing) so that I can have a look and poke around?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]I know it is the UART and not something else on my board, because as soon I issue the forbidden register writes, the power consumption drops down to micro amps again[/quote]
&lt;p&gt;I agree that this suggests that there is something related to the UART.&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><item><title>RE: UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/thread/478922?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2024 10:09:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dc7c508-787c-4512-8c52-f581b3013fef</guid><dc:creator>JulianWilmot</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the feedback. Sorry for my terribly slow response. I did confirm the uart pins are all NRF_P0-&amp;gt;PIN_CNF[xx]: 0x00000002 (for uart0 and uart1). So unfortunately it is not that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;Julian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART not powering down Zephyr</title><link>https://devzone.nordicsemi.com/thread/475979?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 14:52:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49820d2a-0c00-4c37-a381-2720387c6ec6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Julian,&lt;/p&gt;
&lt;p&gt;Perhaps you can check out the sample found in ncs\nrf\samples\peripheral\lpuart&lt;/p&gt;
&lt;p&gt;The documentation for this sample is found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/peripheral/lpuart/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/peripheral/lpuart/README.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What I don&amp;#39;t understand is that the UART is drawing power even after you power it off. Perhaps you have several uart instances running? Or perhaps the reason are gpios that are left on. Try reverting these to the standard &amp;quot;disconnected input&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=5_0_0_5_8_1_9#register.PIN_CNF-0-31"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/gpio.html?cp=5_0_0_5_8_1_9#register.PIN_CNF-0-31&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;with the value 0x00000002&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>