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: 
Contributor
Contributor
5,448 Views
Registered: ‎07-28-2013

Standalone SD card read & test program fails

I am trying to using standalone program to test the SD card read and write speed, the program is as follow

 

 

   // SDIO Controller Test
   static XSdPs ps7_sd_0;

   XSdPs_Config * SdConfig_0;

   u8 RxBuffer[512*2];
   int Status;

   SdConfig_0 = XSdPs_LookupConfig(XPAR_PS7_SD_0_DEVICE_ID);
    if (NULL == SdConfig_0) {
        return XST_FAILURE;
    }

    Status = XSdPs_CfgInitialize(&ps7_sd_0, SdConfig_0, SdConfig_0->BaseAddress);
    if (Status != XST_SUCCESS) {
        print("Sd Config failed !\n\r");
        return XST_FAILURE;
    }


    Status = XSdPs_SdCardInitialize(&ps7_sd_0);
    if (Status != XST_SUCCESS) {
        print("Sd0 Initialization failed !\n\r");
        return XST_FAILURE;
    }

    // read and write test
    Status = XSdPs_ReadPolled(&ps7_sd_0, 0x01, 0x01, RxBuffer);
    if (Status != XST_SUCCESS) {
        print("Sd1 Read failed !\n\r");
        return XST_FAILURE;
    }

 

 

The last read function fails, anyone knows why ? Thanks.

 

0 Kudos
4 Replies
Xilinx Employee
Xilinx Employee
5,439 Views
Registered: ‎08-02-2007

Re: Standalone SD card read & test program fails

Hi,

Can you share more details, as which board? which version?

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
5,431 Views
Registered: ‎07-28-2013

Re: Standalone SD card read & test program fails

Hi,

 

I am using Zedboard (rev c) with vivado 2013.4. All the setting are default zedboard configuration.

 


The SD card works fine since the board can boot from it.

 

Xilinx does not proivde examples for sdio devices in the SDK document.

 

- doonny

0 Kudos
Highlighted
Observer soteria0
Observer
5,157 Views
Registered: ‎05-22-2014

Re: Standalone SD card read & test program fails

Hi,

 

I am facing the same problem while crating a test program for SD card. I am using ZC706 board and using SDK 2014.2 version. The function call XSdPs_CfgInitialize(XSdPs *InstancePtr, XSdPs_Config *ConfigPtr, u32 EffectiveAddr) is failled in my case. The function does not return any thing....

 

Can anyone have solution for this?

 

 

Monjur

 

 

0 Kudos
3,370 Views
Registered: ‎08-22-2015

Re: Standalone SD card read & test program fails

Hi soteria0,

Sorry for the delayed reply. You can find a detailed tutorial with source code on how to use the SD card on a standalone SDK project targeting the Zynq7000 (Zedboard ) on this link http://embeddedcentric.com/data-logging-using-sd-cards/

 

Regards

Ali

0 Kudos