Skip to content

ESP32P4/C6 WiFi init doesn't work SDIO fail #11404

Closed
@smily77

Description

@smily77

Board

ESP32P4/C6

Device Description

M5Stack Tab5

Hardware Configuration

ESP32-P4 | G11 | G10 | G9 | G8 | G13 | G12

ESP32-C6 | SDIO2_D0 | SDIO2_D1 | SDIO2_D2 | SDIO2_D3 | SDIO2_CMD | SDIO2_CK

Version

v3.2.0

IDE Name

Arduino IDE 2.3.6

Operating System

Windows11

Flash frequency

80Mhz

PSRAM enabled

yes

Upload speed

921600

Description

When the board should initialize the WiFi it crashes

Sketch

#include <M5Unified.h>
#include <WiFi.h>


const char* ssid     = "xxx";
const char* password = "yyy";

void setup() {
  Serial.begin(115200);
  auto cfg = M5.config();
  M5.begin(cfg);          

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(200);
    Serial.print(".");
  }
 }

void loop() {
  // ...
}

Debug Message

ESP-ROM:esp32p4-eco2-20240710
sdio_mempool_create free:32254544 min-free:32254544 lfb-def:31457268 lfb-8bit:31457268

E (1736) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (1736) sdio_wrapper: sdmmc_card_init failed
E (4386) H_SDIO_DRV: sdio card init failed

FreeRTOS: FreeRTOS Task "sdio_read" should not return, Aborting now!

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Activity

lbernstone

lbernstone commented on May 27, 2025

@lbernstone
Contributor

We can't really troubleshoot the M5 stack here, but ESP32-P4 does not have WiFi.

me-no-dev

me-no-dev commented on May 28, 2025

@me-no-dev
Member

When we get the Tab5, we will have a look and add support. Currently only specific pin combination is supported on the Espressif P4 board https://github.com/espressif/arduino-esp32/blob/master/variants/esp32p4/pins_arduino.h#L75-L83

nikthefix

nikthefix commented on May 30, 2025

@nikthefix

@smily77 Did you try the new M5Stack boards package 3.2.0
(Additional Boards URL: https://static-cdn.m5stack.com/resource/arduino/package_m5stack_index.json)
There is now a Tab5 board option which should remap the SDIO -> C6 pins which are not the same as the Espressif dev kit / Waveshare defaults.

smily77

smily77 commented on May 30, 2025

@smily77
Author

@nikthefix yes i did. Unfortunatly same result

nikthefix

nikthefix commented on May 30, 2025

@nikthefix

@smily77 I just tried it too with the same result.
Looking at the schematics of Tab5 vs Waveshare P4-Nano (which works fine with the C6 wifi) we can see that in the Tab5 the SDIO pins are different AND they are connected to the SDIO2 bus. Looking at:

".......\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32p4\include\espressif__esp_hosted\host\port\esp_hosted_config.h"

we can set the SDIO pins here but I tried it and it looks like more is required. The supplied Tab5 demo manages it so I guess it's a matter of trolling thru their rather convoluted IDF code to find the key ... until M5Stack update their Arduino board definition.
If the Core only supports the fixed P4 dev board SDIO C6 definitions then I guess we're out of luck for the time being.
I'll work on this today.
Please let me know if you find anything too.

BTW, I'm assuming that the C6 on both these boards is flashed with the same firmware. Hope so as I've only got my working P4-Nano to go by.

cheops

cheops commented on Jun 19, 2025

@cheops

did you find a way to specify the different pins?
I tried with build variables and defines

#define BOARD_SDIO_ESP_HOSTED_xxx 18

also found these

CONFIG_ESP_SDIO_PIN_xxx

but no luck so far

nikthefix

nikthefix commented on Jun 20, 2025

@nikthefix

@cheops No I've not found a simple solution so far.
I think recompiling the relevant Arduino libs using the Espressif Library Builder is an interim solution.

Jason2866

Jason2866 commented on Jun 23, 2025

@Jason2866
Collaborator

The SDIO GPIOs for Hosted communication are set in sdkconfig. So the are hard coded and can't be changed in Arduino. Currently there is only the solution to compile Arduino as an component of IDF or use pioarduino HybridCompile where sdkconfig settings can be changed.
The Arduino libs are compiled with the changed settings and provided to Arduino. HybridCompile is a pioarduino only feature.

me-no-dev

me-no-dev commented on Jun 23, 2025

@me-no-dev
Member

This is almost true. In 3.2.x only SDIO pins can be defined (not the RST pin), in 3.3.x all pins will be definable, even at runtime

Westcott1

Westcott1 commented on Jun 23, 2025

@Westcott1

I've just got my new esp32P4+C6 10.1" panel, so am really interested in how to get WiFi working via Arduino.
The demo that came installed had a working WiFi scanner, and Waveshare have published working ESP-IDF code.

me-no-dev

me-no-dev commented on Jun 24, 2025

@me-no-dev
Member

Fix is coming: #11513

WiFi.setPins(clk, cmd, d0, d1, d2, d3, rst);
WiFi.begin(ssid, pass);
smily77

smily77 commented on Jun 24, 2025

@smily77
Author

@me-no-dev
Looks promising, but will this work with SDIO2 as well? As the M5Stack Tab 5 uses SDIO2.

me-no-dev

me-no-dev commented on Jun 24, 2025

@me-no-dev
Member

Looks promising, but will this work with SDIO2 as well? As the M5Stack Tab 5 uses SDIO2.

It is set to use SDIO2 by default

12 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @felmue@smily77@cheops@me-no-dev@lbernstone

      Issue actions

        ESP32P4/C6 WiFi init doesn't work SDIO fail · Issue #11404 · espressif/arduino-esp32