Issue with the new UART configuration in zephyr RTOS for nrf52840dk

I have configured new UART in zephyr.dts device tree like this"
"/ {
        chosen {
            zephyr,console = &uart1;
            zephyr,shell-uart = &uart1;
            zephyr,uart-mcumgr = &uart1;
            zephyr,bt-mon-uart = &uart1;
            zephyr,bt-c2h-uart = &uart1;
            zephyr,sram = &sram1;
            zephyr,flash = &flash1;
            zephyr,code-partition = &slot1_partition;
            zephyr,ieee802154 = &ieee802154;
        };
    
        uart1: uart@40028000 {
            compatible = "nordic,nrf-uarte";
            reg = <0x40028000 0x1000>;
            interrupts = <0x28 0x1>;
            status = "okay";
            current-speed = <115200>;
            pinctrl-0 = <&uart1_default>;
            pinctrl-1 = <&uart1_sleep>;
            pinctrl-names = "default", "sleep";
        };
    };
    
    &uart1 {
        pinctrl-0 = <&uart1_default>;
        pinctrl-1 = <&uart1_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &pinctrl {
        uart1_default: uart1_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 14)>, /*Tx pin */
                        <NRF_PSEL(UART_RX, 0, 16)>; /*Rx pin */
            };
        };
    
        uart1_sleep: uart1_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 14)>,
                        <NRF_PSEL(UART_RX, 0, 16)>;
            };
        };
    };
and i am using this UART as "const struct device *uart_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));" in my implementation,but my problem is that in this tx pin is working as i am able to see light in the tx pin when i send some data through external application,but I am not able to receive data from rx pin  means rx pin is not working so i am not getting how to solve the issue.

where i am using USB to ttl to connect tx and rx pin to the nrf52840dk board


Parents Reply
  • I understand. Then I recommend that you choose another freely available GPIO. You can find an overview over them on the backside of the DK or in the datasheet for the nRF52840DK. Have a look at that and if you're uncertain if you can use them, feel free to ask.

    In the lesson I sent you there should be enough information for you to understand why it does not make sense to use the GPIOs that belongs to the LEDS. Instead follow the example in the exercise in the lesson and use your own newly configured UART using any other freely available GPIO's. 

    Kind regards,
    Andreas

Children
Related