cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Adventurer
Adventurer
20,039 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
Scholar
Scholar
20,029 Views
Registered: ‎11-09-2013

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

 

So answer is YES.

0 Kudos
Reply
Scholar
Scholar
20,017 Views
Registered: ‎09-05-2011

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
Reply
Adventurer
Adventurer
19,999 Views
Registered: ‎12-26-2013

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
Reply
Adventurer
Adventurer
19,944 Views
Registered: ‎12-26-2013

Hi,

 

Can anyone help me please?

 

Thanks in advance.

0 Kudos
Reply
19,017 Views
Registered: ‎08-22-2015

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
Reply
Visitor
Visitor
14,460 Views
Registered: ‎02-05-2015

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
Reply
Scholar
Scholar
14,129 Views
Registered: ‎04-13-2015

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
Reply
Newbie
Newbie
12,205 Views
Registered: ‎06-13-2017

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

0 Kudos
Reply
Scholar
Scholar
12,192 Views
Registered: ‎04-13-2015

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
Reply
Participant
Participant
6,235 Views
Registered: ‎02-22-2016

can we read .jpeg or .bmp files from sd card using application layer functions (f_read,f_write)?
0 Kudos
Reply
Newbie
Newbie
3,229 Views
Registered: ‎08-30-2019

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
Reply
Observer
Observer
3,188 Views
Registered: ‎04-25-2017

Take a look at the post here

0 Kudos
Reply