This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11870 - Sansa Clip+/Fuzev2 SDHC detection
Attached to Project:
Rockbox
Opened by Max Sin (z8080) - Thursday, 13 January 2011, 01:19 GMT+2
Last edited by Bertrik Sikken (bertrik) - Sunday, 17 April 2011, 11:47 GMT+2
Opened by Max Sin (z8080) - Thursday, 13 January 2011, 01:19 GMT+2
Last edited by Bertrik Sikken (bertrik) - Sunday, 17 April 2011, 11:47 GMT+2
|
DetailsAMSv2 SDHC card detection problem described in
Here is original bug report: http://www.rockbox.org/tracker/task/11798 And here is my description of revival of "solved" bug: http://forums.rockbox.org/index.php/topic,26369.msg176646.html#msg176646 |
This task depends upon
Closed by Bertrik Sikken (bertrik)
Sunday, 17 April 2011, 11:47 GMT+2
Reason for closing: Fixed
Additional comments about closing: This particular problem seems to have been caused by trying to enable sd card high-speed mode in an improper way. Should be fixed with r29660.
Sunday, 17 April 2011, 11:47 GMT+2
Reason for closing: Fixed
Additional comments about closing: This particular problem seems to have been caused by trying to enable sd card high-speed mode in an improper way. Should be fixed with r29660.
FS#11798For example you are describing some other corruption problems, this was not described in the the previous task.
FS#11798described a particular problem plus the fix for it, so I am against re-opening it.BTW, I prefer to have the full description of the bug in the flyspray task, instead of in an external link.
NOTES for more, than I, skilled developers:
a) I assume, that delay for 100 milliseconds is long enough for completion of card internal operations, but is subjectively short and not visible for users. In "original"
FS#11798issue delay for 1 millisecond was enough, so with 100ms we have good overlap.b) IMHO, we don't always properly wait for the response of the card during "setting card to the HS timings" commands sequence. But I am not familiar with SD specs, so I cannot figure out how fix this issue.
c) Patch file with some results of my tests -- sd-init-fix-INFO.patch
Sorry for weird form of its representation, but I hope, that it may be useful for locating "failed" SD-command.
Marks "25.0MBit/s" and "50.0MBit/s" are from "System-Debug-View disk info" menu. They are identical for both internal and external cards.
SU32G Rev 8.0
Prod: 11/2010
Ser#: 0x0BB8D125
M=03, 0=SD
Blocks: 0x03B72400
Speed: 50.0MBit/s
Taac: 10.0ms
Nsac: 0 clk
R2W: *2
IRmax: 35..45 mA
IWmax: 60..10mA
Works great after applying the patch from Max Sin.
I still cant get USB data transfer working, but I dont think this patch was supposed to address that.
With this patch, the sd controller waits until the data sent by CMD6 has been fully transfered, before issuing another command (and it replaces the delay).
It simply removes the code that puts the card in hi speed mode, this should have no effect on transfer speeds because the controller doesn't use hi speed mode itself yet.
As far as I understand from z8080 (jan 26th), things started working actually for him when disabling the high-speed switch code:
+ //if (false) /* No HS timings - no problems */ /* M */ /* OK, 25.0MBit/s */
Odd BTW, how basically a change for internal df memory has an effect on how external sd memory works.
As far as I understand the internal sd memory organisation:
* I *guess* the size reported in the CSD is the total size of the internal sd memory
* The first 30 MB are reserved for the OF image. Our code skips this first 30 MB at a very low level, so the upper layers (file system, usb storage etc.) are not even aware of this.
* The rest of the memory is available as internal storage for songs etc.
on bootup. Thanks a bundle - They both show 50MB/s. Cheers.
* simpler_numblocks_check_v1.patch simplifies the check of accessed blocks against the highest block
* cmd6_away_v2.patch entirely removes the part where we switch the card to high-speed mode. Switching to high-speed mode is currently useless because we don't switch the sd controller into high-speed too.
* wait_response_v1.patch makes rockbox properly wait for the response of the SD_STOP_TRANSMISSION command
Things to try:
* does it still boot? :)
* is an external sd card still recognised at all?
* is an external sd card recognised directly after reboot?
* is an external sd card recognised after reinserting it?
The most interesting patch is cmd6_away_v2.patch, please test that one. It works for me, but I also never had the original problem.
Attached patch cmd6_away_v3.patch also gets rid of another delay, could you also test that one?
You *do* have an SDHC card, anything bigger than 2 GB will at least be SDHC, not "normal SD".
For the 3.8.1 we might have to revert r29656 (and r29667 which relies on r29656). Are you able to build and test a firmware with r29667 and r29656 reverted?
If not, drop by in the irc channel (#rockbox on freenode.net) in a few hours and I might be able to build you a test firmware (if you're interested in helping to test).
I have tested official 3.8 - works fine - and pre-official 3.8.1 - same problem. I'm gonna try to go back a few revisions more, but I'll need some more time. Sorry for the wrong info above.