SD Card driver Debugging Experience

Source: Internet
Author: User

Do SD/MMC Card Drive project also has a big six months, always feel that the sum up something. Here, the main is to record some of the more common problems and solutions, so as not to encounter again.

The first is the SD/MMC card initialization error problem. Before finding the error, confirm: 1. Use the card reader to confirm whether this SD card is damaged; 2. Read the same card with another set of environments (the same program); 3. It is normal to read another SD card in the same environment. If it is 1, then directly out of this article; if it is 2, then it is the environment of virtual welding short-circuit or chip damage, the problem is relatively good to do; if it is 3, then the problem of procedure and environment is small, may be some details of the problem, you can refer to the following part of the content; Then we're going to start the investigation.

The first thing to check for this type of error is the hardware. I think, the first step, I will confirm the schematic diagram, see whether the IO connection is correct, using a multimeter to confirm IO no virtual welding, short circuit. Next, use the oscilloscope (if not, only with a multimeter), measuring the power supply foot of the SD card seat. In general, the voltage value should be around 3.3V, if the difference is too large, may be a circuit error, or LDO power supply capacity is insufficient.

If you confirm the above two steps, then the hardware is not a big problem. The next thing to confirm is the problem with the driver on the firmware. Generally speaking, if there is a logic analyzer at this time, then the problem is simplified. If not, only by experience to step by step. The first thing to check is the order of the electricity, and remember to mention this problem in the blood lesson of the article. To put it simply, it is to turn on the electricity first and then pull. It's OK to power up. So just look at the initialization program. Confirm the timing of the first time control in the power between 100KHz to 400KHz (generally used 240KHz around, here is best to confirm with the oscilloscope), before sending the first command, confirm that the host has sent enough clocks (like 74 clock above).

Then, formally enter the initialization program. We need to talk about the difference between the SD/MMC card and the similarities and differences of the SD card and the MMC card. This is also a little bit about this. In general, when just on the power, SD card does not support CMD1 and support CMD55,MMC card does not support the CMD55 and support CMD1, so you can distinguish between the two kinds of cards. Then SD1.1 and SD2.0 card mainly through the CMD8 to distinguish, in short, is according to the spec on the request. Also note that: when the CMD55 parameters for the full 0,acmd41 on the SD1.1 and SD2.0 parameters will be different. When sending CMD0, pay attention to IO port level, in order to avoid mistakenly into the SD card SPI mode.

At this point, if you can activate successfully, then the problem is not much. Specific issues also need to be analyzed.

It's easy to remember this first.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.