Hello everyone,
I'm trying to access an MMC with a p2020 (eSDHC) at bare metal level (C code). Thanks to your help I was able to understand how to move and understand how to write C code. I wrote a boot sequence (always following the guide dictated by the p2020 datasheet) to start the MMC, but it doesn't respond.
The startup sequence includes the following steps:
The main problem is that I do not receive any R1 = 0x01 as a response from the MMC once it receives the CMD0.
The ZERO command is generated correctly since it is visible with the oscilloscope.
The 80 clock pulses are also generated correctly since they are also visible with the oscilloscope.
I don't understand if I'm wrong in the boot sequence or whatever.
I am attaching the .c and .h files
There is no eSDHC bare-board example code from NXP, so there could be several approaches:
1) doublecheck the processor connection schematics
2) refer to the U-Boot mmc driver source code (u-boot/drivers/mmc/fsl_esdhc.c)
3) use a logic analyzer to inspect the SDHC interface activity
4) use NXP Professional Engineering Services:
https://www.nxp.com/support/support/nxp-engineering-services:SW-SUPPORT