This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF53/nRFConnect: correct way to define UART with no RTS/CTS pins in an overlay file

I am using an NRF53 DK board with nRFConnect/Zephyr 1.3.0.  I need to define the UART pins I will use in a .overlay file but I would like to NOT define any flow control pins, just tx-pin and rx-pin, like so:

&uart1 {
  status = "okay";
  current-speed = <115200>;
  tx-pin = <42>;
  rx-pin = <43>;
};

However this doesn't work properly: when I call device_get_binding("UART_1") it returns NULL.  If I include a couple of randomly chose flow control pins:

&uart1 {
  status = "okay";
  current-speed = <115200>;
  tx-pin = <42>;
  rx-pin = <43>;
  rts-pin = <44>;
  cts-pin = <45>;
};

...then it works every time, no problem, but I don't want to do that, I want to just ignore flow control pins, there are none, there is no flow control in my case.

What is the correct way to do that?  I've tried using <-1> but that throws a parsing error inside Zephyr.

Thanks in advance for your help; the generated device_unfixed.h is attached in case it helps, the relevant part says:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Node parent (/soc/peripheral@50000000) identifier: */
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_PARENT DT_N_S_soc_S_peripheral_50000000
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_FOREACH_CHILD(fn)
/* Existence and alternate IDs: */
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_EXISTS 1
#define DT_N_ALIAS_uart_1 DT_N_S_soc_S_peripheral_50000000_S_uart_9000
#define DT_N_INST_1_nordic_nrf_uarte DT_N_S_soc_S_peripheral_50000000_S_uart_9000
#define DT_N_NODELABEL_uart1 DT_N_S_soc_S_peripheral_50000000_S_uart_9000
/* Special property macros: */
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_REG_NUM 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_REG_IDX_0_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_REG_IDX_0_VAL_ADDRESS 1342214144 /* 0x50009000 */
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_REG_IDX_0_VAL_SIZE 4096 /* 0x1000 */
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_IRQ_NUM 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_IRQ_IDX_0_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_IRQ_IDX_0_VAL_irq 9
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_IRQ_IDX_0_VAL_irq_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_IRQ_IDX_0_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_IRQ_IDX_0_VAL_priority 1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Rob