Communication Between NRF9160 and Nucleo Board Using SLM Example

Hello everyone,

I've successfully implemented the SLM example on the NRF9160, and it's functioning properly. Now, I'm attempting to send AT commands to the modem using my Nucleo board. I've disabled hardware flow control in the Nucleo configuration as well as in the SLM example configuration. Additionally, I've added the following code to the interrupt handler of the Nucleo board. While I can observe "Ready" on the RX of the Nucleo board, I'm not receiving any replies when I send AT\r\n to the modem. Could someone please assist me in resolving this issue?

Overlay:

/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */
 / {
    chosen {
             ncs,slm-uart = &uart2;
           };
  };

  / {
	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";
};

&pinctrl {
	uart2_default_alt: uart2_default_alt {
		group1 {
			psels = <NRF_PSEL(UART_RX, 0, 11)>;
			bias-pull-up;
		};
		group2 {
			psels = <NRF_PSEL(UART_TX, 0, 10)>,
				<NRF_PSEL(UART_RTS, 0, 12)>,
				<NRF_PSEL(UART_CTS, 0, 13)>;
		};
	};

	uart2_sleep_alt: uart2_sleep_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 10)>,
				<NRF_PSEL(UART_RX, 0, 11)>,
				<NRF_PSEL(UART_RTS, 0, 12)>,
				<NRF_PSEL(UART_CTS, 0, 13)>;
			low-power-enable;
		};
	};
};


&spi3 {
	status = "disabled";
};

&i2c2 {
	status = "disabled";
};

prg config: 

#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
# General config
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_STACK_SENTINEL=y
CONFIG_PICOLIBC_IO_FLOAT=y
CONFIG_RING_BUFFER=y

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

# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_NATIVE=n

# Modem library
CONFIG_NRF_MODEM_LIB=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=y

# 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
CONFIG_SLM_START_SLEEP=n
CONFIG_SLM_DATAMODE_URC=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
CONFIG_SLM_CR_TERMINATION=y

RTT output: 

Nucelo IRQ Handler: 

  • Hello, 

    Looking at your setup, I can't see that you have enabled the following KConfig options:

    # 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

    Please see the Connecting with an external MCU documentation.

    Kind regards,
    Øyvind

  • Hi  it's done before in nrf9160dk_nrf9160_ns.conf as below: 

    #
    # Copyright (c) 2021 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # 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
    

    But still I can't communicate with modem.

Related