I'm trying to use 9-bit UART communications with the nrf52840 using nRF Connect SDK v1.9.1, but I'm getting an error -134 when I call uart_configure().
When I use UART_CFG_DATA_BITS_8, uart_configure() and following UART polling work great, but UART_CFG_DATA_BITS_9 gives me a -134 error.
Here's my code:
//#define SAS_UART_DATA_BITS_8
#define SAS_BAUD_RATE 115200
#define SAS_PARITY UART_CFG_PARITY_NONE
#define SAS_STOP_BITS UART_CFG_STOP_BITS_1
#ifdef SAS_UART_DATA_BITS_8
#define SAS_DATA_BITS UART_CFG_DATA_BITS_8
#else
#define SAS_DATA_BITS UART_CFG_DATA_BITS_9
#endif
#define SAS_FLOW_CTRL UART_CFG_FLOW_CTRL_NONE
struct uart_config cfg;
cfg.baudrate = SAS_BAUD_RATE;
cfg.parity = SAS_PARITY;
cfg.stop_bits = SAS_STOP_BITS;
cfg.data_bits = SAS_DATA_BITS;
cfg.flow_ctrl = SAS_FLOW_CTRL;
ctrl_uart = device_get_binding(DT_LABEL(DT_NODELABEL(uart1)));
err = uart_configure(ctrl_uart, &cfg);
I've also tried adding CONFIG_UART_WIDE_DATA=y to prj.conf based on another forum post, but it didn't help.
Is there something else I need to do to use 9-bit UART data?
Thanks!