NRF9160 custom board uart communication

Hi, 

I'm trying to build the Serial LTE Modem in my nrf9160 SIP custom board to communicate the STM32 MCU with the nrf9160 using AT Commands via uart. 

My physical connections between STM32 MCU and nrf9160 are:

UART RX --> P0-05

UART TX --> P0-06

UART RTS --> P0-14

UART CTS --> P0-15

This is my "nrf9160dk_nrf9160_ns.overlay":

/ {
    chosen {
        ncs,slm-uart = &uart2;
    };
};

&uart0 {
    status = "disabled";
    hw-flow-control;
};

&uart2 {
    compatible = "nordic,nrf-uarte";
    current-speed = <115200>;
    status = "okay";
    hw-flow-control;

    pinctrl-0 = <&uart2_default_alt>;
    pinctrl-1 = <&uart2_sleep_alt>;
    pinctrl-names = "default", "sleep";
};

&i2c2 {
    status = "disabled";
};

&pinctrl {
    uart2_default_alt: uart2_default_alt {
        group1 {
            psels = <NRF_PSEL(UART_RX, 0, 5)>;
            bias-pull-up;
        };
        group2 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>,
                <NRF_PSEL(UART_RTS, 0, 14)>,
                <NRF_PSEL(UART_CTS, 0, 15)>;
        };
    };

    uart2_sleep_alt: uart2_sleep_alt {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>,
                <NRF_PSEL(UART_RX, 0, 5)>,
                <NRF_PSEL(UART_RTS, 0, 14)>,
                <NRF_PSEL(UART_CTS, 0, 15)>;
            low-power-enable;
        };
    };
};
And here is my "nrf9160dk_nrf9160_ns.conf":
# Configuration file for nRF9160DK.
# This file is merged with prj.conf in the application folder, and options
# set here will take precedence if they are present in both files.

# Use UART_0 (when working with PC terminal)
# unmask the following config
# CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
# CONFIG_UART_0_NRF_HW_ASYNC=y
# CONFIG_SLM_POWER_PIN=6
# CONFIG_SLM_INDICATE_PIN=2

# Use UART_2 (when working with external MCU)
# unmask the following config
CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2
CONFIG_UART_2_NRF_HW_ASYNC=y
CONFIG_SLM_POWER_PIN=31
CONFIG_SLM_INDICATE_PIN=30
Here is my prj.conf:
# General config
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_STACK_SENTINEL=y
CONFIG_PICOLIBC_IO_FLOAT=y
CONFIG_RING_BUFFER=y
CONFIG_REBOOT=y
CONFIG_EVENTFD=y

# Segger RTT
CONFIG_USE_SEGGER_RTT=n
# Where console messages (printk) are output.
# By itself, SLM does not output any.
CONFIG_RTT_CONSOLE=n
CONFIG_UART_CONSOLE=y
# Where SLM logs are output.
CONFIG_LOG_BACKEND_RTT=n
CONFIG_LOG_BACKEND_UART=n

# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_NATIVE=n
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=y

# Modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_AT_CMD_CUSTOM=y
# Align the max FD entry to NRF_MODEM_MAX_SOCKET_COUNT(8)
CONFIG_POSIX_MAX_FDS=8

# Handle modem fault
CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y

# Use GPIO
CONFIG_GPIO=y
CONFIG_GPIO_NRFX=y

# UART interface
CONFIG_SERIAL=y
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_TIMER2=n

# Stacks and heaps
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_AT_MONITOR_HEAP_SIZE=4096

# Device power management
CONFIG_PM_DEVICE=y

# FOTA
CONFIG_HTTP_PARSER_URL=y
CONFIG_FOTA_DOWNLOAD=y
CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
CONFIG_DFU_TARGET=y
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
CONFIG_DOWNLOAD_CLIENT_MAX_FILENAME_SIZE=2048
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y

# FLASH
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Settings
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y
CONFIG_NVS=y

# nRF Cloud
CONFIG_NRF_CLOUD_IPV6=n
CONFIG_NRF_CLOUD_MQTT=y
CONFIG_NRF_CLOUD_FOTA=n
CONFIG_NRF_CLOUD_AGNSS=y
CONFIG_NRF_CLOUD_AGNSS_FILTERED=n
CONFIG_NRF_CLOUD_PGPS=n
CONFIG_NRF_CLOUD_LOCATION=y
CONFIG_NRF_CLOUD_LOG_LEVEL_INF=y
CONFIG_NRF_CLOUD_GPS_LOG_LEVEL_INF=y
CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y
CONFIG_NRF_CLOUD_WIFI_LOCATION_ENCODE_OPT_MAC_RSSI=y
CONFIG_DATE_TIME=y
CONFIG_MODEM_INFO=y
CONFIG_MODEM_INFO_ADD_DATE_TIME=n

# UUID and JWT
CONFIG_MODEM_JWT=y

# MQTT client
#CONFIG_MQTT_KEEPALIVE=60
CONFIG_MQTT_CLEAN_SESSION=y

# AT command helper libraries
CONFIG_AT_CMD_PARSER=y
CONFIG_AT_MONITOR=y

#
# SLM-specific configurations
#
CONFIG_SLM_CUSTOMER_VERSION=""
CONFIG_SLM_EXTERNAL_XTAL=n

# debug options
#CONFIG_ASSERT=y
#CONFIG_LOG_BUFFER_SIZE=16384
#CONFIG_SLM_LOG_LEVEL_DBG=y
#CONFIG_LOG_PRINTK=n
#CONFIG_LOG_MODE_IMMEDIATE=y

# For using external GNSS antenna
#CONFIG_MODEM_ANTENNA=y
#CONFIG_MODEM_ANTENNA_GNSS_EXTERNAL=y
 I have a lot of errors when building the application:
Kconfig tree parse failed: Could not open 'c:/ncs/v2.7.0-rc2/zephyr/boards/nordic/nrf9160dk/[email protected]_nrf9160_defconfig' (ENOENT: No such file or directory). Check that the $srctree environment variable (set to 'C:/ncs/v2.7.0-rc2/zephyr') is set correctly.
NRF_MODEM_LIB has direct dependencies SOC_SERIES_NRF91X && TRUSTED_EXECUTION_NONSECURE with value n, but is currently being y-selected by the following symbols:
- MODEM_INFO , with value y, direct dependencies y (value: y)
- MODEM_JWT , with value y, direct dependencies y (value: y)
CONFIG_UART_2_NRF_HW_ASYNC_TIMER couldn't be set. Missing dependencies:
UART_2_NRF_HW_ASYNC && HAS_HW_NRF_UARTE2
CONFIG_UART_2_NRF_HW_ASYNC was assigned the value y, but got the value n. Missing dependencies:
HAS_HW_NRF_UARTE2 && HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC && HAS_HW_NRF_UARTE2
I don't know what to do.. so, please, could you help me?
thanks!
Parents
  • Hi

    Could not open 'c:/ncs/v2.7.0-rc2/zephyr/boards/nordic/nrf9160dk/[email protected]_nrf9160_defconfig' (ENOENT: No such file or directory). Check that the $srctree environment variable (set to 'C:/ncs/v2.7.0-rc2/zephyr') is set correctly.

    looks like incorrect installation. Did you install through the toolchain manager or the VS Code extension?

    Maybe you can first try reinstalling the version of ncs,

    and then build any sample (say blinky or hello world) to see it is correctly building in the sdk,

    I just installed ncs v2.7.0-rc2 through the VS Code (nrf-connect extension), It did not provide an option to install the toolchain, so I am assuming that the latest preinstalled toolchain is used

    I clicked on manage SDKs---->Install SDK--->ncs 2.7.0-rc2------>enter the path for sdk----->it takes few minutes to install

    I tested with blinky

    then I tested with Serial LTE Modem, it is building correctly.

  • Thanks a lot Naeem.

    I installed (again) the nRF Connect for VS Code Extension Pack, then I had to install the Toolchain (v2.6.1) there is no option to install the SDK without the Toolchain (at least in my VS Code). After that, I installed the SDK v2.7.0-rc3. 

    I tried to build the Blinky example and gave me the following errors:

    I can't understand what I'm doing wrong..

    thanks in advance

    Best Regards!

  • I repeated the process with SDK v2.6.1, with blinky example was ok, but with Serial LTE Modem i got the following errors:

    At this point in the building process: 

    [45/178] Building C object CMakeFiles/app.dir/C_/ncs/v2.6.1/bootloader/mcuboot/boot/bootutil/src/image_ed25519.c.obj

    Then the process continues and finish apparently ok but ...

    best regards!

Reply Children
Related