This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with Filesystem MMI/SD Card

Regarding the thread "Flash file system problem" by Gennady Palitsky 2007-Apr-22,
I came to the same point,where I have to create a Heap (8k) and copied retarget.c from C:\Keil\ARM\Boards\Keil\MCB2300\RL\FlashFS\SD_File to my application.

The problem I have is different:
Stepping the following code, after "retv = finit( );" the program counter jumps back to the beginning of this function over and over.

/********************************************************************************
* Initializing MMC/SD Interface (SPI-MODE)
* retv: 0 ok, 1 failed
********************************************************************************/

U32 mmc_init (void)
{
U32 retv;

  MMC_Disable;
        spi_init( );
  MMC_Enable;


  retv = finit ();
  if (retv == 1) { printf ("\nSD/MMC Init Failed"); }
  else
  {
    printf ("\nSD/MMC Card is Unformatted");
    strcpy ((char*)str, "SWMZ\r\n");
    cmd_format ((char*)str);
    retv = finit ();
  }

        return(retv);
}

Parents
  • First there is a question: are you using SPI mode or a Native mode. It is possible to use both with LPC23xx devices.

    If finit() returned 1 then the SD/MMC card was not initialized into SPI/Native mode. This error is returned from the mmc/mci layer. It means you do not have a working connection with your SD/MMC memory card. Most likely you have misconfigured SPI/MCI interface.

    Please check the spi inteface by single stepping the spi_send() function to see if you have any response from the card at all.

    If you are using Native mode, then single step the mci_init() function to see where it fails.

    Can you check \Keil\ARM\Boards\MCB2300\RL\FlashFS\SD_File if this example works?

    Franc

Reply
  • First there is a question: are you using SPI mode or a Native mode. It is possible to use both with LPC23xx devices.

    If finit() returned 1 then the SD/MMC card was not initialized into SPI/Native mode. This error is returned from the mmc/mci layer. It means you do not have a working connection with your SD/MMC memory card. Most likely you have misconfigured SPI/MCI interface.

    Please check the spi inteface by single stepping the spi_send() function to see if you have any response from the card at all.

    If you are using Native mode, then single step the mci_init() function to see where it fails.

    Can you check \Keil\ARM\Boards\MCB2300\RL\FlashFS\SD_File if this example works?

    Franc

Children