Author Topic: Use eMCC memory as mass storage in MPSoC Kria  (Read 506 times)

fabioz96

  • Active Member
  • *
  • Posts: 1
Use eMCC memory as mass storage in MPSoC Kria
« on: February 02, 2022, 09:27:09 AM »
Hi, I'm working on zck26 Kria SoM and with the IP Core MPSoC.

In Vivado Block Design I configured th Zynq Ultrascale+ MPSoC with default option as follow:
SD0 (eMMC) Configuration


SD1 (SD) Configuration


Clock Configuration


 
After exporting XSA file, I created a new Vitis Project with the example "xsdps_raw_example.c" to use both SD Card and eMMC Memory. The SD Card (XPAR_XSDPS_1_DEVICE_ID) works fine while the eMMC Memory (XPAR_XSDPS_0_DEVICE_ID) doesn't work.

With debugger I noticed that the function with return status "XST_FAILURE" is "XSdPs_CheckBusIdle".

My final goal is to use the eMMC Memory as mass storage with FatFs library. I can run sucessfully the "FfsSdPolledExample.c" example on SD1 (SD Card) but when I try the same example on SD0 (eMMC Memory) I get "FR_NOT_READY" error. Obviously this happen because the low level driver (XSdPs_CheckBusIdle) fails. What's wrong with low level driver or with IP SD0 configuration?

In Vivado I configured MIO Pins, from 13 to 22 used for eMMC slot, to 1.8V.

I also tried to slow-down the clock to 50 MHz and to change the source from IOPLL to RPLL.
The eMMC still doesn't work.

In the guide https://support.xilinx.com/s/article/71019?language=en_US suggests to give these info:

The IDCODE from 0xFFCA0040 is 04724093
The PS_VERSION from 0xFFCA0044 is 00000513
 
During debugging of "xsdps_raw_example" example, I notice that the method
XSdPs_CmdTransfer(InstancePtr, CMD55, 0U, 0U);
fails with code 2 (XSDPS_CT_ERROR) and at this point the suggested dump registers are:

ff18031c: sd_config_reg1 = 64506450
ff180320: sd_config_reg2 = 0EFC1EFC
ff180324: sd_config_reg3 = 04070407
ff16002c: clkctrl_sdclkfreqsel = 000EFA07
ff5e0104: dll_ref_ctrl = 00000000
0xFF16002C: reg_clockcontrol SDIO0 = 000EFA07
0xFF180314: ITAP = 00000000
0xFF180318: OTAP = 00000000

How can I solve it?
Thanks.

JH

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1956
Re: Use eMCC memory as mass storage in MPSoC Kria
« Reply #1 on: February 02, 2022, 12:18:21 PM »
Hi,
Kria is Xilinx SOM. I would suggest to ask on Xilinx forum. This forum is for trenz modules.
https://support.xilinx.com/s/topic/0TO2E000000YKXxWAO/kria-soms?language=en_US

PS: check if Xilinx provide board files with correct PS configuration. Otherwise check schematics of the SOM to see how emmc is connected there. And check eMMC one time with linux, it's mostly easier than bare metal. eMMC will be detected in most cases automatically with petalinux and default setting, in case your XSA is correct.

br
John