Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample clock tune freeze (MMC card running HS200 with speed up 120MHz) #74

Open
BA8819 opened this issue Apr 10, 2019 · 3 comments
Open

Comments

@BA8819
Copy link

BA8819 commented Apr 10, 2019

Hi

I'm trying to run Panasonic mmc card (8Gb) with ATSAMA5D28C. Initially everything looks okay but on recent tests when rebooting the board multiple times, the card initialization freezes; I looked into it and it seems that the card is freezing when trying to set the clock speed (HS200) above 95Mhz. The failure is related to the sample_tune_procedure which has to be done in HS200 when running high speed.
The issue isn't consistent as the initialisation will work sometimes. I looked in the Errata and this issue is acknowledged however couldn't seem to see any implementation in the latest driver.

I tried adding the condition hc2r & SDMMC_HC2R_EXTUN to the while loop in the sdmmc_tune_sampling but that didn't get me anywhere and in fact the failure rate is worse now.

when forcing the driver to work with lower speed modes (DDR or SDR) there are no problems observed.

@BA8819
Copy link
Author

BA8819 commented Apr 10, 2019

Think I got it fixed by adding this condition (properly!) to the sdmmc_tune_sampling
hs200 freeze

@nirvann
Copy link
Contributor

nirvann commented Apr 10, 2019

A software workaround to the Erratum hasn't been released yet.
Basically, the workaround consists in modifying the while() loop so it stops if the Controller clears the Check Execute Tuning flag:
while (hc2r & SDMMC_HC2R_EXTUN && !(regs->SDMMC_NISTR & SDMMC_NISTR_BRDRDY)) ;

However some additional code may be required to ensure that (1) the last SEND_TUNING_BLOCK command isn't in progress anymore, and (2) the Buffer Read Ready event, when it occurs, is consumed.

@BA8819
Copy link
Author

BA8819 commented Apr 11, 2019

In the Errata, the workaround is for this condition to be ORed with BRDRDY. I have tried the oring and still the problem might occur.
Another problem is that the driver doesn't do periodic re-tuning to avoid potential drift caused by temperature variation.
Also when a tuning problem occurs the driver just consumes the error as ERR_IO without performing the tune.

These all make working with HS200 currently unstable even with the latest driver, so would be better to stay on DDR or SDR mode until these issues have been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants