UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor nikolamkg
Visitor
404 Views
Registered: ‎05-18-2018

SD card insertion not detected

Hello,

 

I have ZCU102 evaluation kit and want to use SD card for reading and writing .txt files. I'm using SanDisk 16GB that was provided with the kit, Vivado 2018.1, and xilffs 3.8 library for accessing SD card. However, I have a problem and function f_open fails because statusreg bit XSDPS_PSR_CARD_INSRT_MASK for card insert is not activated, so condition in line 206 in diskio.c is never satisfied, hence f_open returns FR_NOT_READY. So far, I haven't been able to find an error, but I'm not sure if something should be changed while configuring PS in Vivado. I have attached snapshot of SD0 configuration, also I have left SD clocks as SDIO0 = 200MHz and SD DLL = 1500MHz. My code is shown below:

 

 

int main()
{
FATFS FS_Instance;
FIL file1;
FRESULT result;
TCHAR *Path = "0:/";
result = f_mount(&FS_Instance, Path, 0);
if (result != 0){
xil_printf("ERROR: f_mount returned %d \r\n",result);
return XST_FAILURE;
}
u32 StatusReg = XSdPs_GetPresentStatusReg((u32)XPAR_PSU_SD_0_BASEADDR);
result = f_open(&file1, "0:/test.txt", FA_WRITE|FA_CREATE_NEW);
if (result != 0){
xil_printf("ERROR: f_open returned %d \r\n",result);
return XST_FAILURE;
}
return 0;
}

 

Thanks for any help.

 

Best regards

sd_config.png
0 Kudos