AT uart

I am trying to set up the AT library to directly talk to the modem through a uart on the nrf9160DK.  But when I enter the commands to test "AT+CFUN?" I just get it echoed back

I have a USB to UART converter connected to P0.00 and P0.01 to talk to the modem.

prj.conf

#Enable logger module
CONFIG_LOG=y

#Enable logging through UART
CONFIG_SERIAL=y
CONFIG_SHELL_LOG_BACKEND=y

#Enable shell
CONFIG_SHELL=y

CONFIG_AT_HOST_LIBRARY=y
CONFIG_AT_HOST_UART_INIT_TIMEOUT=10000
CONFIG_AT_HOST_CMD_MAX_LEN=32



Device overlay
&interface_to_nrf52840 {
    gpio-map = <0 0 &gpio0 17 0>,
               <1 0 &gpio0 18 0>,
               <2 0 &gpio0 19 0>,
               <3 0 &gpio0 21 0>,
               <4 0 &gpio0 22 0>,
               <5 0 &gpio0 23 0>,
               <9 0 &gpio0 24 0>;
};

&uart1 {
    status = "okay";
};

&uart0 {
    status = "okay";
};

/ {
    chosen {
        zephyr,console = &uart0;
    };
};

/ {
    chosen {
        zephyr,shell-uart = &uart0;
    };
};

&uart1_default {
    group2 {
        psels = <NRF_PSEL(UART_RX, 0, 0)>;
    };
};

&uart1_default {
    group1 {
        psels = <NRF_PSEL(UART_TX, 0, 1)>;
    };
};

&uart1 {
    hw-flow-control;
};

&uart1 {
    /delete-property/ hw-flow-control;
};

&uart0_default {
    group2 {
        psels = <NRF_PSEL(UART_RX, 0, 16)>, <NRF_PSEL(UART_CTS, 0, 26)>;
    };
};

&uart0_default {
    group1 {
        psels = <NRF_PSEL(UART_TX, 0, 17)>, <NRF_PSEL(UART_RTS, 0, 27)>;
    };
};
Parents
  • You don't need to connect USB to UART convertor to any pins. The DK already has VCOM ports over the USB connection.

    I recommend trying the at_client sample.

    In VS Code "Create a new application"

    "Copy a sample"

    Start typing "at_client" and select at_client Sample

    Create a build configuration for nrf9160 dk and don't make any changes to the device tree configuration. The DK has 3 UARTs. Two of them are for the nRF9160. Try connecting to all of them at 115200, and keep type AT<ENTER> util one of them responds with "OK"

Reply
  • You don't need to connect USB to UART convertor to any pins. The DK already has VCOM ports over the USB connection.

    I recommend trying the at_client sample.

    In VS Code "Create a new application"

    "Copy a sample"

    Start typing "at_client" and select at_client Sample

    Create a build configuration for nrf9160 dk and don't make any changes to the device tree configuration. The DK has 3 UARTs. Two of them are for the nRF9160. Try connecting to all of them at 115200, and keep type AT<ENTER> util one of them responds with "OK"

Children
Related