I am trying to add support for the SD card lock / unlock feature using a C5515. I have some code based loosely on the CSL MMC_write routine. Unfortunately, I'm consistently getting a CRCWR error, which I find surprising.
Essentially, the pseudo-code is:
1) Send SET_BLOCK_LEN to change the block length for the password data. Wait for response.
2) Reset the FIFO, and set it up.
3) Send CMD 42 (0x282A) with zero for arguments.
4) While bytes remain, push onto FIFO if it is not full.
5) Wait for RSPDNE.
When ST0 has RSPDNE set, it consistently also has CRCWR set.
Does anyone have any experience with implementing this feature they would like to share?