It has been asked before but I couldn'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:
warning: UART_CONSOLE (defined at drivers/console/Kconfig:43) was assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies: SERIAL (=n), SERIAL_HAS_DRIVER (=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UART_CONSOLE and/or look up UART_CONSOLE in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
It does work however, and the powerconsumption is reduced. I'm on SDK v2.3.0.
I also tried to just disable serial in the device tree, but it's called somewhere in the project (probably <zephyr/logging/log.h>, so the build crashes unless I do the above.)
&pinctrl { uart0_default: uart0_default { status="disabled"; }; };
I also tried disabling using setting the powerstate at runtime, but I cannot figure the arguments I've to put in the function, as the signature has changed over time and I'm unable to find a current example. The latest I could find is of Zephyr 1.4.
int pm_device_state_set(conststructdevice*dev, uint32_t device_power_state,pm_device_cbcb,void*arg)
Question why is this warning and what is the right way to disable serial (or reduce power).
Edit: I guess it should be
err = pm_device_action_run(device, PM_DEVICE_ACTION_SUSPEND);
during runtime.