Memory allocation failures on nRF5340 + nRF7002

Hi,

I'm working on an nRF5340 + nRF7002 project using Zephyr RTOS, where the device enters low-power sleep and wakes up on a hardware counter alarm (counter_set_channel_alarm()). The wake-up flow initializes data collection, sensor reading, and reconnects Wi-Fi to upload data.

The initial wake-up and data flow works well — the alarm triggers, Wi-Fi reconnects successfully, and sensors initialize correctly. However, after a short time (around 1–2 minutes), I start seeing these repeated warnings and errors:

php-template
CopyEdit
<wrn> net_conn: pkt cloning failed, pkt 0x2006269c dropped
<err> net_pkt: Data buffer (526) allocation failed.
<inf> nrf7002_wifi: DNS resolution failed, Wi-Fi might be down.
<inf> nrf7002_wifi: NET_EVENT_WIFI_DISCONNECT_RESULT

Eventually, Wi-Fi disconnects entirely. I suspect this may be due to packet buffer exhaustion (net_pkt / net_buf) or improper memory cleanup.

Gear️ System Details:

  • nRF Connect SDK version: V2.6.2

  • Board: nRF5340 DK + nRF7002 EK

  • Features: Wi-Fi STA mode, NVS storage, custom sensor drivers, counter-based alarm wake-up

  • Power Mode: k_cpu_idle

  • Alarm Set With: counter_set_channel_alarm()

Question Questions:

  1. What might be causing the net_pkt buffer exhaustion — are there known leaks or missing unrefs in the Wi-Fi subsystem?

  2. Are there recommended CONFIG_NET_PKT_* or CONFIG_NET_BUF_* settings for nRF7002 with moderate periodic Wi-Fi usage?

  3. How can I profile or debug net_pkt allocation usage more effectively post-wake-up?

    proj config file for ur reference
     3884.prj.conf

Parents Reply Children
No Data
Related