Keil Logo

RL-ARM: Resolving MCI DMA Timeouts on the LPC4088


Information in this knowledgebase article applies to:

  • MDK-ARM V4.70a and later

SYMPTOM

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.

CAUSE

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.

RESOLUTION

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 */

MORE INFORMATION

SEE ALSO

Last Reviewed: Wednesday, February 27, 2013


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.