I having some problems with the C5509A MMC/SD controller with setting the bus width to 4 data lines for SD cards. In the C55xCSL (SPRC133), there's a sample program under generic5509\mmc\sd_set_width that I'm using to run this test. When I run the program, at the very end it compares the write and read buffers and prints out an error that the buffers are not the same. Looking at the buffers, I can see that only the first 10 samples of read buffer match the write buffer.
Some of the things I tried:
- This problem doesn't happen if the bus width is set to 1.
- I set the write buffer contents to contain values only up to 10 (eg. 0x00 through 0x0A) and this problem doesn't happen. A sample printout shows that the values match.
w[0] = 0x0000, r[0] = 0x0000 w[1] = 0x0001, r[1] = 0x0001 w[2] = 0x0002, r[2] = 0x0002 w[3] = 0x0003, r[3] = 0x0003 w[4] = 0x0004, r[4] = 0x0004 w[5] = 0x0005, r[5] = 0x0005 w[6] = 0x0006, r[6] = 0x0006 w[7] = 0x0007, r[7] = 0x0007 w[8] = 0x0008, r[8] = 0x0008 w[9] = 0x0009, r[9] = 0x0009 w[10] = 0x000a, r[10] = 0x000a w[11] = 0x0000, r[11] = 0x0000 w[12] = 0x0001, r[12] = 0x0001 w[13] = 0x0002, r[13] = 0x0002 w[14] = 0x0003, r[14] = 0x0003 w[15] = 0x0004, r[15] = 0x0004 w[16] = 0x0005, r[16] = 0x0005 w[17] = 0x0006, r[17] = 0x0006 w[18] = 0x0007, r[18] = 0x0007 w[19] = 0x0008, r[19] = 0x0008 w[20] = 0x0009, r[20] = 0x0009 w[21] = 0x000a, r[21] = 0x000a w[22] = 0x0000, r[22] = 0x0000 w[23] = 0x0001, r[23] = 0x0001 w[24] = 0x0002, r[24] = 0x0002 w[25] = 0x0003, r[25] = 0x0003 |
- If I set the write buffer to now contain values up to 11 (0x00 - 0x0B), then once again only the first 10 values match and the rest seem shifted for some reason.
w[1] = 0x0001, r[1] = 0x0001 w[2] = 0x0002, r[2] = 0x0002 w[3] = 0x0003, r[3] = 0x0003 w[4] = 0x0004, r[4] = 0x0004 w[5] = 0x0005, r[5] = 0x0005 w[6] = 0x0006, r[6] = 0x0006 w[7] = 0x0007, r[7] = 0x0007 w[8] = 0x0008, r[8] = 0x0008 w[9] = 0x0009, r[9] = 0x0009 w[10] = 0x000a, r[10] = 0x000a w[11] = 0x000b, r[11] = 0x0000 w[12] = 0x0000, r[12] = 0x0000 w[13] = 0x0001, r[13] = 0x0010 w[14] = 0x0002, r[14] = 0x0020 w[15] = 0x0003, r[15] = 0x0030 w[16] = 0x0004, r[16] = 0x0040 w[17] = 0x0005, r[17] = 0x0050 w[18] = 0x0006, r[18] = 0x0060 w[19] = 0x0007, r[19] = 0x0070 w[20] = 0x0008, r[20] = 0x0080 w[21] = 0x0009, r[21] = 0x0090 w[22] = 0x000a, r[22] = 0x00a0 w[23] = 0x000b, r[23] = 0x0000 w[24] = 0x0000, r[24] = 0x0100 w[25] = 0x0001, r[25] = 0x0200 |
Has anyone encountered this problem before? Any help would be greatly appreciated. Thanks!
-Marc