Skip to content

Waveshare ESP32-P4 Smart 86 Box Development Board: wifi issues between P4 & C6 using esp32_hosted #10956

Description

@DSew20

The problem

I’m trying to use ESPHome on an ESP32-P4 host with an ESP32-C6 co-processor over SDIO via the esp32_hosted integration to provide Wi-Fi. The node boots, the SDIO link appears to initialize, but Wi-Fi association is unstable and usually fails. Typical behavior:

Shortly after starting Wi-Fi, the log prints ESP-Hosted SDIO errors like:

  • H_SDIO_DRV: Dropping packet(s) from stream
  • H_SDIO_DRV: Failed to push data to rx queue

Then the connection attempt times out, followed by:

  • Disconnected ... reason='Association Leave'
  • wifi: Restarting adapter

This loops repeatedly. In some runs I also see:

  • assert failed: netif_add ... (netif already added) during Wi-Fi re-init
  • occasional Guru Meditation / Instruction access fault during early setup

If I comment out the wifi: block, the device runs stably (no reboots/panics), which points to the Wi-Fi path (hosted/SDIO) as the trigger.

What I expected: the P4 should associate/authenticate via the C6 and obtain an IP (DHCP or static) and remain connected.

What happens instead: repeated association failures/timeouts, SDIO RX drops, and occasional asserts/panics when the adapter restarts.

Which version of ESPHome has the issue?

2025.9.1 & 2025.9.2

What type of installation are you using?

Home Assistant Add-on

What platform are you using?

ESP32

Component causing the issue

esp32_hosted, wifi, esp32

YAML Config

# base YAML #
esphome:
  name: p4-hosted-wifi-test
  friendly_name: P4 Hosted WiFi Test

esp32:
  board: esp32-p4-evboard
  framework:
    type: esp-idf

logger:
  level: DEBUG
  hardware_uart: UART0

api:

ota:
  - platform: esphome
    

# ESP32-C6 co-processor over SDIO
esp32_hosted:
  variant: ESP32C6
  reset_pin: GPIO54
  active_high: false
  clk_pin: GPIO18
  cmd_pin: GPIO19
  d0_pin: GPIO14
  d1_pin: GPIO15
  d2_pin: GPIO16
  d3_pin: GPIO17
  # slot: 1 - tried slot: 0 too

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: NONE

Anything in the logs that might be useful for us?

[17:39:32]ESP-ROM:esp32p4-eco2-20240710
[17:39:32]Build:Jul 10 2024
[17:39:32]rst:0xc (SW_CPU_RESET),boot:0x30f (SPI_FAST_FLASH_BOOT)
[17:39:32]Core0 Saved PC:0x4ff03f56
[17:39:32]Core1 Saved PC:0x4ff01ba8
[17:39:32]SPI mode:DIO, clock div:1
[17:39:32]load:0x4ff33ce0,len:0x15f0
[17:39:32]load:0x4ff2abd0,len:0xd84
[17:39:32]load:0x4ff2cbd0,len:0x3310
[17:39:32]entry 0x4ff2abd0
[17:39:32]I (33) boot: ESP-IDF 5.4.2 2nd stage bootloader
[17:39:32]I (33) boot: compile time Sep 30 2025 17:37:29
[17:39:32]I (34) boot: Multicore bootloader
[17:39:32]I (35) boot: chip revision: v1.0
[17:39:32]I (36) boot: efuse block revision: v0.3
[17:39:32]I (40) boot.esp32p4: SPI Speed      : 80MHz
[17:39:32]I (44) boot.esp32p4: SPI Mode       : DIO
[17:39:32]I (47) boot.esp32p4: SPI Flash Size : 4MB
[17:39:32]I (51) boot: Enabling RNG early entropy source...
[17:39:32]I (56) boot: Partition Table:
[17:39:32]I (58) boot: ## Label            Usage          Type ST Offset   Length
[17:39:32]I (65) boot:  0 otadata          OTA data         01 00 00009000 00002000
[17:39:32]I (71) boot:  1 phy_init         RF data          01 01 0000b000 00001000
[17:39:32]I (78) boot:  2 app0             OTA app          00 10 00010000 001c0000
[17:39:32]I (84) boot:  3 app1             OTA app          00 11 001d0000 001c0000
[17:39:32]I (91) boot:  4 nvs              WiFi data        01 02 00390000 0006d000
[17:39:32]I (98) boot: End of partition table
[17:39:32]I (101) esp_image: segment 0: paddr=00010020 vaddr=40070020 size=26734h (157492) map
[17:39:32]I (130) esp_image: segment 1: paddr=0003675c vaddr=30100000 size=00044h (    68) load
[17:39:32]I (132) esp_image: segment 2: paddr=000367a8 vaddr=4ff00000 size=09870h ( 39024) load
[17:39:32]I (141) esp_image: segment 3: paddr=00040020 vaddr=40000020 size=63d7ch (408956) map
[17:39:32]I (200) esp_image: segment 4: paddr=000a3da4 vaddr=4ff09870 size=05394h ( 21396) load
[17:39:32]I (205) esp_image: segment 5: paddr=000a9140 vaddr=4ff0ec80 size=02350h (  9040) load
[17:39:32]I (210) boot: Loaded app from partition at offset 0x10000
[17:39:32]I (211) boot: Disabling RNG early entropy source...
[17:39:32]sdio_mempool_create free:190440 min-free:190440 lfb-def:147456 lfb-8bit:147456
[17:39:32]
[17:39:32][I][logger:165]: Log initialized
[17:39:32][C][safe_mode:084]: Unsuccessful boot attempts: 5
[17:39:32][D][esp32.preferences:143]: Writing 1 items: 0 cached, 1 written, 0 failed
[17:39:32][I][app:073]: Running through setup()
[17:39:32][C][component:163]: Setup preferences took 0ms
[17:39:34]Guru Meditation Error: Core  1 panic'ed (Instruction access fault). Exception was unhandled.
[17:39:34]
[17:39:34]Core  1 register dump:
[17:39:34]MEPC    : 0x00000000  RA      : 0x00000000  SP      : 0x4ff190a0  GP      : 0x4ff0f480  
[17:39:34]TP      : 0x4ff190c0  T0      : 0x4fc1a058  T1      : 0x20000000  T2      : 0xffffffff  
[17:39:34]S0/FP   : 0x00000000  S1      : 0x00000000  A0      : 0x00000000  A1      : 0x4ff2a408  
[17:39:34]A2      : 0x00000004  A3      : 0x00000000  A4      : 0x20800008  A5      : 0x1f000000  
[17:39:34]A6      : 0x00000000  A7      : 0x00000003  S2      : 0x00000000  S3      : 0x00000000  
[17:39:34]S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000  
[17:39:34]S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000  
[17:39:34]T3      : 0x00000000  T4      : 0x00000000  T5      : 0x00000000  T6      : 0x4002360e  
[17:39:34]MSTATUS : 0x00011880  MTVEC   : 0x4ff00003  MCAUSE  : 0x00000001  MTVAL   : 0x00000000  
[17:39:34]MHARTID : 0x00000001  
[17:39:34]
[17:39:34]Stack memory:
[17:39:34]4ff190a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:34]4ff190c0: 0x00000000 0x4ff17ce4 0x4ff17ce4 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5
[17:39:34]4ff190e0: 0xa5a5a5a5 0x00000160 0x4ff18d60 0x00000b0b 0x4ff1207c 0x4ff1207c 0x4ff190e8 0x4ff12074
[17:39:34]4ff19100: 0x00000002 0x4ff0f6ac 0x4ff0f6ac 0x4ff190e8 0x00000000 0x00000017 0x4ff17ce4 0x6f696473
[17:39:34]4ff19120: 0x6165725f 0x00000064 0x00000000 0x7fffffff 0x4ff190e0 0x00000017 0x00000000 0x4ff2a3f8
[17:39:34]4ff19140: 0x40049a3c 0x00000000 0x4ff141e0 0x4ff14248 0x4ff142b0 0x00000000 0x00000000 0x00000001
[17:39:34]4ff19160: 0x00000000 0x00000000 0x00000000 0x40045e26 0x00000000 0x00000000 0x00000000 0x00000000
[17:39:34]4ff19180: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
[17:39:34]4ff191a0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
[17:39:34]4ff191c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
[17:39:34]4ff191e0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
[17:39:34]4ff19200: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
[17:39:34]4ff19220: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x25f2b76f
[17:39:34]4ff19240: 0x24c091a5 0x4ff190e0 0x0000000c 0x4ff1a660 0x4ff13ba4 0x4ff19244 0x00001400 0xa5a5a5a5
[17:39:34]4ff19260: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:34]4ff19280: 0xa5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5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:35]4ff193e0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:35]4ff19400: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:35]4ff19420: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:35]4ff19440: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:35]4ff19460: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:35]4ff19480: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
[17:39:35]
[17:39:35]
[17:39:35]
[17:39:35]ELF file SHA256: 385693e55
[17:39:35]
[17:39:35]Rebooting...

Additional information

Steps to reproduce

  1. Hardware: ESP32-P4 dev board with ESP32-C6 connected over SDIO (CLK/CMD/D0-D3) and a dedicated reset pin.

  2. ESPHome config:

  • esp32_hosted: with variant: ESP32C6
  • SDIO pins set (CLK/CMD/D0-D3), slot: 1
  • reset pin wired to the C6 reset (on my board: GPIO24) with active low (active_high: false)
  • ESP-IDF framework (5.4.x), experimental features enabled
  • sdkconfig_options: { CONFIG_ESP_WIFI_ENABLED: "n" } to disable the P4’s internal Wi-Fi driver
  • wifi: with network credentials; tested both with and without bssid, with fast_connect: true, and power_save_mode: NONE
  1. Flash and boot.

  2. Observe logs: SDIO driver “dropping packet(s)” / “failed to push to rx queue”, then Connection timeout → Association Leave → Restarting adapter, repeating. Sometimes netif_add ... netif already added assert or a Guru Meditation.

I attach a minimal YAML and full boot/Wi-Fi logs showing these messages above.

Additional information

  • Pins / polarity: Best results so far with reset_pin: GPIO24 and active_high: false (active-low reset). Using a wrong reset pin/polarity prevents the C6 from coming up at all. With the above, the SDIO stack initializes and produces Hosted driver logs.

  • BSSID / fast connect: Tried with bssid locked to a known AP and fast_connect: true (to avoid a heavy scan). Also tried without BSSID (normal scan). Both paths still hit SDIO RX drops and end in timeout.

  • Power save: power_save_mode: NONE at all times (to avoid sleep-related handshake issues). Still seeing the problem.

  • Static IP: Tried DHCP and (in other tests) manual_ip:. The failure occurs before DHCP; association/auth appears to fail.

  • Stability check: With wifi: commented out, the device runs and logs normally (no resets), suggesting the crash/loop is tied to Wi-Fi/Hosted init.

Other symptoms seen in some builds/runs:

  • E ... esp_netif_lwip: dhcp client start failed

  • esp_task_wdt_reset(...): TWDT was never initialized (warnings only)

  • assert failed: netif_add ... (netif already added) during rapid adapter restarts

  • occasional Guru Meditation (Instruction access fault) on Core 0/1 during setup

Environment details:

  • ESP-IDF 5.4.x (platform 54.03.21)

  • PSRAM enabled (200 MHz) and LDO configured; plenty of heap available

  • Host: ESP32-P4; Co-proc: ESP32-C6 (ESP-Hosted firmware)

Hypothesis / request: The SDIO RX queue appears to overflow during association (handshake/scan), causing critical packet loss and a failed connect; subsequent rapid re-inits sometimes trigger netif_add asserts or panics. Guidance on:

  • known fixes in ESPHome 2025.9.2+ or newer ESP-Hosted blobs,

  • recommended SDIO buffer/queue tuning or SDIO clock adjustments for P4,

  • exposing a YAML/IDF knob to increase Hosted RX queue / use PSRAM for Wi-Fi buffers, would be very helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions