Connectivity bridge on NRF52840 based custom board

Hi,

 Tried to use Connectivity bridge app on a custom board based on NRF52840 and it seems that the UART-USB interface works initially, but after a while it gets stuck at communication level. The goal is to use it in the same way USBD_CDC_ACM sample. Opening a console to that stuck PORT makes it work again for a while. The CDC_ACM / UART control lines are enabled and they should work normally, since, on the same board, the USBD_CDC_ACM sample does not have this problem.

 Configuration:

Fullscreen
1
2
3
# Features
CONFIG_BRIDGE_MSC_ENABLE=n
CONFIG_BRIDGE_BLE_ENABLE=n
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Overlay file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&uart1 {
compatible = "nordic,nrf-uarte";
status = "okay";
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
cdc_acm_uart1: cdc_acm_uart1 {
compatible = "zephyr,cdc-acm-uart";
};
rtt0: rtt_chan0 {
compatible = "segger,rtt-uart";
status = "okay";
};
};
/ {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I would like to know what is the cause of this behaviour.

Regards.

Parents Reply Children
  • Hi Kenneth,

     I've tried that example and it doesnt seem to work, I get this:

    Fullscreen
    1
    2
    3
    *** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-3e0ce7636fa6 ***
    <<o2c: UART error: 0xc>>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

     I've added support for CDC_ACM from the original description in this new example:

     custom_board.conf:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_UART_LINE_CTRL=y
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_PRODUCT="Zephyr USB console sample"
    CONFIG_USB_DEVICE_PID=0x0004
    CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    custom_board.overlay:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    / {
    chosen {
    zephyr,console = &cdc_acm_uart0;
    uart,passthrough = &uart0;
    };
    };
    &zephyr_udc0 {
    cdc_acm_uart0: cdc_acm_uart0 {
    compatible = "zephyr,cdc-acm-uart";
    };
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Best regards.

  • Looks like you experience both an break and framing error, ref:
    https://docs.nordicsemi.com/bundle/ps_nrf52840/page/uarte.html#ariaid-title31 

    Can you add a pull-up resistor on the UART RXD line? Or ensure otherwise it's always high when there is no serial data.

    Kenneth

  • Hi,

     I'm using a custom board and the RXD is connected between the MCU and the peripheral there is no pull-up resistor. The passthrough is suppose to be between the USB-port `cdc_acm_uart0` and UART0 peripheral. For context, the `USBD_CDC_ACM sample` works fine, only the `UART Passthrough` sample (and the `connectivity_bridge` sample) have this problem.

     Could be that until USB is initialized some floating pins can cause this issue? so maybe `CONFIG_BOOT_DELAY` could ensure that the USB stack is properly initialized? (although I think I tried this and it didnt help).

    Regards.

  • Hi,

    Floating RXD pin can cause such issue yes. If you don't have the possibility to add an external pull-up, you can use the internal one, something like this (look for 'bias-pull-up;' for the RXD pin):

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    &pinctrl {
    uart1_default: uart1_default {
    group1 {
    psels = <NRF_PSEL(UART_RX, 1, 1)>;
    bias-pull-up;
    };
    group2 {
    psels = <NRF_PSEL(UART_TX, 1, 2)>;
    };
    };
    uart1_sleep: uart1_sleep {
    group1 {
    psels = <NRF_PSEL(UART_RX, 1, 1)>,
    <NRF_PSEL(UART_TX, 1, 2)>;
    low-power-enable;
    };
    };
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Kenneth

  • Hi Kenneth,

     I've modified my custom_board.dts to have those but the result is the same. e.g.:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    &pinctrl {
    uart0_default: uart0_default {
    group1 {
    psels = <NRF_PSEL(UART_RX, 0, 25)>,
    <NRF_PSEL(UART_CTS, 0, 15)>;
    bias-pull-up;
    };
    group2 {
    psels = <NRF_PSEL(UART_TX, 0, 11)>,
    <NRF_PSEL(UART_RTS, 0, 27)>;
    };
    };
    uart0_sleep: uart0_sleep {
    group1 {
    psels = <NRF_PSEL(UART_TX, 0, 11)>,
    <NRF_PSEL(UART_RX, 0, 25)>,
    <NRF_PSEL(UART_CTS, 0, 15)>,
    <NRF_PSEL(UART_RTS, 0, 27)>;
    low-power-enable;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fullscreen
    1
    2
    3
    *** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-3e0ce7636fa6 ***
    <<o2c: UART error: 0xc>>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Update, I've run this with the delay, this is the result:

    Fullscreen
    1
    2
    3
    4
    *** Delaying boot by 4000ms... ***
    *** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-3e0ce7636fa6 ***
    <<o2c: UART error: 0xc>>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Best regards.