At_commands application

Hello, I want to write an applicatin that gets at_coammnds from the terminal via uart, sends the command to the modem and then sends the respond back via uart.
I have two option to achieve this:
1. adding the functionality to an already existing uart application that I have.
2. using the at_client application.

in both cases,right now I run in the same problem, the code doesn't compile because the nrf_modem.h file isn't found by the compiler.
I see that this file is located at nrfxlib\nrf_modem\include\nrf_modem.h
so it seems that Mr application doesn't compile nrfxlib, but I cant fins what configuration files I need to add to my prjconf file in order for it to compile.
thanks in advance,

shlomo

Parents
  • Hello Shlomo, 

    Can you please provide more information on what exactly you are trying to do? What version of the nRC Connect SDK are you working on? Do you have two devices, where one is a nRF91, and the other is the host device? 

    right now I run in the same problem, the code doesn't compile because the nrf_modem.h file isn't found by the compiler.

    Are you seeing the same issue with our samples in the SDK?  E.g. AT Client sample. If so, please provide build logs with the problem for us to analyze.

    Kind regards,
    Øyvind

  • Hey Oyvind, Thank you for the response.
    1. I am using the 2.7.0 SDK.
    2.I have only the nrf9160dk which has a cellular modem on it. 
    3. I want to write an application the lets me communicate with the modem, write at_commands through the terminal via uart and get the results back to the terminal via uart.
    4. Yes I am trying the AT Client sample and get this build error: 

    nrf_modm,h is located at nrfxlib\nrf_modem\include\nrf_modem.h which probably means the NY build system doesn't see nrfxlib.

    thanks

  • Sounds like you need to reinstall your SDK. How did you install the SDK and toolchain?

  • I did it through the visual studio code extension:

  • ok I figured something out, It seems the build fails only if my target is nrf9160dk_nrf9160.
    if I build to nrf9160dk_nrf9160_ns the build doesn't fail.
    why would it fail if I build to nrf9160dk_nrf9160?

  • Yes, the modem is only available through the non-secure core of nrf9160dk_nrf9160_ns. See developing with nrf91-series for more information

  • ok I will take a look, but for some reason when I try to build for the the _ns target with my overlay, I get this error:

    this is my overlay:

    /* Overlay for TWI/IC2 Zephyr NCS implementation with nRFx TWIM Driver */
    /* Line references are used in the blog post and twim_node.txt */


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

    // &uart0 {
    //     status = "disabled";
    // };


    &uart2 {
        status = "okay";
        current-speed = <115200>;
    };

    // &spi2 {
    //  status = "disabled";
    // };

    &i2c2 {
        status = "disabled";
    };




    &pinctrl {
        uart2_default: uart2_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 10)>,
                    <NRF_PSEL(UART_RX, 0, 11)>;
            };
        };

        uart2_sleep: uart2_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 10)>,
                    <NRF_PSEL(UART_RX, 0, 11)>;
                low-power-enable;
            };
        };

    };

    my nrf9160 sits on a customboard with the uart pins already set. 
    what is the problem?
    does the non secure build use some of these uart controller by default?
Reply
  • ok I will take a look, but for some reason when I try to build for the the _ns target with my overlay, I get this error:

    this is my overlay:

    /* Overlay for TWI/IC2 Zephyr NCS implementation with nRFx TWIM Driver */
    /* Line references are used in the blog post and twim_node.txt */


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

    // &uart0 {
    //     status = "disabled";
    // };


    &uart2 {
        status = "okay";
        current-speed = <115200>;
    };

    // &spi2 {
    //  status = "disabled";
    // };

    &i2c2 {
        status = "disabled";
    };




    &pinctrl {
        uart2_default: uart2_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 10)>,
                    <NRF_PSEL(UART_RX, 0, 11)>;
            };
        };

        uart2_sleep: uart2_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 10)>,
                    <NRF_PSEL(UART_RX, 0, 11)>;
                low-power-enable;
            };
        };

    };

    my nrf9160 sits on a customboard with the uart pins already set. 
    what is the problem?
    does the non secure build use some of these uart controller by default?
Children
  • Ok realised it was becasue I was trying to use uart1 which is disabled for the tfm default use.
    the at_client app now runs and I can see this in the RTT:

    but I cant communicate with the modem still, I am sending commands through uart and don't get anything back:

    I tried to send messages through all of the possible uart controllers. what am I missing?

    thanks in advance,
    shlomo