SD card Error #3081
Replies: 23 comments 16 replies
|
Today I connected another completely new Weact board, and it doesn’t reliably detect SD cards. In about 90 percent of cases, it doesn’t see the card, and only in 10 percent does it see it. |
|
Could you try this clock config (simply copy/paste it before setup()), note that it should also allows to use LPUART1 at 19200: |
|
I'm currently checking with a Kingston Industrial 32 GB SDCIT2/32GB SD card. |
|
This is on a different STM32H743VIT6 board with a different SD card (QUMO 16GB). |
|
Continuation... |
|
WOW!!! I’ll check it on another board now and get back to you. |
|
When the power is supplied, everything works perfectly, and the response is always “Micro SD card OK!” |
|
Debug mode: Registers before the command if (!SD.begin(SD_DETECT_PIN, HIGH)) { Registers after the command if (!SD.begin(SD_DETECT_PIN, HIGH)) SD OK Registers after the command if (!SD.begin(SD_DETECT_PIN, HIGH)) SD ERROR |
|
Hmm... |
|
To figure out the problem, I started doing step‑by‑step debugging. I’m adding debug information output to the monitor. In the command BSP_SD_Init() it returns either false or true. I will debug BSP_SD_Init() |
|
pinMode(SD_DETECT_PIN, INPUT_PULLUP) — this is indeed a solution for Weact Studio boards with an SD card connector. @fpistm — thank you very much for helping to figure out this complex problem! |
|
Hmmmmm... I'm shocked! |
|
I recorded the screen of my PC. The SD card is in the SD slot. How can this be understood???? Link to the video |
|
file bsp_sd.c I checked with an oscilloscope in the debugger, and these commands are indeed executed, and the level on PD4 becomes high. But if I don’t first execute the command pinMode(SD_DETECT_PIN, INPUT_PULLUP) in my code, the SD card is not detected!!! |
|
Tomorrow I’ll take a webcam with me and will simultaneously record video from the computer screen and video from the STM32 board. |
|
I recorded a good video showing how unstable the SD card detection is. The blue LED turns on when the card is detected. The card isn’t detected during the first 3 times it’s powered on. It also isn’t detected at the end of the video. And I press the reset button several times. https://drive.google.com/file/d/12g2QaLmTVE4JnxGThoW8Yonh7Kx2Loc5/view?usp=sharing |
|
Ok ! |
Adding this line also does not reliably detect the SD card. |
|
Adding the line pinMode(SD_DETECT_PIN, INPUT_PULLUP); at the beginning of Setup 100% identifies the card both when power is supplied and when the reset button is pressed. I made a video and will add it soon. |
|
https://drive.google.com/file/d/1slWAG9Tb-4j5Z_mOh9W3tYr8mVmHhuCz/view?usp=sharing Video with the command pinMode(SD_DETECT_PIN, INPUT_PULLUP); at the beginning of Setup(). The card is consistently detected both when the Reset button is pressed and when power is supplied. |
|
I incorrectly provided the link to the video where the microcontroller doesn’t recognize the card. Now I’ll upload the video and give you the link. |
|
I’ve corrected the video link at the top and am duplicating it in this post. https://drive.google.com/file/d/12g2QaLmTVE4JnxGThoW8Yonh7Kx2Loc5/view?usp=sharing I recorded a good video showing how unstable the SD card detection is. The blue LED turns on when the card is detected. The card isn’t detected during the first 3 times it’s powered on. It also isn’t detected at the end of the video. And I press the reset button several times. Please watch this video. |
|
To address this issue, I use several boards and SD cards. https://drive.google.com/file/d/1baGBNZEjn3nWCcZVhcuki45nJZLmoVJ1/view?usp=sharing |

Uh oh!
There was an error while loading. Please reload this page.
Hi !
Arduino IDE 2.3.10 + Windows 11
Arduino Core for STM32 3.0.0
Lib STM32SD //github.com/stm32duino/STM32SD
board STM32H743VIT6 WeAct and STM32H723VGT6 WeAct
I tested this code on several new boards with different new Micro SD cards, and it always shows an initialization error (Micro SD card Error!).
I have an oscilloscope and a debugger.
Could you tell me how to find the problem?
In what order should I proceed?
I left the most minimal code.
All reactions