We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
LPC1788 with SDHC card attached using 4 data lines, e.g. not SPI. I'm using MDK-PRO 4.60 and my project is RTX based. I'm using networking and the RL-filesystem, with MCI_LPC177x_8x as my memory card driver.
When "File System Cache" is enabled (any value) data transfers to the SDHC card fail. A small fragment, which is equal in size to the FS cache size, is the only thing written to the SDHC card. The WriteBlock routine in the MCI driver fails -- I suspect a DMA issue.
When "File System Cache" is turned off, things are working OK, albeit slowly.
Do I need to relocate the FS cache to any particular place in memory? I see some notes about LPC23xx and FS cache location, but so far I've not read anything about LPC1788.
I haven't worked with DMA on the 17xx chips, but the 23xx chips have multiple separate RAM blocks and doesn't allow DMA transfers for the 32kB of main RAM to dedicate the full memory bandwidth for the processor core. The secondary RAM blocks are on a separate bridge together with the peripherial hardware and supports DMA.
On the 1788 there is the main 64kB ram block, then two 16kB "peripheral" ram areas. I've found that I needed to push the EMAC into this peripheral area in order to get the network to run.
Relocating the File System Cache into either of the peripheral ram areas doesn't seem to have any effect.
In Summary:
FS cache enabled: large file writes to the SD card (via FTP) fail and I get zero (or very small) length files written instead. Reading large files from the SD card works fine.
FS cache disabled: large file writes to the SD card work, but slowly. Reading files from the SD card is fine.
I've also tried slowing down the SD_CLK speed and/or increasing some of the TOUT values in MCI_LPC177x_8x.h -- no change.
The problem appears to be in the MCI driver, WriteBlock routine. The MCI peripheral status word comes back 0x0000 0002 -- DATACRCFAIL.