RL-ARM: Resolving MCI DMA Timeouts on the LPC4088
Information in this knowledgebase article applies to:
You receive consistent DMA timeout errors when trying to read an SD/MMC card using an LPC4088 device. But the same code works properly with a LPC1788 device.
For the LPC1788 device, bits 7 and 8 in LPC_IOCON_P1_6 and P1_7 are reserved and default to 0. For the LPC4088 device, bit 7 (ADMODE) selects analog or digital mode for those pins and defaults to 1 (digital mode). The Init() function in the MCI_LPC177x_8x.c module was resetting bit 7 in LPC_IOCON_P1_6 and P1_7.
Change the code that configures the SD/MCI pins to OR the required bits into the registers and preserve the default bit settings. This allows the code to work properly for LPC1788 and LPC4088 devices. In the Init() function in the MCI_LPC177x_8x.c module, modify the code to change operator from "=" to "|=" in the SD/MCI pin configuration code. The modified code lines should look like this:
LPC_IOCON->P1_2 |= (1 << 9) | 2; /* MCICLK */ LPC_IOCON->P1_3 |= (1 << 9) | 2; /* MCICMD */ LPC_IOCON->P1_5 |= (1 << 9) | 2; /* MCIPWR */ LPC_IOCON->P1_6 |= (1 << 9) | 2; /* MCIDAT0 */ LPC_IOCON->P1_7 |= (1 << 9) | 2; /* MCIDAT1 */ LPC_IOCON->P1_11 |= (1 << 9) | 2; /* MCIDAT2 */ LPC_IOCON->P1_12 |= (1 << 9) | 2; /* MCIDAT3 */
Last Reviewed: Friday, October 9, 2020
of your data.