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:
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 */ MCI_MASK0 = 0; MCI_COMMAND = 0; MCI_DATA_CTRL = 0; /* Register interrupt handlers for MCI,DMA event */ RegisterIrq(MCI_IRQn, Isr_MCI, PRI_LOWEST-1); RegisterIrq(GPDMA_IRQn, Isr_GPDMA, PRI_LOWEST-1); /* Power-on (VCC is always tied to the socket on this board) */ MCI_POWER = 0x01; /* Socket power on */ for (Timer1 = 10; Timer1; ) ; /* 10ms */ MCI_POWER = 0x03; /* Enable signals */ }
Thanks, David
Well for a start my pinsels were all wrong, but the ISR handling in the original sample appears broken :(
Hello David,
I assume you are using MDK v 5.38, and on this page:developer.arm.com/.../Use-MDK-Version-4-Projects
...under "Legacy Pack Download" you download and installed "Arm7, Arm9, Cortex-R" (MDK79525.EXE) into the C:\Keil_v5 folder.
Once you do that, you will find pre-made Flash FS examples in the folder:C:\Keil_v5\ARM\Boards\Keil\MCB2300\RL\FlashFS\SD_File\SD_File.uvproj
You can use this project as a reference. Does that example work for you? If not, some additional questions.
See more in the RL-FlashFS manualhttps://www.keil.com/support/man/docs/rlarm/rlarm_fs_flashfs.htm
=======
Where did you get the mmc_lpc23xx_mci.c ? The Keil Projects typically use a MCI_LPC23xx.c file, v 4.51.
Also is this a duplicate of the issue in this forum post?
https://community.arm.com/support-forums/f/keil-forum/54977/trying-to-get-rl-flashfs-working-on-lpc2300
If so it would be better to have a conversation only over there, rather than in 2 different posts.
No, they are two totally different questions - the other one is trying to the the Keil RL SD card support working. This is attempting to get the FlashFS ffsample code for LPC23xx working with the Keil toolchain.