04-02-2015 06:28 AM
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
04-02-2015 07:31 AM
you can do anything in bare metal, if you so wish.
So answer is YES.
04-02-2015 10:53 PM
04-04-2015 11:19 AM - edited 04-04-2015 11:25 AM
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.
04-06-2015 10:48 AM
Hi,
Can anyone help me please?
Thanks in advance.
08-22-2015 01:10 AM
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
10-11-2016 01:31 AM
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
11-29-2016 07:21 PM
06-13-2017 12:52 AM
How to read float data types which are stored in a text file from the SD card?
06-13-2017 06:52 AM
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
07-24-2018 05:49 AM
08-30-2019 08:14 AM
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
09-02-2019 06:35 AM
Take a look at the post here