Reference document to understand code and commands in 0B_readsector
codernavi18 opened this issue · 1 comments
Is there any reference document that can be used to understand the SD commands, flags and register settings? What was the one that you used other than BCM2837 reference manual?
I see some anomalies, not sure if its intended.
e.g. in the code
// STATUS register settings
#define SR_READ_AVAILABLE 0x00000800
But the BCM2837 manual (page 72) says that bit 9 denotes if read data is available
Hence, it should have been defined like `0x00000100` .Same thing for SR_APP_CMD
. In the code its defined like below
#define SR_APP_CMD 0x00000020
But as per BCM2837 (page 72), 6th bit is reserved.
There's no such document, sadly. Actually the lack of such doc was the very reason why I started these turorials.
First I've used the BCM reference (one that was later removed by the RPi developers, however you can still find the link in the commit history of the README file), and some other eMMC references, but it didn't work (BCM docs are full of errors, you must always check the errata as well). When I got stuck with those, then I've studied all the sources I could find online (most notably the Linux kernel) and did painful and endless trial-and-error cycles to get this up and running. Therefore it could contain errors, I cannot say with 100% certainty that it does not. All I can say for sure that these turorials are working on my RPi box as they intended.
Hope this helps,
bzt