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.

Speed of MMCSD driver using PSP 1.30.01 on C6748

Hi,

I am using the MMCSD driver (via the block media driver) in RAW mode. Currently, the writing speeds I am experiencing is roughly 0.06Mbyte/s, which is two orders (!) of magnitude slower than the speed I anticipated (6Mbyte/s for a class 6 card). I've tried various SD cards but this doesn't seem to make much difference.

I am using PSP 1.30.01 with a C6748. Currently I am using the zoom EVM board. In case it helps, here is how I set up the drivers:

The MMCSD driver:


const uint32_t MMCSD0_CLOCK_FREQUENCY = (150u * 1000u * 1000u);
const uint32_t MMCSD0_INSTANCE_ID     = 0u;
const uint32_t MMCSD0_HWI_NUMBER      = 7u;
 
PSP_MmcsdConfig mmcsdConfig;
 
mmcsdConfig.opMode        = PSP_MMCSD_OPMODE_DMAINTERRUPT;
mmcsdConfig.hEdma         = hEdma[0];
mmcsdConfig.eventQ        = PSP_MMCSD_EDMA3_EVENTQ_0;
mmcsdConfig.hwiNumber     = MMCSD0_HWI_NUMBER;
mmcsdConfig.pscPwrmEnable = false;
mmcsdConfig.pllDomain     = PSP_MMCSD_PLL_DOMAIN_0;
 
const int32_t MMCSD_DRIVER_INIT_RESULT = PSP_mmcsdDrvInit(MMCSD0_CLOCK_FREQUENCY,
                                                          MMCSD0_INSTANCE_ID,
                                                          &mmcsdConfig);

The block media driver:


const uint8_t  BLOCK_MEDIA_DRIVER_EMDA_EVENT_QUEUE_NUMBER = 0x00;
const uint8_t  BLOCK_MEDIA_DRIVER_TASK_PRIORITY           = 0x02u;
const uint16_t BLOCK_MEDIA_DRIVER_STACK_SIZE              = 4096u;
 
const int32_t BLOCK_MEDIA_DRIVER_INIT_RESULT = PSP_blkmediaDrvInit(hEdma[0],
                                                                   BLOCK_MEDIA_DRIVER_EMDA_EVENT_QUEUE_NUMBER,
                                                                   BLOCK_MEDIA_DRIVER_TASK_PRIORITY,
                                                                   BLOCK_MEDIA_DRIVER_STACK_SIZE);

Any help would be much appreciated.

Kind regards,

Mark

  • Mark,

    If you refer the data sheet (C6748_BIOSPSP_Datasheet) which comes with the BIOS PSP 1.30.01, the read OR the write performance is better than what you are getting in DMA mode.

    Could you please specify the number of sectors (buffer size) which you are reading/writting to measure the performance?

    It would be better to have buffer of 100's of KB to get the performance values.

    Let me know the result.

    Thanks and Regards,

    Sandeep K

  • Dear Sandeep,

    I am writing roughly 8Mbytes of data when measuring the speed. I am using a single block buffer to do this. That is, I am writing one block at a time.

    I did anticipate some performance hit by choosing small buffers, but not two orders of magnitude! Do you think the slow-down is exclusively due to the overhead of writing 512 bytes at a time, or are there perhaps other factors at play here. It is not straight-forward for me to increase the buffer size in my project.

    Kind regards,

    Mark

  • Dear Mark,

    As you know, while calling the Blk_Write(), we can specify the starting sector as well as the number of sectors to be written. So for the performance calculation, it would be better to have the number of sector to be written in terms of 200, 500 sectors etc.

    By choosing bigger number of sector to be written, the block media and actual driver function call overhead will become negligible, which yields the approximate (not exact!!) performance values.

    One more thing, i would like to know is, how are you calculating the time taken for the I/O?

    Is it possible to share your project?

    Thanks and Regards,

    Sandeep K

  • Dear Sandeep,

    Thank you for your response. It is not that I want to reproduce the specified performance values -- I simply want my project to be able to write data to the disk fast enough. I will conduct an experiment with larger buffer sizes for the sole purpuse of testing whether it is indeed buffer sizes that are causing the poor performance.

    I am computing the performance time by logging the number of milliseconds that have elapsed (using DSP bios timers). I have sufficient confidence that this measurement is correct. Not in the least because when my program starts I have to write 8Mbytes of data, and this consistently happens with 0.06Mbyte/s or less (roughly two minutes).

    I may be able to share my project if this is necessary (but probably not here).

    Kind regards,

    Mark

  • Dear Mark,

     

    Mark K said:
    It is not that I want to reproduce the specified performance values -- I simply want my project to be able to write data to the disk fast enough. I will conduct an experiment with larger buffer sizes for the sole purpuse of testing whether it is indeed buffer sizes that are causing the poor performance.

    Ok..

    Once you try with the larger buffer size, let me know the result.

    Thanks and Regards,

    Sandeep K

  • Hi Sandeep,

    I have performed the same experiment (writing 8Mbyte of data) with a single write command using a 8Mbyte buffer. This took approx. 0.6 seconds, making the speed of writing roughly 12Mbyte/s (using the precise amount of data and time). Considering that on the PSP's data sheet it lists a 2Mbyte/s speed, I am somewhat concerned as to whether the write actually is writing!

    What could be going wrong here?

    Kind regards,

    Mark

     

  • Mark,

    It would be better if you read back the data written onto the card, and then verify it, which will confirm whether the data actually is written or not.

    And also, for the experiments, you can use the buffer size of 100, 200, 300 KBs. and then move on as per your requirement.

    Thanks and Regards,

    Sandeep K