IMX RT1050 EVK SD card write not working

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX RT1050 EVK SD card write not working

376 Views
yugandhar421
Contributor I

Hi,

I am testing SD card example on IMX RT1050 EVK board, available in SDK v2.3.0. The driver is failing to write SD card blocks but reading all blocks without any errors.

During debugging I found that, code is stuck at below while loop in SD_Write function available in fsl_sd.c.

/* Wait for the card's buffer to be not full to write to improve the write performance. */
 while ((GET_SDMMCHOST_STATUS(card->host.base) & CARD_DATA0_STATUS_MASK) != CARD_DATA0_NOT_BUSY)

The Present State (PRES_STATE) register has value 0xfe8d8088 which indicates DATA0 signal level busy, so while loop never breaks.

Please help me to fix this issue. I am using example generated by MCUXpresso IDE with SDK v2.3.0 No extra code written by me.

Labels (1)
0 Kudos
5 Replies

161 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yugandhar Babu Potarlanka,

    Your SDK2.3.0 is a little old, please download the newest SDK code for RT1050 board, and test it again.

    You can download the code from this link:

https://mcuxpresso.nxp.com/en/select 

   I test this code:

SDK_2.6.1_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\sdcard\polling

This is my test result:

pastedImage_1.png

You can find my write and read works OK.

Please try the new SDK again.

If you still have questions about it, please kindly let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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

161 Views
yugandhar421
Contributor I

Hi Kerry,

Thanks for replying to my question. I downloaded latest SDK v2.6.1 but I didn't find any sd card driver example as you mentioned.

pastedImage_2.png

0 Kudos

161 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yugandhar Babu Potarlanka,

   When you build the SDK code for RT1050, do you select the sdmmc stack in the middleware?

pastedImage_2.png

If not, please select it, and download it again, you will find the related example.

Any updated question, just let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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

161 Views
yugandhar421
Contributor I

Hi kerryzhou‌,

I downloaded latest SDK and tried the example, it is working fine, just writing and reading blocks. But after file system integration after few writes/reads, block write failed with PRES_STATE = 0xfe8d8088 in SDMMCHOST_ErrorRecovery()

File system's block write function has retry count 3 and next SD card block write is stuck in below while loop.

/* Wait for the card's buffer to be not full to write to improve the write performance. */
 while ((GET_SDMMCHOST_STATUS(card->host.base) & CARD_DATA0_STATUS_MASK) != CARD_DATA0_NOT_BUSY)

 

The Present State (PRES_STATE) register has value 0xfe8d8088 which indicates DATA0 signal level busy, so while loop never breaks. During previous block write failure also, same PRES_STATE value existed.

I observed this issue with polling and interrupt examples and also with fatfs example, when writing blocks continuously for more file sizes like 8K or high. How to overcome this issue?

pastedImage_2.png

Thanks,

Yugandhar

0 Kudos

161 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Yugandhar,

  Please tell me the detail steps how to reproduce your problem.

  User which project, and modify which point, then I will check it on my side.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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