Is it possible to configure the Zephyr UART parameters like the hardware flow control dynamically at run time? We do that in an nRF52840 firmware with the nrfx libraries - but have so far failed in doing the same with Zephyr. We would like to build a firmware that (on our custom board) can run the UART line between two MCUs (the setup is similar to Thingy91: nRF52840 - UART - nRF9160) either with or without hardware flow control. SDK v1.2.0 is used.
With Zephyr the PIN configurations are typically set in devicetree .dts files and flow control settings in .prj file at compile time. These fix the flow control setting at compile time.
Zephyr has an optional customization CONFIG_UART_LINE_CTR but it seems this is not implemented in the nRF9160 driver.
Setting up two UART confs in our custom device tree definition did not help. I tried setting up two uart settings UART_0 (without flow control) and UART_1 (with RTS/CTS). Managed to run this but if the UART_1 is enabled at compiled in, the UART_0 TX does not seem to work (the other end does not receive anything, not affected by the flow control pin state). This happens even when the device_get_binding() has been called only for UART_0 (not for UART_1). UART_0 works if UART_1 is disabled in the compilation time, with no other changes. The UART_0 and UART_1 settings use the same RX and TX pins.
Is there any other way to make this setting dynamic? Not a major problem for us, we can make separate firmwares for the use cases if this is not possible.
We are trying to evaluate the UART power consumption 1) without flow control (+~700uA), 2) with standard UART HW flow control and 3) with own custom flow control implementation. There are many posts around the topic of UART power consumption, but none of those actually documented if the HW flow control lowers the UART power consumption. Is the UART HW flow control not used in the DK/Thingy91 examples? Also, there seemed to be an experimental Zephyr configuration CONFIG_UART_ASYNC_API available - but did not manage to find any information about the power consumption impact of enabling that. Is there such consumption measurement available?
Pertti