nrf54lm20b - aws_iot sample (nrf54lm20dk/nrf54lm20b/cpuapp) repeatedly restarts and crashes if debug logs are enabled.

Hello,
I've provisioned AWS IoT certificates & keys as per Nordic Semi instructions and verified that they are correct in AWS IoT Core.

On placing them under <project / certs> in the aws_iot sample project, build was successful. However, on execution the application connects to local WiFi and then restarts. It fails to connect to AWS IoT.

Using nRF54LM20 + nRF7002EBII with nRF Connect SDK 3.4.1, target nrf54lm20dk/nrf54lm20b/cpuapp.

uart:~$ 
[00:00:13.573,118] <inf> wifi_nrf_bus: SPIM spi@c8000: freq = 8 MHz
[00:00:13.573,139] <inf> wifi_nrf_bus: SPIM spi@c8000: latency = 0
[00:00:13.831,157] <inf> fs_zms: 2 Sectors of 4096 bytes
[00:00:13.831,168] <inf> fs_zms: alloc wra: 0, f60
[00:00:13.831,176] <inf> fs_zms: data wra: 0, 1d0
*** Booting nRF Connect SDK v3.4.1-b20f8619ba9a ***
*** Using Zephyr OS v4.4.2-33fa6a7aac6a ***
[00:00:13.832,248] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
[00:00:13.832,262] <inf> aws_iot_sample: Bringing network interface up and connecting to the network
[00:00:13.832,691] <inf> wifi_supplicant: wpa_supplicant initialized
Connection request failed (AP not found/4)
[00:00:24.529,972] <inf> wpa_supp: wlan0: SME: Trying to authenticate with 96:b0:22:b2:90:61 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:24.931,084] <inf> wpa_supp: wlan0: Trying to associate with 96:b0:22:b2:90:61 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:24.968,663] <inf> wpa_supp: wlan0: Associated with 96:b0:22:b2:90:61
[00:00:24.969,228] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
[00:00:24.996,693] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with 96:b0:22:b2:90:61 [PTK=CCMP GTK=CCMP]
[00:00:24.996,912] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to 96:b0:22:b2:90:61 completed [id=0 id_str=]
Connected
[00:00:25.033,994] <inf> aws_iot_sample: Network connectivity established
uart:~$ 
[00:00:30.693,115] <inf> wifi_nrf_bus: SPIM spi@c8000: freq = 8 MHz
[00:00:30.693,136] <inf> wifi_nrf_bus: SPIM spi@c8000: latency = 0
[00:00:30.951,181] <inf> fs_zms: 2 Sectors of 4096 bytes
[00:00:30.951,193] <inf> fs_zms: alloc wra: 0, f60
[00:00:30.951,201] <inf> fs_zms: data wra: 0, 1d0
*** Booting nRF Connect SDK v3.4.1-b20f8619ba9a ***
*** Using Zephyr OS v4.4.2-33fa6a7aac6a ***
[00:00:30.952,273] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
[00:00:30.952,288] <inf> aws_iot_sample: Bringing network interface up and connecting to the network
[00:00:30.952,716] <inf> wifi_supplicant: wpa_supplicant initialized
[00:00:36.635,446] <inf> wpa_supp: wlan0: SME: Trying to authenticate with 96:b0:22:b2:90:61 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:37.035,878] <inf> wpa_supp: wlan0: Trying to associate with 96:b0:22:b2:90:61 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:37.077,720] <inf> wpa_supp: wlan0: Associated with 96:b0:22:b2:90:61
[00:00:37.078,287] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
[00:00:37.112,170] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with 96:b0:22:b2:90:61 [PTK=CCMP GTK=CCMP]
[00:00:37.112,385] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to 96:b0:22:b2:90:61 completed [id=0 id_str=]
Connected
[00:00:37.155,941] <inf> aws_iot_sample: Network connectivity established
[00:00:42.156,033] <inf> aws_iot_sample: Connecting to AWS IoT
uart:~$ 
[00:00:43.456,786] <inf> wifi_nrf_bus: SPIM spi@c8000: freq = 8 MHz
[00:00:43.456,807] <inf> wifi_nrf_bus: SPIM spi@c8000: latency = 0
[00:00:43.714,798] <inf> fs_zms: 2 Sectors of 4096 bytes
[00:00:43.714,810] <inf> fs_zms: alloc wra: 0, f60
[00:00:43.714,817] <inf> fs_zms: data wra: 0, 1d0
*** Booting nRF Connect SDK v3.4.1-b20f8619ba9a ***


After adding the following Kconfig debug statements to determine cause, the applications crashes.

CONFIG_MQTT_HELPER_LOG_LEVEL_DBG=y
CONFIG_MBEDTLS_DEBUG=y
CONFIG_MBEDTLS_LOG_LEVEL_DBG=y
CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y
CONFIG_NET_TCP_LOG_LEVEL_DBG=y
CONFIG_NET_LOG=y

After increasing the heap sizes to below, the application gets a little further but throws up “mqtt_helper: mqtt_connect, error: -116”  ETIMEDOUT and then crashes.

I tried increasing the CONFIG_NET_SOCKETS_CONNECT_TIMEOUT  from the default. The application stopped crashing but still get error -116.

CONFIG_MBEDTLS_HEAP_SIZE=81920
CONFIG_HEAP_MEM_POOL_SIZE=40144
CONFIG_NRF_WIFI_DATA_HEAP_SIZE=59856
CONFIG_NET_SOCKETS_CONNECT_TIMEOUT=10000 (also tried 40000)

[00:00:05.768,960] <inf> wpa_supp: wlan0: SME: Trying to authenticate with 46:ac:8f:8c:6e:30 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:06.144,545] <inf> wpa_supp: wlan0: Trying to associate with 46:ac:8f:8c:6e:30 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:06.175,625] <wrn> net_if: iface 1 pkt 0x2004b260 send failure status -1
[00:00:06.181,722] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x20003410, pkt=0x2004b43c, st=0, user_data=0
[00:00:06.185,758] <inf> wpa_supp: wlan0: Associated with 46:ac:8f:8c:6e:30
[00:00:06.186,393] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
[00:00:06.199,732] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x20003410, pkt=0x2004b3f8, st=0, user_data=0
[00:00:06.213,161] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with 46:ac:8f:8c:6e:30 [PTK=CCMP GTK=CCMP]
[00:00:06.213,862] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to 46:ac:8f:8c:6e:30 completed [id=0 id_str=]
Connected
[00:00:06.268,300] <dbg> net_sock: zsock_socket_internal: (rx_q[0]): socket: ctx=0x200034d8, fd=10
[00:00:06.269,191] <dbg> net_sock_svc: socket_service_thread: (net_socket_service): Received restart event.
[00:00:06.291,735] <inf> net_dhcpv4: Received: 172.20.10.10
[00:00:06.291,966] <inf> aws_iot_sample: Network connectivity established
--- 5 messages dropped ---
[00:00:11.381,766] <dbg> net_sock_addr: dns_resolve_cb: (net_socket_service): dns status: -103
[00:00:11.381,813] <dbg> net_sock_addr: exec_query: (sysworkq): Timeout 2000
[00:00:11.442,125] <dbg> net_sock: zsock_received_cb: (rx_q[0]): ctx=0x200034d8, pkt=0x2004b3f8, st=0, user_data=0
[00:00:11.442,912] <dbg> net_sock_addr: dns_resolve_cb: (net_socket_service): dns status: -100
[00:00:11.442,933] <dbg> net_sock_addr: dns_resolve_cb: (net_socket_service): dns status: -103
[00:00:11.443,003] <dbg> mqtt_helper: broker_init: IPv4 Address found 54.86.151.37 (AF_INET)
[00:00:11.443,029] <dbg> mqtt_helper: client_connect: Using build-time provided security tag value from Kconfig
[00:00:11.443,066] <dbg> mqtt_helper: mqtt_state_set: State transition: MQTT_STATE_DISCONNECTED --> MQTT_STATE_TRANSPORT_CONNECTING
[00:00:11.443,229] <dbg> net_sock_tls: tls_alloc: (sysworkq): Allocated TLS context, 0x20002918
[00:00:11.443,438] <dbg> net_tcp: tcp_conn_ref: (sysworkq): [0x2004b590] ref_count: 1
[00:00:11.443,458] <dbg> net_tcp: tcp_conn_alloc: (sysworkq): [0x2004b590] Allocated
[00:00:11.443,636] <dbg> net_sock: zsock_socket_internal: (sysworkq): socket: ctx=0x200035a0, fd=12
[00:00:11.463,655] <dbg> net_tcp: net_tcp_recv: (sysworkq): [0x2004b590] context: 0x200035a0, cb: 0x2ed5d, user_data: 0
[00:00:11.463,899] <dbg> net_tcp: net_tcp_connect: (sysworkq): [0x2004b590] context: 0x200035a0, local: 0.0.0.0, remote: 54.86.151.37
[00:00:11.464,298] <dbg> net_tcp: net_tcp_connect: (sysworkq): [0x2004b590] src: 172.20.10.10, dst: 54.86.151.37
[00:00:11.464,500] <dbg> net_tcp: tcp_start_handshake: (sysworkq): [0x2004b590] LISTEN->SYN_SENT
[00:00:11.464,526] <dbg> net_tcp: tcp_conn_ref: (sysworkq): [0x2004b590] ref_count: 2
[00:00:11.683,561] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=0
[00:00:12.011,782] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=1
[00:00:12.504,031] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=2
[00:00:13.242,280] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=3
[00:00:14.349,530] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=4
[00:00:14.464,665] <dbg> net_tcp: tcp_conn_close_debug: (sysworkq): [0x2004b590] closed by TCP stack (net_tcp_connect():4094)
[00:00:14.464,692] <dbg> net_tcp: tcp_conn_close_debug: (sysworkq): [0x2004b590] SYN_SENT->CLOSED
[00:00:14.464,716] <dbg> net_sock: zsock_received_cb: (sysworkq): ctx=0x200035a0, pkt=0, st=-116, user_data=0
[00:00:14.464,736] <dbg> net_sock: zsock_received_cb: (sysworkq): Marked socket 0x200035a0 as peer-closed
[00:00:14.464,757] <dbg> net_tcp: tcp_conn_unref: (sysworkq): [0x2004b590] ref_count=2
[00:00:14.464,774] <dbg> net_tcp: net_tcp_connect: (sysworkq): [0x2004b590] ret=-116
[00:00:14.464,972] <dbg> net_sock: zsock_close_ctx: (sysworkq): close: ctx=0x200035a0, fd=12
[00:00:14.464,993] <dbg> net_tcp: net_tcp_recv: (sysworkq): [0x2004b590] context: 0x200035a0, cb: 0, user_data: 0
[00:00:14.465,058] <dbg> net_tcp: net_tcp_put: (sysworkq): [0x2004b590]  [CLOSED Seq=1{581805237} Ack=0{0}]
[00:00:14.465,097] <dbg> net_tcp: net_tcp_put: (sysworkq): [0x2004b590] context 0x200035a0 CONNECTING
[00:00:14.465,116] <dbg> net_tcp: tcp_conn_unref: (sysworkq): [0x2004b590] ref_count=1
[00:00:14.465,141] <err> mqtt_helper: mqtt_connect, error: -116
[00:00:14.465,166] <dbg> mqtt_helper: mqtt_state_set: State transition: MQTT_STATE_TRANSPORT_CONNECTING --> MQTT_STATE_DISCONNECTED
[00:00:14.465,173] <err> aws_iot: mqtt_helper_connect, error: -116
[00:00:14.465,179] <err> aws_iot_sample: aws_iot_connect, error: -116
[00:00:14.465,184] <err> aws_iot_sample: Fatal error! Rebooting the device.
uart:~$ 
[00:00:00.019,528] <inf> wifi_nrf_bus: SPIM spi@c8000: freq = 8 MHz
[00:00:00.019,548] <inf> wifi_nrf_bus: SPIM spi@c8000: latency = 0
[00:00:00.276,442] <inf> fs_zms: 2 Sectors of 4096 bytes
[00:00:00.276,454] <inf> fs_zms: alloc wra: 0, f60
[00:00:00.276,463] <inf> fs_zms: data wra: 0, 1d0
*** Booting nRF Connect SDK v3.4.1-b20f8619ba9a ***
*** Using Zephyr OS v4.4.2-33fa6a7aac6a ***
[00:00:00.277,661] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
[00:00:00.277,677] <inf> aws_iot_sample: Bringing network interface up and connecting to the network
[00:00:00.278,147] <inf> wifi_supplicant: wpa_supplicant initialized
[00:00:00.279,575] <dbg> net_sock_svc: socket_service_thread: (net_socket_service): Service WEST_TOPDIR/zephyr/subsys/net/lib/dns/resolve.c:45 has 1 pollable sockets
[00:00:00.279,593] <dbg> net_sock_svc: socket_service_thread: (net_socket_service): Monitoring 1 socket entries
[00:00:00.280,331] <dbg> mqtt_helper: mqtt_helper_poll_loop: Waiting for connection_poll_sem
[00:00:01.868,999] <inf> net_wifi_mgmt: Connection requested
[00:00:01.869,055] <dbg> mqtt_helper: mqtt_state_set: State transition: MQTT_STATE_UNINIT --> MQTT_STATE_DISCONNECTED
[00:00:05.770,093] <inf> wpa_supp: wlan0: SME: Trying to authenticate with 46:ac:8f:8c:6e:30 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:06.175,108] <inf> wpa_supp: wlan0: Trying to associate with 46:ac:8f:8c:6e:30 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:06.201,594] <wrn> net_if: iface 1 pkt 0x2004b260 send failure status -1
[00:00:06.206,313] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x20003410, pkt=0x2004b43c, st=0, user_data=0
[00:00:06.211,703] <inf> wpa_supp: wlan0: Associated with 46:ac:8f:8c:6e:30
[00:00:06.212,338] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
[00:00:06.226,850] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x20003410, pkt=0x2004b3f8, st=0, user_data=0
[00:00:06.240,286] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with 46:ac:8f:8c:6e:30 [PTK=CCMP GTK=CCMP]
[00:00:06.240,987] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to 46:ac:8f:8c:6e:30 completed [id=0 id_str=]
Connected
[00:00:06.258,621] <dbg> net_sock: zsock_socket_internal: (rx_q[0]): socket: ctx=0x200034d8, fd=10
[00:00:06.259,508] <dbg> net_sock_svc: socket_service_thread: (net_socket_service): Received restart event.
[00:00:06.274,646] <inf> net_dhcpv4: Received: 172.20.10.10
[00:00:06.274,876] <inf> aws_iot_sample: Network connectivity established
--- 5 messages dropped ---
[00:00:11.299,932] <dbg> net_sock_addr: dns_resolve_cb: (net_socket_service): dns status: -103
[00:00:11.299,978] <dbg> net_sock_addr: exec_query: (sysworkq): Timeout 2000
[00:00:11.307,308] <dbg> net_sock: zsock_received_cb: (rx_q[0]): ctx=0x200034d8, pkt=0x2004b3f8, st=0, user_data=0
[00:00:11.308,094] <dbg> net_sock_addr: dns_resolve_cb: (net_socket_service): dns status: -100
[00:00:11.308,115] <dbg> net_sock_addr: dns_resolve_cb: (net_socket_service): dns status: -103
[00:00:11.308,185] <dbg> mqtt_helper: broker_init: IPv4 Address found 54.86.151.37 (AF_INET)
[00:00:11.308,211] <dbg> mqtt_helper: client_connect: Using build-time provided security tag value from Kconfig
[00:00:11.308,248] <dbg> mqtt_helper: mqtt_state_set: State transition: MQTT_STATE_DISCONNECTED --> MQTT_STATE_TRANSPORT_CONNECTING
[00:00:11.308,411] <dbg> net_sock_tls: tls_alloc: (sysworkq): Allocated TLS context, 0x20002918
[00:00:11.308,620] <dbg> net_tcp: tcp_conn_ref: (sysworkq): [0x2004b590] ref_count: 1
[00:00:11.308,640] <dbg> net_tcp: tcp_conn_alloc: (sysworkq): [0x2004b590] Allocated
[00:00:11.308,819] <dbg> net_sock: zsock_socket_internal: (sysworkq): socket: ctx=0x200035a0, fd=12
[00:00:11.328,849] <dbg> net_tcp: net_tcp_recv: (sysworkq): [0x2004b590] context: 0x200035a0, cb: 0x2ed5d, user_data: 0
[00:00:11.329,094] <dbg> net_tcp: net_tcp_connect: (sysworkq): [0x2004b590] context: 0x200035a0, local: 0.0.0.0, remote: 54.86.151.37
[00:00:11.329,493] <dbg> net_tcp: net_tcp_connect: (sysworkq): [0x2004b590] src: 172.20.10.10, dst: 54.86.151.37
[00:00:11.329,695] <dbg> net_tcp: tcp_start_handshake: (sysworkq): [0x2004b590] LISTEN->SYN_SENT
[00:00:11.329,722] <dbg> net_tcp: tcp_conn_ref: (sysworkq): [0x2004b590] ref_count: 2
[00:00:11.610,765] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=0
[00:00:12.032,043] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=1
[00:00:12.663,289] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=2
[00:00:13.609,541] <dbg> net_tcp: tcp_resend_data: (tcp_work): [0x2004b590] send_data_retries=3
[00:00:14.329,846] <dbg> net_tcp: tcp_conn_close_debug: (sysworkq): [0x2004b590] closed by TCP stack (net_tcp_connect():4094)
[00:00:14.329,881] <dbg> net_tcp: tcp_conn_close_debug: (sysworkq): [0x2004b590] SYN_SENT->CLOSED
[00:00:14.329,906] <dbg> net_sock: zsock_received_cb: (sysworkq): ctx=0x200035a0, pkt=0, st=-116, user_data=0
[00:00:14.329,926] <dbg> net_sock: zsock_received_cb: (sysworkq): Marked socket 0x200035a0 as peer-closed
[00:00:14.329,947] <dbg> net_tcp: tcp_conn_unref: (sysworkq): [0x2004b590] ref_count=2
[00:00:14.329,964] <dbg> net_tcp: net_tcp_connect: (sysworkq): [0x2004b590] ret=-116
[00:00:14.330,162] <dbg> net_sock: zsock_close_ctx: (sysworkq): close: ctx=0x200035a0, fd=12
[00:00:14.330,182] <dbg> net_tcp: net_tcp_recv: (sysworkq): [0x2004b590] context: 0x200035a0, cb: 0, user_data: 0
[00:00:14.330,247] <dbg> net_tcp: net_tcp_put: (sysworkq): [0x2004b590]  [CLOSED Seq=1{579699237} Ack=0{0}]
[00:00:14.330,269] <dbg> net_tcp: net_tcp_put: (sysworkq): [0x2004b590] context 0x200035a0 CONNECTING
[00:00:14.330,299] <dbg> net_tcp: tcp_conn_unref: (sysworkq): [0x2004b590] ref_count=1
[00:00:14.330,324] <err> mqtt_helper: mqtt_connect, error: -116
[00:00:14.330,349] <dbg> mqtt_helper: mqtt_state_set: State transition: MQTT_STATE_TRANSPORT_CONNECTING --> MQTT_STATE_DISCONNECTED
[00:00:14.330,356] <err> aws_iot: mqtt_helper_connect, error: -116
[00:00:14.330,362] <err> aws_iot_sample: aws_iot_connect, error: -116
[00:00:14.330,367] <err> aws_iot_sample: Fatal error! Rebooting the device.
uart:~$ 
[00:00:00.019,526] <inf> wifi_nrf_bus: SPIM spi@c8000: freq = 8 MHz
[00:00:00.019,558] <inf> wifi_nrf_bus: SPIM spi@c8000: latency = 0
[00:00:00.276,443] <inf> fs_zms: 2 Sectors of 4096 bytes
[00:00:00.276,455] <inf> fs_zms: alloc wra: 0, f60
[00:00:00.276,464] <inf> fs_zms: data wra: 0, 1d0
*** Booting nRF Connect SDK v3.4.1-b20f8619ba9a ***
*** Using Zephyr OS v4.4.2-33fa6a7aac6a ***
[00:00:00.277,661] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
[00:00:00.277,677] <inf> aws_iot_sample: Bringing network interface up and connecting to the network
[00:00:00.278,147] <inf> wifi_supplicant: wpa_supplicant initialized
[00:00:00.279,574] <dbg> net_sock_svc: socket_service_thread: (net_socket_service): Service WEST_TOPDIR/zephyr/subsys/net/lib/dns/resolve.c:45 has 1 pollable sockets
[00:00:00.279,593] <dbg> net_sock_svc: socket_service_thread: (net_socket_service): Monitoring 1 socket entries
[00:00:00.280,331] <dbg> mqtt_helper: mqtt_helper_poll_loop: Waiting for connection_poll_sem
[00:00:01.868,838] <inf> net_wifi_mgmt: Connection requested
[00:00:01.868,893] <dbg> mqtt_helper: mqtt_state_set: State transition: MQTT_STATE_UNINIT --> MQTT_STATE_DISCONNECTED
[00:00:05.766,345] <inf> wpa_supp: wlan0: SME: Trying to authenticate with 46:ac:8f:8c:6e:30 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:06.172,618] <inf> wpa_supp: wlan0: Trying to associate with 46:ac:8f:8c:6e:30 (SSID='Tachyon-Ravi' freq=2437 MHz)
[00:00:06.212,901] <wrn> net_if: iface 1 pkt 0x2004b260 send failure status -1
[00:00:06.218,820] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x20003410, pkt=0x2004b43c, st=0, user_data=0
[00:00:06.222,879] <inf> wpa_supp: wlan0: Associated with 46:ac:8f:8c:6e:30
[00:00:06.223,514] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
[00:00:06.242,123] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x20003410, pkt=0x2004b3f8, st=0, user_data=0
[00:00:06.254,189] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with 46:ac:8f:8c:6e:30 [PTK=CCMP GTK=CCMP]
[00:00:06.255,112] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to 46:ac:8f:8c:6e:30 completed [id=0 id_str=]
Connected
[00:00:06.277,087] <dbg> net_sock: zsock_socket_internal: (rx_q[0]): socket: ctx=0x200034d8, fd=10
[00:00:06.277,978] <dbg> net_sock_svc: socket_service_thread: (net_socket_service): Received restart event.
[00:00:06.297,602] <inf> net_dhcpv4: Received: 172.20.10.10
[00:00:06.297,833] <inf> aws_iot_sample: Network connectivity established
uart:~$


I would appreciate if someone in support can verify the sample connection to AWS IoT for target nrf54lm20dk/nrf54lm20b/cpuapp.

Thank you.

  • Hi,

     

    The log shows that your workqueue stack is overflowing.

    Could you share how you configured the aws_iot example? It is important that you include "wifi.conf":

    https://github.com/nrfconnect/sdk-nrf/blob/main/samples/net/aws_iot/sample.yaml#L56-L58

     

    Kind regards,

    Håkon

  • Hi Håkon,

    Thank 
    you. It looks like the Github 'aws_iot' has been updated with several configuration and overlays changes in the last week and yesterday.

    My NCS 3.4.1 aws_iot sample doesn't have a "wifi.conf" as in the GitHub sdk-nrf/samples/net/aws_iot". Also, I had the Kconfig for WiFi, MBEDTLS, FLASH configuration in "nrf54lm20dk_nrf54lm20b_cpuapp.conf".

    I took the latest Github "aws_iot", added a <project/certs> folder with the certificates & keys, and built the application by including both "wifi.conf" & "wifi_credentials". Unfortunately, on execution the application didn't even attempt a WiFI connection.

    In order to successfully connect to the WiFi and then to AWS IoT, I had to add the following Kconfgs to the sample "wifi.conf". 

    # Wi-Fi
    CONFIG_WIFI_NRF70=y
    
    # NET buffers
    CONFIG_NRF70_RX_NUM_BUFS=6
    CONFIG_NRF70_MAX_TX_AGGREGATION=1
    
    
    Without "CONFIG_WIFI_NRF70=y", the application doesn't attempt a WiFi connection. Also, omitting "CONFIG_NRF70_RX_NUM_BUFS" doesn't work as the default value is 64.

    Console output - Successful connection to AWS IoT
    [00:00:00.019,206] <inf> wifi_nrf_bus: SPIM spi@c8000: freq = 8 MHz
    [00:00:00.019,240] <inf> wifi_nrf_bus: SPIM spi@c8000: latency = 0
    [00:00:00.276,822] <inf> fs_zms: 8 Sectors of 4096 bytes
    [00:00:00.276,833] <inf> fs_zms: alloc wra: 0, fb0
    [00:00:00.276,840] <inf> fs_zms: data wra: 0, 0
    *** Booting nRF Connect SDK v3.4.1-b20f8619ba9a ***
    *** Using Zephyr OS v4.4.2-33fa6a7aac6a ***
    [00:00:00.277,682] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
    [00:00:00.277,695] <inf> aws_iot_sample: Bringing network interface up and connecting to the network
    [00:00:00.278,122] <inf> wifi_supplicant: wpa_supplicant initialized
    uart:~$ 
    uart:~$ wifi cred list
    uart:~$ wifi cred add -s "<ssid>" -p "<password>" -k 1
    uart:~$ wifi cred auto_connect
    [00:00:52.478,527] <inf> net_wifi_mgmt: Connection requested
    [00:00:56.380,237] <inf> wpa_supp: wlan0: SME: Trying to authenticate with f2:cd:d1:78:47:6d (SSID='Tachyon-Ravi' freq=2437 MHz)
    [00:00:56.785,531] <inf> wpa_supp: wlan0: Trying to associate with f2:cd:d1:78:47:6d (SSID='Tachyon-Ravi' freq=2437 MHz)
    [00:00:56.821,875] <wrn> net_if: iface 1 pkt 0x200517d0 send failure status -1
    [00:00:56.832,001] <inf> wpa_supp: wlan0: Associated with f2:cd:d1:78:47:6d
    [00:00:56.832,567] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
    [00:00:56.860,159] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with f2:cd:d1:78:47:6d [PTK=CCMP GTK=CCMP]
    [00:00:56.860,392] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to f2:cd:d1:78:47:6d completed [id=0 id_str=]
    Connected
    [00:00:56.909,690] <inf> net_dhcpv4: Received: 172.20.10.10
    [00:00:56.909,924] <inf> aws_iot_sample: Network connectivity established
    [00:01:01.910,018] <inf> aws_iot_sample: Connecting to AWS IoT
    [00:01:01.910,054] <dbg> aws_iot: aws_iot_connect: No hostname provided, using Kconfig value: a3sttejt5r02fo-ats.iot.us-east-1.amazonaws.com
    [00:01:01.910,073] <dbg> aws_iot: aws_iot_connect: No device ID provided, using Kconfig value: nrf54lm20dk-1
    [00:01:03.584,503] <inf> net_mqtt: Connect completed
    [00:01:03.881,843] <dbg> aws_iot: on_connack: MQTT client connected!
    [00:01:03.881,864] <dbg> aws_iot: subscribe: Subscribing to topic: my-custom-topic/example
    [00:01:03.881,880] <dbg> aws_iot: subscribe: Subscribing to topic: my-custom-topic/example_2
    [00:01:03.882,635] <dbg> aws_iot: subscribe: Subscribing to topic: $aws/things/nrf54lm20dk-1/shadow/get/accepted
    [00:01:03.882,659] <dbg> aws_iot: subscribe: Subscribing to topic: $aws/things/nrf54lm20dk-1/shadow/get/rejected
    [00:01:03.882,680] <dbg> aws_iot: subscribe: Subscribing to topic: $aws/things/nrf54lm20dk-1/shadow/update/delta
    [00:01:04.086,814] <dbg> aws_iot: on_suback: Received ACK for subscribe message: id = 2469 result = 0
    [00:01:04.370,501] <dbg> aws_iot: on_suback: Received ACK for subscribe message: id = 1984 result = 0
    [00:01:04.370,519] <dbg> aws_iot: aws_iot_send: Using message ID 1
    [00:01:04.370,559] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/get
    [00:01:04.372,333] <dbg> aws_iot: device_shadow_document_request: Device shadow document requested
    [00:01:04.372,389] <inf> aws_iot_sample: AWS_IOT_EVT_CONNECTED
    [00:01:04.372,819] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":64372,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:01:04.372,833] <dbg> aws_iot: aws_iot_send: Using message ID 2
    [00:01:04.372,856] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/update
    [00:01:04.544,578] <dbg> aws_iot: on_publish: Received message: topic = $aws/things/nrf54lm20dk-1/shadow/get/accepted and len = 198 
    [00:01:04.544,601] <inf> aws_iot_sample: AWS_IOT_EVT_DATA_RECEIVED
    [00:01:04.544,652] <inf> aws_iot_sample: Received message: "{"state":{"reported":{"uptime":662647,"app_version":"v1.0.0"}},"metadata":{"reported":{"uptime":{"timestamp":1793236570},"app_version":{"timestamp":1793236570}}},"version":32,"timestamp":1793236682}" on topic: "$aws/things/nrf54lm20dk-1/shadow/get/accepted"
    uart:~$ 
    uart:~$ 
    [00:02:04.373,626] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":124373,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:02:04.373,651] <dbg> aws_iot: aws_iot_send: Using message ID 3
    [00:02:04.373,672] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/update
    [00:02:37.171,966] <dbg> aws_iot: on_publish: Received message: topic = my-custom-topic/example and len = 45 
    [00:02:37.171,999] <inf> aws_iot_sample: AWS_IOT_EVT_DATA_RECEIVED
    [00:02:37.172,053] <inf> aws_iot_sample: Received message: "{
                                                                   "message": "Hello from AWS IoT console"
                                                                                                          }" on topic: "my-custom-topic/example"
    uart:~$ 
    uart:~$ 
    [00:03:04.374,628] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":184374,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:03:04.374,654] <dbg> aws_iot: aws_iot_send: Using message ID 4
    [00:03:04.374,675] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/update
    [00:03:04.693,561] <dbg> aws_iot: on_publish: Received message: topic = my-custom-topic/example_2 and len = 63 
    [00:03:04.693,586] <inf> aws_iot_sample: AWS_IOT_EVT_DATA_RECEIVED
    [00:03:04.693,637] <inf> aws_iot_sample: Received message: "{
                                                                   "message": "Hello from nRF54LM20DK-nRF70 AWS IoT console"
                                                                                                                            }" on topic: "my-custom-topic/example_2"
    uart:~$ 
    [00:04:04.375,626] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":244375,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:04:04.375,651] <dbg> aws_iot: aws_iot_send: Using message ID 5
    [00:04:04.375,672] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/update
    [00:05:04.376,617] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":304376,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:05:04.376,643] <dbg> aws_iot: aws_iot_send: Using message ID 6
    
    
    I do get the following warning. I'm not sure why but the AWS IOT connection is stable, and I'm able view shadow updates in AWS IoT and publish to the nRF54LM20DK.

    [00:00:56.821,875] <wrn> net_if: iface 1 pkt 0x200517d0 send failure status -1

    Any idea as to why the above warning occurs? Thanks.

    I would like to build a non-secure version (_ns) version, although I understand that it is still at an experimental stage. Do you have "nrf54lm20dk_nrf54lm20b_cpuapp_ns" .conf & .overlay files that I can try? Thank you.


    Kind Regards,
    Ravi

  • Hi Ravi,

     

    I am glad that you got it running now.

    I am sorry, but we do not have /ns support for this sample, but you can check out azure_iot_hub and nrf_cloud, which has LM20 non-secure + nrf7002 support:

    https://github.com/nrfconnect/sdk-nrf/blob/main/samples/net/azure_iot_hub/sample.yaml#L117-L122

    https://github.com/nrfconnect/sdk-nrf/blob/main/samples/wifi/nrf_cloud/sample.yaml#L66-L74

     

    Kind regards,

    Håkon

  • Hi Håkon,

    I was able to build a non-secure build and connect a nRF54LM20DK to AWS IoT.

    [INF] Pins have been configured as secure.
    [INF] GPIO port: 0x00000000
    [INF] Pin: 0x00000000
    [INF] Pin: 0x00000001
    [NOT] Booting TF-M v2.3.1**
    [NOT] Built Fri 30 Oct 2026 02:45:41 UTC
    
    [00:00:00.010,460] <inf> wifi_nrf_bus: SPIM spi@c8000: freq = 8 MHz
    [00:00:00.010,479] <inf> wifi_nrf_bus: SPIM spi@c8000: latency = 0
    *** Booting nRF Connect SDK v3.4.1-b20f8619ba9a ***
    *** Using Zephyr OS v4.4.2-33fa6a7aac6a ***
    [00:00:00.289,866] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
    [00:00:00.289,880] <inf> aws_iot_sample: Bringing network interface up and connecting to the network
    [00:00:00.290,321] <inf> wifi_supplicant: wpa_supplicant initialized
    uart:~$ 
    uart:~$ wifi cred add -s "<ssid>" -p "<passwd>" -k 1
    uart:~$ wifi cred auto_connect
    Connected
    [00:01:05.008,659] <inf> aws_iot_sample: Network connectivity established
    [00:01:10.008,772] <inf> aws_iot_sample: Connecting to AWS IoT
    [00:01:10.008,807] <dbg> aws_iot: aws_iot_connect: No hostname provided, using Kconfig value: a3sttejt5r02fo-ats.iot.us-east-1.amazonaws.com
    [00:01:10.008,826] <dbg> aws_iot: aws_iot_connect: No device ID provided, using Kconfig value: nrf54lm20dk-1
    [00:01:14.438,294] <dbg> aws_iot: on_connack: MQTT client connected!
    [00:01:14.438,323] <dbg> aws_iot: subscribe: Subscribing to topic: my-custom-topic/example
    [00:01:14.438,337] <dbg> aws_iot: subscribe: Subscribing to topic: my-custom-topic/example_2
    [00:01:14.439,036] <dbg> aws_iot: subscribe: Subscribing to topic: $aws/things/nrf54lm20dk-1/shadow/get/accepted
    [00:01:14.439,057] <dbg> aws_iot: subscribe: Subscribing to topic: $aws/things/nrf54lm20dk-1/shadow/get/rejected
    [00:01:14.439,077] <dbg> aws_iot: subscribe: Subscribing to topic: $aws/things/nrf54lm20dk-1/shadow/update/delta
    [00:01:14.522,975] <dbg> aws_iot: on_suback: Received ACK for subscribe message: id = 2469 result = 0
    [00:01:14.596,780] <dbg> aws_iot: on_suback: Received ACK for subscribe message: id = 1984 result = 0
    [00:01:14.596,797] <dbg> aws_iot: aws_iot_send: Using message ID 1
    [00:01:14.596,819] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/get
    [00:01:14.598,093] <dbg> aws_iot: device_shadow_document_request: Device shadow document requested
    [00:01:14.598,146] <inf> aws_iot_sample: AWS_IOT_EVT_CONNECTED
    [00:01:14.598,701] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":74598,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:01:14.598,714] <dbg> aws_iot: aws_iot_send: Using message ID 2
    [00:01:14.598,733] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/update
    [00:01:14.754,948] <dbg> aws_iot: on_publish: Received message: topic = $aws/things/nrf54lm20dk-1/shadow/get/accepted and len = 199 
    [00:01:14.754,970] <inf> aws_iot_sample: AWS_IOT_EVT_DATA_RECEIVED
    [00:01:14.755,042] <inf> aws_iot_sample: Received message: "{"state":{"reported":{"uptime":443929,"app_version":"v1.0.0"}},"metadata":{"reported":{"uptime":{"timestamp":1793329055},"app_version":{"timestamp":1793329055}}},"version":108,"timestamp":1793329243}" on topic: "$aws/things/nrf54lm20dk-1/shadow/get/accepted"
    [00:02:12.505,586] <dbg> aws_iot: on_publish: Received message: topic = my-custom-topic/example and len = 78 
    [00:02:12.505,617] <inf> aws_iot_sample: AWS_IOT_EVT_DATA_RECEIVED
    [00:02:12.505,666] <inf> aws_iot_sample: Received message: "{
                                                                   "message": "Hello from nrf54lm20dk_nrf54lm20b_cpuapp_ns AWS IoT console"
                                                                                                                                           }" on topic: "my-custom-topic/example"
    [00:02:14.599,633] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":134599,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:02:14.599,658] <dbg> aws_iot: aws_iot_send: Using message ID 3
    [00:02:14.599,677] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/update
    uart:~$ 
    [00:03:14.600,718] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":194600,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:03:14.600,742] <dbg> aws_iot: aws_iot_send: Using message ID 4
    [00:03:14.600,761] <dbg> aws_iot: aws_iot_send: Publishing to topic: $aws/things/nrf54lm20dk-1/shadow/update
    [00:04:14.601,782] <inf> aws_iot_sample: Publishing message: {"state":{"reported":{"uptime":254601,"app_version":"v1.0.0"}}} to AWS IoT shadow
    [00:04:14.601,806] <dbg> aws_iot: aws_iot_send: Using message ID 5
    

    I'll close the ticket. Thank you.


    Kind regards,
    Ravi

Related