SD card performance on RT1060 EVK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SD card performance on RT1060 EVK

Jump to solution
1,739 Views
tmeyer1
Contributor III

Hi,

We seeing quite poor SD card read/write performance on our custom hardware. In effort to understand the problem, we resorted to running tests on the RT1060 EVK with the "sdcard_interrupt" (SDK 2.8.6) example with a slight modification to write 104MB of data . The following is mostly all of what we changed to the example code:

 

 

static status_t AccessCard(sd_card_t *card, bool isReadOnly)
{
    //Each loop it writes 512 bytes 4 times - 109,051,904 bytes / (512*4) is 53248.
    for (int i = 0; i < 53248; i++) {
        if (kStatus_Success != SD_WriteBlocks(card, g_dataWrite, DATA_BLOCK_START, 4))
        {
            PRINTF("Write multiple data blocks failed.\r\n");
            return kStatus_Fail;
        }
    }
return kStatus_Success;
}

 

This loop takes 80 seconds to process, resulting in 104/80 = 1.3 MB/seconds write speed. This is under 1/10th the speed I'd expect and our custom hardware is 4x slower than that. We're using a 16GB UHS-1 card.

I failed to find anyone who has conducted SD performance tests with a RT10xx. Has anyone been able to achieve better performance than this?

Is there something I'm missing in order to get better performance?

Thanks,

Tim

0 Kudos
1 Solution
1,696 Views
jeremyzhou
NXP Employee
NXP Employee

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I've run the code with your code, and it takes about 52 seconds to transfer 3*53248 times of g_dataWrite array whose size is 512*5.
(The SD_WriteBlocks will transfer 3 times of data once be called), then We can get the transfer rate is about 7.5 M/s.
To speed up the transfer rate, you can relocate the transfer function in the ITCM instead of the QSPI flash prior to run, in further, when transfer the same data, it will take less time to transfer a big block continually than multi transfer small portion blocks.
So the transfer data should be organized in advance to transfer.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

 

View solution in original post

0 Kudos
7 Replies
1,697 Views
jeremyzhou
NXP Employee
NXP Employee

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I've run the code with your code, and it takes about 52 seconds to transfer 3*53248 times of g_dataWrite array whose size is 512*5.
(The SD_WriteBlocks will transfer 3 times of data once be called), then We can get the transfer rate is about 7.5 M/s.
To speed up the transfer rate, you can relocate the transfer function in the ITCM instead of the QSPI flash prior to run, in further, when transfer the same data, it will take less time to transfer a big block continually than multi transfer small portion blocks.
So the transfer data should be organized in advance to transfer.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

 

0 Kudos
1,629 Views
tmeyer1
Contributor III

We did some SD write speed profiling by only changing the buffer size and I figured I would share the summary. Based off the results it there may have been something wrong with sizes larger than 128KB, we didn't both to investigate as this size of buffer is much more than our system can afford.  

tmeyer1_0-1610745256599.png

 

0 Kudos
1,591 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply and sharing.
However, I'm still a bit confused with the buffer size, can you explain again? as I'd like to replicate your test on my site.
Looking forward to your reply.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

 

0 Kudos
1,586 Views
tmeyer1
Contributor III

Hi,

Basically performance increases as `DATA_BLOCK_COUNT` increases. Where: 

 

 

/*! @brief Data block count accessed in card */
#define DATA_BLOCK_COUNT (32U)
/*! @brief Start data block number accessed in card */
#define DATA_BLOCK_START (2U)
/*! @brief Data buffer size. */
#define DATA_BUFFER_SIZE (FSL_SDMMC_DEFAULT_BLOCK_SIZE * DATA_BLOCK_COUNT)
SDK_ALIGN(uint8_t g_dataWrite[DATA_BUFFER_SIZE], BOARD_SDMMC_DATA_BUFFER_ALIGN_SIZE);

 

With this write code:

    for (int i = 0; i < 53248; i++) {
        if (kStatus_Success != SD_WriteBlocks(card, g_dataWrite, DATA_BLOCK_START, DATA_BLOCK_COUNT))
        {
            PRINTF("Write multiple data blocks failed.\r\n");
            return kStatus_Fail;
        }
    }

 

Hope that helps.

Tim

0 Kudos
1,681 Views
tmeyer1
Contributor III

Thanks for running that test for us.

I don't understand why you're seeing 6x our performance with a near same setup. Perhaps there is a difference with our EVKs, which model/revision did you run the test with?

 

Thanks,

Tim

0 Kudos
1,659 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I run the demo on the MIMXRT1060-EVK board and the SD card is 16 GB (just as the below figure shows), in my opinion, your transfer rate is 1.3 *3 = 3.9 M/s, as I said before that the SD_WriteBlocks will transfer 3 times of data once be called.

WeChat Image_20210112111109.jpgWeChat Image_20210112111104.jpg
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
1,637 Views
tmeyer1
Contributor III

Hi,

By writing 32KB blocks via `SD_WriteBlocks` we were able to achieve a similar performance to what you mentioned.

We will work off of that and try to get our file system performing near that rate. 

Thanks again. 

Tim

0 Kudos