Cannot configure UART0 at runtime anymore

I'm working on a Proteus-III module which needs to communicate with the on board UART0. For reasons that I still don't understand, the `uart_configure` function with which I was configuring the communication parameters stopped working and started returning `-ENOTSUP` (-134).

I've tried changing SDK version (both 2.6.0 and 2.7.0) with no luck. The same configuration does not work even for zephyr's default uart example. Here is the relevant code:

const struct uart_config uart_cfg = { .baudrate = 9600, .parity = UART_CFG_PARITY_NONE, .stop_bits = UART_CFG_STOP_BITS_1, .data_bits = UART_CFG_DATA_BITS_8, .flow_ctrl = UART_CFG_FLOW_CTRL_NONE, };

int err = uart_configure(uart_dev, &uart_cfg);

After this initialization the baudrate remains at the default 115200 instead of the required 9600. Changing it in an overlay device tree works and it's the solution I'm currently going with.

Why does `uart_configure` returns `-ENOTSUP`? What could have possibly changed?

Parents
  • I am assuming that you are using nrfx_uart driver which is located at zephyr\drivers\serial\uart_nrfx_uart.c.

    Can't you just put a breakpoint at the start of this function, start the debugger and see exactly what path it takes before it returns ENOTSUP?

    It looks like you are sending some arguments that it does not support. Why the behavior changed without you changing the SDK or the driver is not clear to me.

Reply
  • I am assuming that you are using nrfx_uart driver which is located at zephyr\drivers\serial\uart_nrfx_uart.c.

    Can't you just put a breakpoint at the start of this function, start the debugger and see exactly what path it takes before it returns ENOTSUP?

    It looks like you are sending some arguments that it does not support. Why the behavior changed without you changing the SDK or the driver is not clear to me.

Children
No Data
Related