Sorry, you need to enable JavaScript to visit this website.

Writing a File to Flash memory and reading it from PS/PL

Unsolved
9 posts / 0 new
ash3409's picture
ash3409
Junior(0)
Writing a File to Flash memory and reading it from PS/PL

Is it possible to write a file to Flash memory in Zedboard without Linux?
Suppose the file has some hex values, can we directly write it to flash memory using any software? Can it be done with vivado 2014.1?
After writing the data to Flash memory is it possible to read this data from PL through vhdl file?
Or should it be read from PS first(using SPI code in C)?

fletch's picture
fletch
Moderator(15)
I would start with some of

I would start with some of the bare metal examples that Xilinx provides. Here's where to find them in 2014:
C:\Xilinx\SDK\2014.4\data\embeddedsw\XilinxProcessorIPLib\drivers\qspips_v3_1\examples
 
And 2015.2:
C:\Xilinx\SDK\2015.2\data\embeddedsw\XilinxProcessorIPLib\drivers\qspips_v3_2\examples
 
I do not believe it is possible to readback the QSPI attached to the PS MIO through the PL. If really wanted to do that (and you don't care to have a QSPI that isn't a boot source), then you could add a QSPI Pmod to one of the PL Pmods. Then you can use IP in the PL to talk to the QSPI.
 
Bryan
 
 

zedhed's picture
zedhed
Moderator(22)
RE: Writing a File to Flash memory and reading it from PS/PL

Hi ash3409,

There is also an example of how to do this as part of Lab 11 of "Developing Zynq®-7000 All Programmable SoC Software" on the training page.

http://microzed.org/support/trainings-and-videos

That lab has an example application that writes a MAC address (byte data) into Flash memory and then reads it back.

Regards,

-Kevin

ash3409's picture
ash3409
Junior(0)
Bryan,

Bryan,

Thanks for your reply. I went through those examples. It helped understanding QSPI better.
Regarding Pmod, I want to use the available flash memory instead of an external peripheral. So trying to use the QSPI Nor Flash.

Kevin,
Thanks for the reply. I happened to go through the tutorial and had tried it before. But the problem is the application they have developed for this is too specific. It reads just 6 bytes from the teraterm and writes it to Flash. That too it needs it with a prefix mac. My file will be very big and I couldnt figure out how to send file from tera term application. So I think there will be lot of changes needed in the c code they have.

ash3409's picture
ash3409
Junior(0)
Also, another option I was

Also, another option I was thinking was Xillybus. Can I do the writing/reading operation to flash memory using Xillybus?
Please let me know.

zedhed's picture
zedhed
Moderator(22)
RE: Writing a File to Flash memory and reading it from PS/PL

Hi ash3409,

You are correct, the lab application is a simplistic adaptation of the example code that Bryan pointed out. Now I have a better understanding that you have some file with HEX data that you simply want to transfer over to flash without having to use Linux.

If you are just trying to program a file into flash memory, have you looked into how U-Boot accomplishes this?

Before Xilinx SDK added support for programming QSPI Flash with an MCS file, we used U-Boot to program BOOT.BIN from an SD card into the QSPI Flash on ZedBoard using the following commands:

1) mmcinfo

2) sf probe 0 0 0

3) sf erase 0 0x800000

4) fatload mmc 0 0x8000 BOOT.BIN

5) sf write 0x8000 0 0x800000

Basically, these steps copy BOOT.BIN from the SD card into memory and then write that data found in memory over to the QSPI Flash.

This is also documented here:

http://www.wiki.xilinx.com/U-boot

Regards,

-Kevin

ash3409's picture
ash3409
Junior(0)
Thanks Kevin.

Thanks Kevin.
I will go through this.

mtn3325's picture
mtn3325
Junior(0)
Spansion provides Spansion Flash File System (FFS) for use after

I see this mention in the Zynq Evaluation and Development Hardware User's guide:

Spansion provides Spansion Flash File System (FFS) for use after booting the Zynq EPP.

Where can I find the File System? I want to use it to write and read QSPI flash in Linux.

Thanks,
Mike

TroutChaser's picture
TroutChaser
Moderator(18)
Hello Michael,

Hello Michael,
 
Take a look here: http://www.spansion.com/Support/Pages/DriversSoftware.aspx
 
-Gary