<?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 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98397/nrf52840-zephyr-disable-uart0-warning</link><description>It has been asked before but I couldn&amp;#39;t find a satisfying answer so far. To reduce base power consumption of 600uA to roughly 3uA I disabled serial by setting CONFIG_SERIAL=n in prj.conf. But I get the following warning: 
 
 
 It does work however, and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Apr 2023 13:38:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98397/nrf52840-zephyr-disable-uart0-warning" /><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/420526?ContentTypeID=1</link><pubDate>Fri, 14 Apr 2023 13:38:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdf36946-eabf-4813-aed4-187eddb65692</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Here is a sample following your hello world explanation below, where I disable the console.&lt;/p&gt;
&lt;p&gt;Do you see the error for this?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/console_5F00_disabled.zip"&gt;devzone.nordicsemi.com/.../console_5F00_disabled.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/420521?ContentTypeID=1</link><pubDate>Fri, 14 Apr 2023 13:28:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5937f8c-5dab-450d-9639-f48c905274da</guid><dc:creator>boris bergman1</dc:creator><description>&lt;p&gt;No, that is not the solution:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CMake Warning at /home/bergm006/ncs/v2.3.0/zephyr/CMakeLists.txt:824 (message):
  No SOURCES given to Zephyr library: drivers__console

  Excluding target from build.
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/419536?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2023 07:18:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfb224d1-ee61-4e3d-905a-814725eea3a8</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_CONSOLE"&gt;CONFIG_CONSOLE&lt;/a&gt; is enabled by default, and it selects UART_CONSOLE, which depends on CONFIG_SERIAL.&lt;/p&gt;
&lt;p&gt;So to get rid of the warning, set:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_UART_CONSOLE=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_CONSOLE=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;By the way, if you are doing power optimization, maybe &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/optimizing/power.html#power-optimization"&gt;this page&lt;/a&gt; can be helpful later.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/419400?ContentTypeID=1</link><pubDate>Thu, 06 Apr 2023 16:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d618cbb0-f29c-4399-99ac-54c9ae55a9bf</guid><dc:creator>boris bergman1</dc:creator><description>&lt;p&gt;To make things simpler the hello world project has the same issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;

void main(void)
{
	while(1) {
		k_sleep(K_MSEC(1000));
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart0 {
    status = &amp;quot;disabled&amp;quot;;
};
&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;proj.conf empty (and when I add CONFIG_SERIAL=n the same warning appears)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/419204?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 09:47:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a002972a-ff22-403e-a570-edca7c6bc3ec</guid><dc:creator>boris bergman1</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=2048


CONFIG_BT=y

CONFIG_BT_SMP=y
CONFIG_BT_SIGNING=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_ATT_PREPARE_COUNT=5
CONFIG_BT_PRIVACY=y
CONFIG_BT_DEVICE_NAME=&amp;quot;xxx&amp;quot;
CONFIG_BT_DEVICE_APPEARANCE=3137
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_NAME_MAX=65


CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_I2C=y
CONFIG_EVENTS=y
CONFIG_SERIAL=n
CONFIG_LOG=n
CONFIG_PM=y
CONFIG_PM_DEVICE=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(The error only occures when CONFIG_SERIAL=y, when &amp;#39;=n, the warning of the first post appears.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/419141?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 05:55:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49b2a045-1223-4554-b791-1b0b0e6737ce</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you post your prj.conf as well?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/419087?ContentTypeID=1</link><pubDate>Tue, 04 Apr 2023 15:42:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4be54b52-d043-489b-aff8-e97cc138837b</guid><dc:creator>boris bergman1</dc:creator><description>&lt;p&gt;Nope, disabling like that in the devicetree does not work, &lt;pre class="ui-code" data-mode="text"&gt;/home/bergm006/ncs/v2.3.0/zephyr/include/zephyr/device.h:83:41: error: &amp;#39;__device_dts_ord_114&amp;#39; undeclared here (not in a function); did you mean &amp;#39;__device_dts_ord_11&amp;#39;?
   83 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I did not include device.h in my project.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/types.h&amp;gt;
#include &amp;lt;zephyr/pm/pm.h&amp;gt;
#include &amp;lt;zephyr/pm/device.h&amp;gt;
#include &amp;lt;stddef.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;errno.h&amp;gt;
#include &amp;lt;zephyr/sys/byteorder.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/settings/settings.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/bluetooth.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/hci.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/conn.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/uuid.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/gatt.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 zephyr disable uart0 warning</title><link>https://devzone.nordicsemi.com/thread/418950?ContentTypeID=1</link><pubDate>Tue, 04 Apr 2023 07:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d23f9b32-5ad3-4e4e-90ab-c782d6346c88</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user=""]CONFIG_SERIAL=n in prj.conf. But I get the following warning:[/quote]
&lt;p&gt;Use the &amp;quot;Kconfig&amp;quot; search in VS Code to determine what sets this to &amp;quot;y&amp;quot;.&lt;br /&gt;Just looks like you set UART_CONSOLE in you project config somewhere, and it is automatically set to &amp;quot;n&amp;quot; when you disable SERIAL, which makes sense to me.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user=""]I also tried to just disable serial in the device tree[/quote]
&lt;p&gt;You try to disable uart0 inside pinctrl, and not inside the driver itself. Try:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;uart0 {
    status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then after you build, have a look at build/zephyr/zephyr.dts to verify that all the drivers have the expected status.&lt;/p&gt;
[quote user=""]Edit: I guess it should be[/quote]
&lt;p&gt;Both DeviceTree and Power Management are good ways to disable a peripheral to save power.&lt;/p&gt;
&lt;p&gt;Use the DeviceTree if you never intend to use that peripheral.&lt;br /&gt;Use the Power Management if you intend to use the peripheral sporadically.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>