Author Topic: Tyring to get Keil RL-FlashFS working on ARM LPC2300 (MCB2300 board)  (Read 1015 times)

0 Members and 1 Guest are viewing this topic.

Offline perdrixTopic starter

  • Frequent Contributor
  • **
  • Posts: 640
  • Country: gb
I'm building some code to read the SD Card on an MCB2300.   I'm using the RL-FlashFS library.

I have configured CCLK to 48MHZ and PCLK_MCI to CCLK, and changed the #defines in MCI_LPC23xx.c to read:
Code: [Select]
#define __MCLK    48000000
#define __CPUCLK  48000000

My code to initialise the card reads:

Code: [Select]
uint32_t retv = finit(NULL);
The SD LED on the MCB2300 board comes on when the call is made and then there's a *long* pause and eventually the function returns a value of 2.

During the long wait, the code is busy waiting in the ReadBlock function in source file MCI_LPC23xx.c:

Code: [Select]
static BOOL ReadBlock (U32 bl, U8 *buf, U32 cnt) {
  /* Read one or more 512 byte blocks from Flash Card. */
  U32 i;

  /* Set MCI Transfer registers. */
  MCI_DATA_TMR  = DATA_RD_TOUT_VALUE;
  MCI_DATA_LEN  = cnt * 512;

  /* Start DMA Peripheral to Memory transfer. */
  DmaStart (DMA_READ, buf);
  MCI_DATA_CTRL = 0x9B;

  for (i = DMA_TOUT; i; i--) {
    if (GPDMA_RAW_INT_TCSTAT & 0x01) {
      /* Data transfer finished. */
      return (__TRUE);
    }
  }
  /* DMA Transfer timeout. */
  return (__FALSE);
}

After 10M (DMA_TOUT) iterations it gives up and returns FALSE.

I'm using 4.74 of the library and uVision 5

Help please, I am totally baffled.
Thanks, David
« Last Edit: August 21, 2023, 01:45:47 pm by perdrix »
 

Offline perdrixTopic starter

  • Frequent Contributor
  • **
  • Posts: 640
  • Country: gb
Re: Tyring to get Keil RL-FlashFS working on ARM LPC2300 (MCB2300 board)
« Reply #1 on: August 29, 2023, 11:33:57 pm »
It turns out it worked OK with a 4GB SDHC card but refused to play with 1GB SD cards!!

D.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf