08-23-2018 01:59 AM
I am using an STM32 micrcocontroller to interface an SD card memory using the SPI peripheral. I have done tests with 2Gb , 4Gb , 8Gb and 16Gb SanDisk cards. When I perform a reset with the 2Gb and 8Gb cards , nothing happens and I keep going with my tests. However, with 4Gb and 16Gb , once the reset is performed intialization fails . In fact , at the first insert in the SD slot , these cards are quite good initialized but one I perform the reset it does'nt pass.
When I tried to debug this problem, I discovered that when dealing a reset the response to command CMD0 is wrong . I get 0x00 instead of 0x01 which means that my card is not in Idle state.
I supposed that the problem is due to timing issues with the CS line. So , I tried to de-assert the CS before sending the CMD0 command and sending dummy bytes in order to make the card waiting 8 cloks period. Then , I send CMD0 and I assert the CS line to High. ( see below )
06-30-2019 09:32 PM
So I accidentally forgot to close the sd card file before deleting it or something like that . And because of this, my SD card is now unrecognizable by any SD module and computer. When I put my micro sd card in the computer(windows 10), nothing appears, instead, my disk management keeps loading forever.
When I try different micro sd cards with the Arduino, they work fine, so the wiring is all correct; my bricked micro SD card is the problem.
07-03-2019 05:24 PM