cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
18,489 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

12 Replies
Highlighted
Scholar
Scholar
18,479 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
Highlighted
Scholar
Scholar
18,467 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
Highlighted
Adventurer
Adventurer
18,449 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
Highlighted
Adventurer
Adventurer
18,394 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
17,467 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
Highlighted
Visitor
Visitor
12,910 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
Highlighted
Scholar
Scholar
12,579 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
Highlighted
Newbie
Newbie
10,655 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
Highlighted
Scholar
Scholar
10,642 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
Highlighted
Participant
Participant
4,685 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
Highlighted
Newbie
Newbie
1,679 Views
Registered: ‎08-30-2019

Re: SD Card example design using standalone SDK project

Hi,

I'm looking for an implementation example for SD card read/write with a uZED developement board. The link above looks like what I need, but the link is not working. Can anyone address me?

Thanks

0 Kudos
Observer
Observer
1,638 Views
Registered: ‎04-25-2017

Re: SD Card example design using standalone SDK project

Take a look at the post here

0 Kudos