uart_configure() error -134 using UART_CFG_PARITY

I'm trying to use parity 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_PARITY_NONE or UART_CFG_PARITY_EVEN uart_configure() and following UART polling work great, but any other parity mode (odd, mark, space) gives me a -134 error.

Here's my code:

#define SAS_BAUD_RATE 115200
#define SAS_PARITY UART_CFG_PARITY_MARK
#define SAS_STOP_BITS UART_CFG_STOP_BITS_1
#define SAS_DATA_BITS UART_CFG_DATA_BITS_8
#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);

Is there something else I need to do to use UART with parity?

Or is UART with parity not supported for the zephyr driver? Is there a workaround to use parity UART?

Thanks!

Note: edited to add working status of UART_CFG_PARITY_EVEN

Parents Reply Children
No Data
Related