Skip to content

Issue: ESP32-P4 (M5Stack Tab5) BLE Initialization Fails Even With SD Card Present #12324

@RamyaManjunath003

Description

@RamyaManjunath003

Board

M5Tab5

Device Description

  • Board: M5Stack Tab5 (ESP32-P4 chip) with SD card inserted
  • ESP32 Arduino Package: 3.3.3
  • Arduino CLI Version: 1.4.1
  • Operating System: Ubuntu 22.04 (VirtualBox)
  • Sketch: BLE Server example (examples/Server/Server.ino)

Hardware Configuration

//WIFI - ESP32C6
#define BOARD_HAS_SDIO_ESP_HOSTED
#define BOARD_SDIO_ESP_HOSTED_CLK 12
#define BOARD_SDIO_ESP_HOSTED_CMD 13
#define BOARD_SDIO_ESP_HOSTED_D0 11
#define BOARD_SDIO_ESP_HOSTED_D1 10
#define BOARD_SDIO_ESP_HOSTED_D2 9
#define BOARD_SDIO_ESP_HOSTED_D3 8
#define BOARD_SDIO_ESP_HOSTED_RESET 15

Used default pins_arduino.h provided in /.arduino15/packages/esp32/hardware/esp32/3.3.3/variants/m5stack_tab5. PFA (Converted to text file)
pins_arduino.txt

Version

v3.3.3

Type

Question

IDE Name

Arduino-CLI

Operating System

Ubuntu Linux using VirtualBox

Flash frequency

40MHz

PSRAM enabled

yes

Upload speed

921600

Description

BLE Server example compiles and uploads successfully to M5Stack Tab5 (ESP32-P4), but crashes during BLE initialization with SD card initialization errors, even when an SD card is inserted.

Note: Also tried with UploadSpeed 115200, same behavior.

Problem Summary

  • Compilation succeeds without errors
  • Upload completes successfully
  • SD card is physically present in Tab5
  • SD card initialization fails (sdmmc_card_init failed)
  • BLE transport fails due to SDIO dependency
  • Board crashes on startup

PFA: crash_dump.txt

Expected Behavior

BLE initialization should be successful without any crash just like #11788. Please point out if I need to change any settings for this to work.

Sketch

libraries/BLE/examples/Server/Server.ino
libraries/SimpleBLE/examples/SimpleBleDevice/SimpleBleDevice.ino

Debug Message

$ arduino-cli monitor -p /dev/ttyACM0 -c baudrate=115200,dtr=off,rts=off
Monitor port settings:
  baudrate=115200
  bits=8
  dtr=off
  parity=none
  rts=off
  stop_bits=1

Connecting to /dev/ttyACM0. Press CTRL-C to exit.
Starting BLE work!
E (1585) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (1586) sdio_wrapper: sdmmc_card_init failed
[Repeated multiple times...]
E (3377) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (3378) sdio_wrapper: sdmmc_card_init failed
E (3478) H_SDIO_DRV: card init failed
E (3478) transport: ensure_slave_bus_ready failed
 failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40033b3c
file: "./managed_components/espressif__esp_hosted/host/drivers/bt/vhci_drv.c" line 143
func: ble_transport_ll_init
expression: transport_drv_reconfigure()

Other Steps to Reproduce

$ arduino-cli core install esp32:esp32@3.3.3
$ export BOARD=esp32:esp32:m5stack_tab5:PartitionScheme=no_fs,CDCOnBoot=cdc,USBMode=hwcdc,PSRAM=enabled
$ cd ~/.arduino15/packages/esp32/hardware/esp32/3.3.3/libraries/BLE/examples/Server
$ arduino-cli compile --fqbn esp32:esp32:m5stack_tab5 --verbose Server.ino
$ arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:m5stack_tab5
$ arduino-cli monitor -p /dev/ttyACM0 -c baudrate=115200,dtr=off,rts=off

Attached the board config file for reference.

boards.txt

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

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions