Hello CircuitDojo Community,

In a recent post I inquired about low power configurations for the nRF9160 and boards based on this SiP. Jared Wolff shared code which dynamically turns off a given UART of the SiP’s application processor. In his code there’s a call to a routine named uart_rx_disable(). I’d initially overlooked this. Today as I try to build my application I’m blocked on a link time error “undefined reference to `uart_rx_disable()'”.

Per Jared’s code excerpt I have added CONFIG_PM_DEVICE=y to my prj.conf. My project is based on Nordic’s aws_iot sample app. I am using the ncs SDK version 1.6.1. Nordic’s fork of Zephyr in this SDK is Zephyr release 2.6.0.

Where should uart_rx_disable() be defined? Am I using a too old version of ncs or Zephyr RTOS?

Searching in [west_workspace]/[my_app]/build I find references like:

./zephyr/include/generated/syscalls/uart.h:64:static inline int uart_rx_disable(const struct device * dev)

…but these are not the actual routine definitions. They’re Kconfig symbol bounded calls to an actual implementation that I cannot find:

 64 static inline int uart_rx_disable(const struct device * dev)
 65 {
 66 #ifdef CONFIG_USERSPACE
 67         if (z_syscall_trap()) {
 68                 return (int) arch_syscall_invoke1(*(uintptr_t *)&dev, K_SYSCALL_UART_RX_DISABLE);
 69         }   
 70 #endif
 71         compiler_barrier();
 72         return z_impl_uart_rx_disable(dev);
 73 }

Finally, is it even necessary to call uart_rx_disable() shortly before calling pm_device_state_set(uart_device, PM_DEVICE_STATE_OFF, NULL, NULL);?

  • Ted
Terms and Conditions | Privacy Policy