Buffer allocation failure on aws_iot_connect

Board: nRF7002DK

I extended the WiFi proviosing example of nRF7002 and added the aws part from aws_iot example. WiFi connection and IP allocation along with DNS resolution all working fine.
But during the TLS handshake there is buffer allocation failure resulting in TLS handshake failure. I am not able to find the exact root cause for this failure. 
Can anyone help me out to find what need to be fixed?


Following are the error codes I am facing
00> [00:00:16.697,143] <dbg> aws_iot: broker_init: IPv4 Address found 52.57.145.200
00> [00:00:16.697,296] <dbg> net_mqtt_sock_tls: mqtt_client_tls_connect: (0x2000bb20): Created socket 7
00> [00:00:17.098,937] <err> net_pkt: Data buffer (68) allocation failed.
00> [00:00:17.099,029] <err> net_sock_tls: TLS handshake error: -4e
00> [00:00:17.101,257] <err> aws_iot: mqtt_connect, error: -113
00> [00:00:17.101,257] <err> aws_iot: AWS broker connect failed -113

Following are the memory configs I have in my project

# Memories
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096
CONFIG_NET_MGMT_EVENT_STACK_SIZE=8192
CONFIG_NET_TCP_WORKQ_STACK_SIZE=4096
CONFIG_NET_BUF_RX_COUNT=10
CONFIG_NET_BUF_TX_COUNT=10
CONFIG_NET_BUF_DATA_SIZE=128
CONFIG_HEAP_MEM_POOL_SIZE=153600
CONFIG_NET_TC_TX_COUNT=2
CONFIG_NET_PKT_RX_COUNT=20
CONFIG_NET_PKT_TX_COUNT=20
Parents Reply
  • Setting the values as in shell example cause the RAM to overflow.
    I had to update the configs as below to resolve the overflow.  But still I am facing the issue shown below.

    CONFIG_NET_PKT_RX_COUNT=32
    CONFIG_NET_PKT_TX_COUNT=40
    CONFIG_NET_BUF_RX_COUNT=32
    CONFIG_NET_BUF_TX_COUNT=73
    CONFIG_NET_BUF_DATA_SIZE=1100
    CONFIG_HEAP_MEM_POOL_SIZE=140000


    LOGS:
    00> [00:00:21.477,966] <dbg> aws_iot: broker_init: IPv4 Address found 18.194.49.107
    00> [00:00:21.478,088] <dbg> net_mqtt_sock_tls: mqtt_client_tls_connect: (0x2000b860): Created socket 7
    00> [00:00:21.672,210] <err> aws_iot: mqtt_connect, error: -12


    Error Code:
    #define  ENOMEM 12   /* Not enough space */

Children
No Data
Related