In mmc_read_esd in usdhc_mmc.c is an error in CMD8
This line is correct:
card_cmd_config(&cmd, CMD8, NO_ARG, READ, (1<<0)|(1<<2)|(1<<4), DATA_PRESENT, TRUE, TRUE);
or host_data_read will never return.
It is not possible to put the card into transfer mode.
card_enter_trans in usdhc.c CMD7 send fails.
card_cmd_config(&cmd, CMD7, card_address, READ, (1<<0)|(1<<2)|(1<<4),//RESPONSE_48_CHECK_BUSY,
DATA_PRESENT_NONE, TRUE, TRUE);
If I ignore this, I can use card_data_read and card_data_write. Written data are saved, to weherever. Even after power down the data is still there, but whatever offset I choose, I get the same data.
It is a 4GB Toshiba eMMC chip on a Toradex Apalis board. Program is loaded over the serial bootloader, DCD and IVT from u-boot. Serial, GPIO and SPI works fine.
Parameters of C-function card_cmd_config() are used to fill bit fields of Command Transfer Type
(uSDHCx_CMD_XFR_TYP) register. Your pattern (1<<0)|(1<<2)|(1<<4) concerns the following
bit fields :
- CICEN (Command Index Check Enable) ;
- CCCEN (Command CRC Check Enable) ;
- RSPTYP[1:0] (Response Type Select).
The table below from the i.MX6 Reference Manual shows meaning of possible settings.
The last two parameters of C-function card_cmd_config() are used to configure
CICEN and CCCEN. Perhaps it would be better to change them.
Have a great day,
Yuri
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------