I'm using a PicoZed 7015 with Xilinx SDK 2018.3 in a bare-metal application. Everything works reading and writing to the eMMC with the default setting of ECC disabled. I have a high reliability application in mind and I'm wondering what would happen if I changed the ECC field in the eMMC's CSD register from the default no ECC to the optional BCH(542,512) ECC encoding. Would I still be able to read/write to the eMMC normally with the eMMC internally protecting the contents with ECC at the cost of reduced memory capacity, or would a special driver on the host be needed to encode/decode ECC reads/writes?
I wasn't able to find a definitive answer to this question, so I thought I would just try to set the ECC field to BCH encoding and see what would happen.
What I believe I need to do is read the eMMC CSD register using CMD9, keep the CSD contents the same except for my change, write the CSD contents with my change back to the eMMC CSD register using CMD27 (after computing a new CSD CRC7 field?) and then re-read the eMMC CSD register with another CMD9 to confirm my changes actually made it in.
I have not been able to get this process to work. One of the problems I have is when I try to go from the eMMC Transfer State (trans) back to the Standby State (stby) to execute another CMD9 to re-read the CSD register and confirm I have the ECC field updated, the CMD7 I execute with a Relative Card Address of 0x0000 that's supposed to send me back to the Standby State (stby) fails with a timeout.
As a sanity check, I tried just reading the CSD register with CMD9, issuing a CMD7 with the assigned RCA to move to the Transfer State (trans) and immediately move back to the Standby State (stby), but that fails with a timeout just like before. The figure below (from the JESD84-B50 JEDEC eMMC standard that the 8GB Micron MTFC8GAKAJCN-4M IT on the PicoZed BOM says it complies with) shows the sanity check I tried to perform:
So I must be missing something fundamental on how to get back to Standby State (stby). If anyone out there is knowledgeable about eMMC state machine programming, please give me a few pointers. Thanks for your time.