This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using MMCSD_FATFS sample file on mmcsd port 1

Hi,

I am facing some problem using the mmcsd_fatfs sample file to access the mmcsd card on my board.

My board uses the MMCSD port 1 instead of port 0.

BIOSPSP: http://software-dl.ti.com/dsps/dsps_public_sw/psp/BIOSPSP/index.html

I tried changing the following. It is able to detect the card but fail at the f_mkfs function. Can anyone help?

Thanks

#define PSP_MMCSD_SAMPLE_DRIVE 1U
/* This is the driver number associated with MMCSD drive */
#define MMC_INST_ID 1U    <--- change from 0U to 1U
/*Instance no of mmcsd */

/*#define NUM_SECTORS 6144U*/
#define NUM_SECTORS 6144U
/*No of Bytes in drive to format */
#define FILESYS_BYTE_COUNT (NUM_SECTORS * 512U)

/*No of sectors read or written */
#define WRITE_SECTORS 10
/* No of bytes to write or read */
#define BYTE_COUNT (WRITE_SECTORS * 512U)


#define INCLUDE_MEDIA_WP_TEST 0
/*This will enable the WP test on the media. */

#define INCLUDE_ACTUAL_CARD_FREQ_IOCTL 0
/*This will actually alter the freq of the card.
Please note that the further operation of the card takes place at this freq*/

#define BUFFER_ALINED_CACHE_LENGTH
/* Enable this if user want to pass cache length aligned buffer, In polled mode
buffer must be 4 byte aligned */

#define DATA_ALIGN 128

#define MMCSD_SAMPLE_PRINT printf

.

.

.

.

.

/* Format the Nand drive */
retVal = f_mkfs(PSP_MMCSD_SAMPLE_DRIVE, 1, FILESYS_BYTE_COUNT);    <--- fail at this part
if(retVal == 0)
{
MMCSD_SAMPLE_PRINT("MMCSD_SAMPLE: create partition successful\n");
}else {
MMCSD_SAMPLE_PRINT("MMCSD_SAMPLE: partition creation failed errno: %d\n",retVal);
}

  • Hi,

    Please check the below things:

    1. whether this modification, will change the Pin Mux settings for port 1.

    2. will it enable the clock for this port?

    3. Check the Controller configuration and register settings for the port1.

    -Thanks

    Balaji N

     

  • Hi Balaji,

    Thanks for your reply.

    I was busy with another project for a while.

    And when i went back to the codes, my code doesnt work anymore.

    Can i check if you are able to guide me to modify the "mmcsd_fatfs" sample in BIOSPSP to be used on MMCSD register 1?

    The sample work perfectly on my EVM board which uses the MMCSD register 0. But now i need it on my board which is using the MMCSD register 1.

    Thanks. Any help is appreciated.

    Regards,

    Amy Chua

  • Hi,

    2 changes i made

    1) MMC_INST_ID change from 0U to 1U

    2) change the PINMUX setting.

    I am able to detect the card but i cannot perform f_mkfs.

    The program just hang there.

    I tried using f_mount and f_open instead but the program now hang at f_open.

    Please assist