• 0
sgandhi

Reading data from SD card using ZYNQ PS and storing it in DRAM

Question

Hello,

I have a file containing pre-computed decimal values in SD card and I want ZYNQ PS to read this file and store it in the DRAM on ZYBO board.

I do know that the processing_system IP has an SD0 interface present. But, how do I start with this? What exactly will be in my block design when working in Vivado Design Suite? What changes needs to be done when exporting the hardware into SDK?

The text file that will be present in the SD card is attached for the reference.

I read some of the forum discussions on Xilinx but didn't figure out the exact procedure on how to get this working.

Any help will be greatly appreciated.

 

Thank you,

Shyama.

occ_matrix.txt

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @sgandhi,

Here is a forum thread that discusses using the SD card reader along with other pmods on a zynq processor.  I would suggest looking at the xsdps.h and the ff.h.  I know we read files from the SD card in our Pmod WIFI IP Core in the Vivado library here.

best regards,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron,

I went through the forum but I see the discussion is based on the QSPI flash memory. No doubt there is a discussion on booting from the SD card but I am not able to figure it out how!

I also read the xsdps.h file to see how is the SD card code being written. However, I have to first create a block design in Vivado Design Suite and the export it to the SDK!

Is there any tutorial or any reference that will help me get started with this?

 

Best regards,

Shyama

Share this post


Link to post
Share on other sites
  • 0

Hi @sgandhi,

The ZYNQ processor is tied to the SD card reader. 

Are you using a Digilent ZYNQ development board?

If you are using a Digilent Board you should be using the Digilent board files which will handle constraining the SD card. 

The zedboard programming guide tutorial covers how to make a BOOT.BIN and how to use it with the SD card reader.

best regards,

Jon

image.png

Share this post


Link to post
Share on other sites
  • 0

Hi @jpeyron,

I see that the PS has direct connection to the DDR so when I made the block design in the Vivado, I added the SD_0 enabling the pins 40-45 and 47. After the generation of the bit stream, I imported the hardware design in the SDK and further created a new application project (Empty Application Project). 

Next, I used the examples provided in the SDK/2016.4/embeddedsw folder named "xilffs_polled_example.c". I also modified the BSP settings to include "xilffs" library. 

I am also able to program the FPGA now. But how do I create a .bin in sd card and what care is to be taken when creating a file in sd card? I just want to read a .txt file which is present in the sd card. 

I am using ZYBO Z7 board from the digilent.

The file which I want to read from the sd card is attached below for your reference.

Also, I am just reading a file from the SD card. I am not booting from the SD card so the jumper is suppose to be in JTAG mode. Right?

There is a link which you shared above. But isn't that for creating a boot image? How will that help me in my requirements?

 

Thanks for the help,

Shyama.

 

occ_matrix.txt

Share this post


Link to post
Share on other sites
  • 0

Hi @sgandhi,

Sorry i miss interpreted your earlier post. The main_gps_sd.c file attached below is for a zynq processor using the on-board SD card with out an interrupt and the Pmod GPS which should be helpful. 

best regards,

Jon

main_gps_sd.c

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now