This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Getting FatFS to work with Keil toolchain and MCB2300 card

I've taken the code from the FatFS project ffsample/lcp23xx folder and ported the code to build using the Keil toolchain for the MCB2300.

Whatever I try it always seems to timeout in the send_cmd function in mmc_lpc23xx_mci.c

This is my code to initialise the MCI interface.

Has anyone "been there, done that, fixed the problems?"

My code to initialise the MCI "stuff" is here:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void power_on (void)
{
/* Enable MCI and GPDMA power */
__set_PCONP(PCSDC|PCGPDMA);
/* Enable GPDMA controller with little-endian */
GPDMA_CH0_CFG &= 0xFFF80000; /* Disable DMA ch-0 */
GPDMA_CONFIG = 0x01;
/* Select PCLK for MCI, CCLK/1 = 72MHz */
PCLKSEL1 |= (PCLKDIV_1 << PCLK_MCI);
/* Attach MCI to I/O pad */
PINSEL0 |= (2<<19); /* MCICLK -> P0.19 */
PINSEL0 |= (2<<20); /* MCICMD -> P0.20 */
PINSEL0 |= (2<<21); /* MCIPWR -> P0.21 */
PINSEL0 |= (2<22); /* MCIDAT0 -> P0.22 */
PINSEL2 |= (2<<11); /* MCIDAT1 -> P2.11 */
PINSEL2 |= (2<<12); /* MCIDAT2 -> P2.12 */
PINSEL2 |= (2<<13); /* MCIDAT3 -> P2.13 */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Thanks, David

0