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: 
Adventurer
Adventurer
16,002 Views
Registered: ‎12-26-2013

SD Card example design using standalone SDK project

Hi,

 

I'm using a Zedboard and Vivado tool. I'm trying to load some image files(.bmp and .jpeg) onto the SD card of the Zedboard.

I'm using a Zynq-based SDK project and I want to know if it is possible to load/store image files from/to an SD card using standalone (bare-metal) OS?

 

Thanks in advance.

 

Mariem

10 Replies
Scholar trenz-al
Scholar
15,992 Views
Registered: ‎11-09-2013

Re: SD Card example design using standalone SDK project

you can do anything in bare metal, if you so wish.

 

So answer is YES.

0 Kudos
Scholar sampatd
Scholar
15,980 Views
Registered: ‎09-05-2011

Re: SD Card example design using standalone SDK project

In addition, refer to chapter LibXil FFS in the following guide:
http://www.xilinx.com/support/documentation/sw_manuals/xilinx2014_4/oslib_rm.pdf
0 Kudos
Adventurer
Adventurer
15,962 Views
Registered: ‎12-26-2013

Re: SD Card example design using standalone SDK project

Hi,

 

Thank you for your reply.

I know taht the Zynq PS SD/SDIO peripheral controls communication with the ZedBoard SD Card.

I am trying to run a standalone project to open and read an image file (.jpeg) from the ZedBoard sd card as follow:

 

 

#include <stdio.h> 

#include "xsdps.h"
#include "platform.h"
#include "xbasic_types.h"
#include "xparameters.h" 


int main()
{

u8 RxBuffer[512*2];

int Status;
// SDIO Controller Test
static XSdPs ps7_sd_0;
XSdPs_Config * SdConfig_0;
SdConfig_0 = XSdPs_LookupConfig(XPAR_PS7_SD_0_DEVICE_ID); //XPAR_PS7_SD_0_BASEADDR
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;
}
else {
print("Sd0 Initialization succeed !\n\r");
}
// read and write test
Status = XSdPs_ReadPolled(&ps7_sd_0,1, 1, RxBuffer);
if (Status != XST_SUCCESS) {
print("Sd0 Read failed !\n\r");
return XST_FAILURE;
}

 

return 0;
}

 

The problem was in the Read function, it fails!

 

Could you help me please.

Thank you in advance.

 

0 Kudos
Adventurer
Adventurer
15,907 Views
Registered: ‎12-26-2013

Re: SD Card example design using standalone SDK project

Hi,

 

Can anyone help me please?

 

Thanks in advance.

0 Kudos
Highlighted
14,980 Views
Registered: ‎08-22-2015

Re: SD Card example design using standalone SDK project

Hi Makni,

You can find a detailed tutorial with the 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
Visitor yomna87
Visitor
10,423 Views
Registered: ‎02-05-2015

Re: SD Card example design using standalone SDK project

Hi embeddedcentric,

I tested your example but unfortunately does not working. 

when I launch SDK there is no result.

I don't know what is the problem.

Please help me 

thank you very match

Yomna

 

 

 

test.png
0 Kudos
Voyager
Voyager
10,092 Views
Registered: ‎04-13-2015

Re: SD Card example design using standalone SDK project

If you want to try another package, we make available a driver package for the Zynq (BSD license : meaning free) with working example on SDK for the ZedBoard.
code-time.com

0 Kudos
Newbie vnagendra24
Newbie
8,168 Views
Registered: ‎06-13-2017

Re: SD Card example design using standalone SDK project

How to read float data types which are stored in a text file from the SD card? 

0 Kudos
Voyager
Voyager
8,155 Views
Registered: ‎04-13-2015

Re: SD Card example design using standalone SDK project

If the SD card is formatted with a file system, e.g. FAT 32, you'll need a File system stack and then you can use the stack I/F to open & read the file contents.

If it is raw, then it's sector by sector you'll have to read.

In both  cases, once the data has been retrieved from the SD card, use sscanf() for example and that will convert your text (ASCII) floating point numbers in binary numbers

 

Regards

0 Kudos
2,198 Views
Registered: ‎02-22-2016

Re: SD Card example design using standalone SDK project

can we read .jpeg or .bmp files from sd card using application layer functions (f_read,f_write)?
0 Kudos