Skip to content

Conversation

@P-R-O-C-H-Y
Copy link
Member

Description of Change

This pull request updates the SDMMC slot configuration for ESP32P4 boards to improve compatibility with ESP-IDF's pin checking logic. Instead of using GPIO_NUM_NC (-1), the code now sets all SDMMC pins to GPIO_NUM_0 (0), which works correctly with the ESP-IDF's s_check_pin_not_set() function.

Hardware compatibility fix:

  • In SD_MMC.cpp, the SDMMC slot configuration for ESP32P4 boards now sets all pins (clk, cmd, d0d7) to GPIO_NUM_0 instead of GPIO_NUM_NC, ensuring proper operation with ESP-IDF's pin validation logic.

Test Scenarios

Tested using P4 and SDMMC example.

Related links

Closes #11995

@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Nov 7, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y requested a review from a team as a code owner November 7, 2025 08:56
@P-R-O-C-H-Y P-R-O-C-H-Y added Type: Bug 🐛 All bugs Area: Libraries Issue is related to Library support. Status: Review needed Issue or PR is awaiting review labels Nov 7, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y requested a review from me-no-dev November 7, 2025 08:56
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 4868262

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32P4000.000.00000.000.00
ESP32S3000.000.00000.000.00
ESP32000.000.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32P4ESP32S3ESP32
ExampleFLASHRAMFLASHRAMFLASHRAM
libraries/ESP_I2S/examples/Record_to_WAV000000
libraries/SD_MMC/examples/SD2USBMSC0000--
libraries/SD_MMC/examples/SDMMC_Test000000
libraries/SD_MMC/examples/SDMMC_time000000

Copy link
Collaborator

@SuGlider SuGlider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

Test Results

 76 files   76 suites   16m 38s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit 4868262.

♻️ This comment has been updated with latest results.

.d5 = GPIO_NUM_0,
.d6 = GPIO_NUM_0,
.d7 = GPIO_NUM_0,
.cd = SDMMC_SLOT_NO_CD,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you report this to IDF team, as it seems this is not the proper way things should be. There is no reason why IO0 can't be used

@me-no-dev me-no-dev added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Nov 7, 2025
@me-no-dev me-no-dev merged commit 420adce into master Nov 7, 2025
76 of 78 checks passed
@me-no-dev me-no-dev deleted the bugfix/sdmmc-p4 branch November 7, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Libraries Issue is related to Library support. Status: Pending Merge Pull Request is ready to be merged Type: Bug 🐛 All bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SD_MMC Initialization Error when using v3.3.3

4 participants