1

I am encountering an EMMC read/write issue. I am trying to write an EMMC driver on Omap35x. After I initialized both the emmc card and omap, the card entered tran state. My read and write command never succeed. Here is what I have done:

  1. Send CMD0 (MMCHS_CMD = 0x00000000 MMCHS_ARG = 0xf0f0f0f0)
  2. While busy send CMD1 (MMCHS_CMD = 0x01020000 MMCHS_ARG = 0x40FF8080)
  3. Send CMD2 (MMCHS_CMD = 0x02090000 MMCHS_ARG = 0x00000000)
  4. Send CMD3 (MMCHS_CMD = 0x031a0000 MMCHS_ARG = 0x00010000) Response = 0x500 Ident State
  5. m_regs->MMCHS_CON &= ~0x00000001;
  6. Send CMD9 (MMCHS_CMD = 0x009090000 MMCHS_ARG = 0x00010000)
  7. Send CMD13 Check status (MMCHS_CMD = 0x0D1a0000 MMCHS_ARG = 0x00010000) Response = 0x700
  8. Send CMD7 (MMCHS_CMD = 0x071a0000 MMCHS_ARG = 0x00010000) Response = 0x700
  9. While not tran state, send CMD6 (MMCHS_CMD = 0x061a0000 MMCHS_ARG = 0x03b90100) Response = 0x800 10.Set clock to 48 MHz Send CMD 16 (MMCHS_CMD = 0x101a0000 MMCHS_ARG = 0x00000200) 11.Send CMD13 Check status (MMCHS_CMD = 0x0D1a0000 MMCHS_ARG = 0x00010000) Response = 0x900

After the steps above, I tried to send command CMD24 (MMCHS_CMD = 0x182A0002 MMCHS_ARG = 0x00000001 and MMCHS_BLK = 0x00000200), the Omap successfully enter the MMCHS_STAT_BWR and then I send the 512 bytes data. I can observe those data sending out through the data line by using a oscilloscope but then when I was polling the TC/DTO, I received a 0x108111 from MMCHS_STAT which indicate a Data time out. I can receive a response 0x900 for the command.

For the reading, I would send CMD17(MMCHS_CMD = 0x112A0012 MMCHS_ARG = 0x00000001 and MMCHS_BLK = 0x00000200). I can also receive a response 0x900 for the command. The Omap successfully enter the MMCHS_STAT_BRR but I could not observe any data sending through the data line.

Please let me know if you find any issue on the steps I have done or you have an example to make it work.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Ytterbia
  • 11
  • 1

1 Answers1

0

Have you ever try to write/read at default speed? you can skip your step 9., do not change clock to 48 MHz in step 10. and try again.

Besides, your the response of CMD6 switch to high speed mode in step 9, the bit of READY_FOR_DATA is not ready. I think you can add a CMD13 to make sure if eMMC is ready for data. If the capacity of eMMC is more than 2GB, you do not need to send CMD16 in step10. The high capacity eMMC is sector mode in default.

What's your limited value for data timeout? In my experiments, some eMMCs send first data more than 8ms after response.

Hsin-Hsiang
  • 411
  • 1
  • 3
  • 13