uart_line_ctrl_set Function not implemented

Hi,

I'm using the bare hci_uart example and try to rise the RTS line manually. Therefore I use the API

int err = uart_line_ctrl_set(hci_uart_dev, UART_LINE_CTRL_RTS, 1);
and added 
CONFIG_UART_LINE_CTRL=y
in proj.conf. The resulting error code is ENOSYS (88), "Function not implemented". Am I missing some more config values? 
Regards,
Oliver
Parents
  • Hi Oliver,

    I am looking into this. Some more information can be helpful to find out the cause of the error. Which version of nRF Connect SDK are you using, and which SoC and/or board are you using.

    Kind Regards,
    Maria

  • Hi Maria,

    I'm using nRF Connect SDK 2.1.2 on a nRF52840DK. The software is basing on hci_uart. In main.c in function hci_uart_init I added uart_line_ctrl_set like following:

    static int hci_uart_init(const struct device *unused) {
      LOG_DBG("hci_uart_init");
    
      if (!device_is_ready(hci_uart_dev)) {
        LOG_ERR("HCI UART %s is not ready", hci_uart_dev->name);
        return -EINVAL;
      }
    
      uart_irq_rx_disable(hci_uart_dev);
      uart_irq_tx_disable(hci_uart_dev);
    
      uart_irq_callback_set(hci_uart_dev, bt_uart_isr);
    
      uart_irq_rx_enable(hci_uart_dev);
    
      // Signaling
      int err = uart_line_ctrl_set(hci_uart_dev, UART_LINE_CTRL_RTS, 1);
      LOG_DBG("uart_line_ctrl_set result %i", err);
    
      return 0;
    }
    

    CTS is generally working in the context of the application but I want CTS to be set right after reset until the software is completely initialized.

    Thanks and greetz!
    Oliver

Reply
  • Hi Maria,

    I'm using nRF Connect SDK 2.1.2 on a nRF52840DK. The software is basing on hci_uart. In main.c in function hci_uart_init I added uart_line_ctrl_set like following:

    static int hci_uart_init(const struct device *unused) {
      LOG_DBG("hci_uart_init");
    
      if (!device_is_ready(hci_uart_dev)) {
        LOG_ERR("HCI UART %s is not ready", hci_uart_dev->name);
        return -EINVAL;
      }
    
      uart_irq_rx_disable(hci_uart_dev);
      uart_irq_tx_disable(hci_uart_dev);
    
      uart_irq_callback_set(hci_uart_dev, bt_uart_isr);
    
      uart_irq_rx_enable(hci_uart_dev);
    
      // Signaling
      int err = uart_line_ctrl_set(hci_uart_dev, UART_LINE_CTRL_RTS, 1);
      LOG_DBG("uart_line_ctrl_set result %i", err);
    
      return 0;
    }
    

    CTS is generally working in the context of the application but I want CTS to be set right after reset until the software is completely initialized.

    Thanks and greetz!
    Oliver

Children
Related