Hi everybody,
I am trying to use FAT on zynq7020. I am currently trying to learn how to initialize the MMC card. I have two questions:
In xsdps.c file line 2947 to read CID, XSdPs_ReadReg16 function is used 4 times to read 128 bit register. I think it should be replaced with XSdPs_ReadReg to read 32 bit registers. Is there a point I don’t understand or miss?
Relative addreses of eMMC is set 0x12340000. Is there any specific reason not to set 0x0000000?
Have a good day.
rtel
(Richard Barry)
May 28, 2023, 8:25pm
2
Please link to the lines you are referring to in github. For example, this link is to line 568 of the head revision of the kernel’s task.c file. FreeRTOS-Kernel/tasks.c at main · FreeRTOS/FreeRTOS-Kernel · GitHub
Thank you for information. The second question is about the code just after the code snippet below.
/* CMD2 for Card ID */
Status = XSdPs_CmdTransfer( InstancePtr, CMD2, 0U, 0U );
if( Status != XST_SUCCESS )
{
Status = XST_FAILURE;
goto RETURN_PATH;
}
InstancePtr->CardID[ 0 ] =
XSdPs_ReadReg16( InstancePtr->Config.BaseAddress,
XSDPS_RESP0_OFFSET );
InstancePtr->CardID[ 1 ] =
XSdPs_ReadReg16( InstancePtr->Config.BaseAddress,
XSDPS_RESP1_OFFSET );
InstancePtr->CardID[ 2 ] =
XSdPs_ReadReg16( InstancePtr->Config.BaseAddress,
XSDPS_RESP2_OFFSET );
InstancePtr->CardID[ 3 ] =
XSdPs_ReadReg16( InstancePtr->Config.BaseAddress,
rtel
(Richard Barry)
May 29, 2023, 4:55pm
4
Looks like a Xilinx generated file and I’m going to guess it gets set to be correct for the hardware.
htibosch
(Hein Tibosch)
May 30, 2023, 1:09am
5
I think it should be replaced with XSdPs_ReadReg to read 32 bit registers
If you think so, have a try and read the registers with 32-bit access.
how to initialize the MMC card
I used FreeRTOS+FAT very often with SD-cards, but I never had an MMC card, so I can not try it.
Xilinx does have a forum where questions can be asked.