-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SD Card power usage in deep sleep (or when idle) #2958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Dear ducalex, i encountered the same problems, the sd card draws too much current. I am looking for a solution for a long time, so i wonder if your fix works. Were did you add the line I couldn't apply your fix, the card is still draining my poor battery. Maybe you are reading this after a year... Best wishes from Berlin! |
Put it at line 651 before the ff_diskio_register call. Let me know if this works and I will submit a PR. |
Yes!! Thanks for your reply and best regarts from Berlin. |
I wonder if this is valid/fixed for SD_MMC also? So if you call SD_MMC.end() the SD card goes to idle state and save power? |
Hardware:
Board: Lolin32
Core Installation version: ESP-IDF: v3.3-beta3-103-ga9d266b92, Arduino as a component: 7d78247
IDE name: VS Code
Flash Frequency: 40Mhz
PSRAM enabled: no
Upload Speed: 15200
Computer OS: Windows 8.1
Description:
When I use the SD library and then go into deep sleep the SD Card uses an absurd amount of power (10-12mA). This does not occur if I use esp_vfs_fat_sdmmc_mount instead of the SD library even if I do not uninitialize it before sleeping.
I've investigated and the IO pins are freed correctlty (although card->ssPin isn't done explicitely). So the SD Card must be left in a weird state because of a wrong or incomplete command in the driver.
I fixed my problem by adding:
sdTransaction(pdrv, GO_IDLE_STATE, 0, NULL);
insdcard_uninit
But the real problem is probably elsewhere.
Sketch: (leave the backquotes for code formatting)
Debug Messages:
The text was updated successfully, but these errors were encountered: