Is there any way to initialize the SD card interface without a SD card being present?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-01 8:12 PM
The HAL SD Card initialization routines queries the uSD Card for various pieces of information
in the initialization routine. If a uSD card not present, the initialization fails. Further, this means that it is not possible to remove and replace the uSD card once the device has started running.
I'm using a STM32F429 device. Is anybody aware of a workaround for this limitation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-01 8:22 PM
Initialization of an SD card requires it to be present in order to communicate with the device in order to read and set various parameters such as card size, clock speed, and number of data lines. Thus, it cannot be done if a card is not present.
If a card is removed a reinserted, the initialization needs repeated with the new card.
You could write code to do initialization only when a card is inserted, but if you're using the CubeMX generator, you must live within its limitations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-01 8:35 PM
The uSD/SD cards were designed to be removable media. The way the HAL initialization routines were implemented, this capability is destroyed. I'm sure I'm not the first person to run up against this limitation. I am hoping that someone has written a set of routines this separates the driver and card initialization so that
the uSD/SD cards can be used as designed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-01 8:49 PM
Without a card present, there is nothing that needs to be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-02 12:59 AM
@GJohn SD card sockets usually come with a "Card detect" pin, that mechanically latches to GND when SD card pussed inside the socket.
https://github.com/sparkfun/ESP32_Motion_Shield/issues/2
