The sta sample project is giving me a lot of errors, what should I do?

I am trying to run nRF7002DK, and when I connect to a WiFi network using the sta sample or the shell sample, I get a bunch of errors.
net_pkt: Data buffer (xxx) allocation failed

Someone asked the same question on DevZone, so I tried doubling the CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE as described there, but the error keeps occurring.
https://devzone.nordicsemi.com/f/nordic-q-a/97812/net_pkt-data-buffer-42-allocation-failed
How do I fix this?
Also, I don't know if this is related, but TCP socket communication doesn't work at all. where can I find samples of TCP and UDP communication?

Parents
  • Hi Yoshihiro,
    Could you share your prj.conf configuration so I might see if any configurations are missing!!

    Regards

    Lalith RJ

  • Hi,

    My prj.conf is the below. This project is an original project with necessary parts extracted from sta and shell.

    CONFIG_WIFI=y
    CONFIG_NET_L2_ETHERNET=y
    CONFIG_NET_IPV6=n
    CONFIG_HEAP_MEM_POOL_SIZE=163840
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_NET_PKT_RX_COUNT=8
    CONFIG_NET_PKT_TX_COUNT=8
    CONFIG_DK_LIBRARY=y
    CONFIG_WIFI_NRF700X=y
    CONFIG_NET_MGMT_EVENT_STACK_SIZE=2048
    CONFIG_WPA_SUPP=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048
    CONFIG_DEBUG_THREAD_INFO=y
    CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100
    CONFIG_NETWORKING=y
    CONFIG_NET_IPV4=y
    CONFIG_NET_DHCPV4=y
    CONFIG_NET_TCP=y
    CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048
    CONFIG_NET_MAX_CONTEXTS=2
    CONFIG_NET_BUF_RX_COUNT=8
    CONFIG_NET_BUF_TX_COUNT=8
    CONFIG_NET_TX_STACK_SIZE=8192
    CONFIG_NET_RX_STACK_SIZE=8192
    CONFIG_NET_LOG=y
    CONFIG_NET_CONN_LOG_LEVEL_INF=y
    CONFIG_NET_CONFIG_SETTINGS=y
    CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.254.0"
    CONFIG_NET_CONFIG_MY_IPV4_GW="10.0.4.1"
    CONFIG_NET_SOCKETS=y
    CONFIG_DEBUG_OPTIMIZATIONS=y
    

  • Errors continue to occur, but I think that is enough information, so I will stop at this point.

    [00:04:34.790,771] <err> net_pkt: Data buffer (1116) allocation failed.
    [00:04:34.790,802] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:04:34.891,418] <err> net_pkt: Data buffer (1136) allocation failed.
    [00:04:34.891,448] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:10:02.492,950] <err> net_pkt: Data buffer (1140) allocation failed.
    [00:10:02.492,980] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:10:02.593,475] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:02.593,505] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:10:02.697,753] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:02.697,784] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:10:02.901,031] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:02.901,062] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:10:03.001,678] <err> net_pkt: Data buffer (1140) allocation failed.
    [00:10:03.001,708] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:10:03.717,620] <err> net_pkt: Data buffer (1140) allocation failed.
    [00:10:03.717,651] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:10:03.818,145] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:03.818,176] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:10:05.405,548] <err> net_pkt: Data buffer (1140) allocation failed.
    [00:10:05.405,578] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:10:05.506,134] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:05.506,164] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:10:05.609,649] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:05.609,680] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:10:05.713,043] <err> net_pkt: Data buffer (1140) allocation failed.
    [00:10:05.713,073] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:10:05.813,537] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:05.813,568] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:10:06.184,143] <err> net_pkt: Data buffer (1140) allocation failed.
    [00:10:06.184,173] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:10:06.284,667] <err> net_pkt: Data buffer (1103) allocation failed.
    [00:10:06.284,698] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:10:06.403,625] <err> net_pkt: Data buffer (1140) allocation failed.
    [00:10:06.403,656] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:10:22.576,934] <err> net_pkt: Data buffer (1430) allocation failed.
    [00:10:22.576,965] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:10:22.677,703] <err> net_pkt: Data buffer (1450) allocation failed.
    [00:10:22.677,734] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:11:46.992,004] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:46.992,034] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:11:47.092,498] <err> net_pkt: Data buffer (1104) allocation failed.
    [00:11:47.092,529] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:11:47.365,203] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:47.365,234] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:11:47.515,136] <err> net_pkt: Data buffer (1104) allocation failed.
    [00:11:47.515,167] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:11:47.782,409] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:47.782,440] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:11:47.913,482] <err> net_pkt: Data buffer (1104) allocation failed.
    [00:11:47.913,513] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:11:48.215,179] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:48.215,209] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:11:53.124,664] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:53.124,694] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:11:53.225,158] <err> net_pkt: Data buffer (1104) allocation failed.
    [00:11:53.225,189] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:11:53.544,952] <err> net_pkt: Data buffer (1104) allocation failed.
    [00:11:53.544,982] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:11:53.645,629] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:53.645,660] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    [00:11:53.916,870] <err> net_pkt: Data buffer (1104) allocation failed.
    [00:11:53.916,900] <wrn> net_conn: pkt cloning failed, pkt 0x20034dac dropped
    [00:11:54.017,517] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:54.017,547] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:11:54.317,291] <err> net_pkt: Data buffer (1104) allocation failed.
    [00:11:54.317,321] <wrn> net_conn: pkt cloning failed, pkt 0x20034d68 dropped
    [00:11:54.417,938] <err> net_pkt: Data buffer (1141) allocation failed.
    [00:11:54.417,968] <wrn> net_conn: pkt cloning failed, pkt 0x20034df0 dropped
    

  • Hi,

    Yoshihiro Goto said:
    The problem is that after a while of connecting, errors occur frequently. Of course I have not done anything other than connecting.

    How often do you see this error? Does it happen regularly or intermittently? Can you reproduce the error each time after you connect?

    Best regards,
    Dejan

  • Hi,

    How often do you see this error? Does it happen regularly or intermittently? Can you reproduce the error each time after you connect?

    Whenever I connect to my WiFi router, I get an error. Sometimes the error occurs immediately, sometimes after a few minutes.

    Best Regards,

    Yoshihiro Goto

  • Hi,

    Have you tried with another wi-fi router to check if you can reproduce this issue?

    Best regards,
    Dejan

  • Hi,

    Okay, I've connected to the building's shared WiFi. No errors show up at all after connecting. So does that mean that error is a WiFi packet collision error?

Reply Children
Related