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:

/* 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
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_IRQ_IDX_0_VAL_priority_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_COMPAT_MATCHES_nordic_nrf_uarte 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_STATUS_okay 1

/* Generic property macros: */
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_reg {36864 /* 0x9000 */, 4096 /* 0x1000 */}
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_reg_IDX_0 36864
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_reg_IDX_1 4096
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_reg_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_interrupts {9 /* 0x9 */, 1 /* 0x1 */}
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_interrupts_IDX_0 9
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_interrupts_IDX_1 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_interrupts_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_hw_flow_control 0
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_hw_flow_control_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_tx_pin 42
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_tx_pin_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_rx_pin 43
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_rx_pin_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_current_speed 115200
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_current_speed_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_label "UART_1"
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_label_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_status "okay"
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_status_ENUM_IDX 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_status_EXISTS 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_compatible {"nordic,nrf-uarte"}
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_compatible_IDX_0 "nordic,nrf-uarte"
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_compatible_LEN 1
#define DT_N_S_soc_S_peripheral_50000000_S_uart_9000_P_compatible_EXISTS 1

Rob

Parents Reply Children
Related