cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ivanpb1992
Visitor
Visitor
742 Views
Registered: ‎02-15-2019

How to program non volatile code (SD or flash)

Hello everybody, 

I'm new in Vivado, and I have a ZCU106 evaluation board.

I'm looking for a guide or a tutorial about how to program the FPGA in a Non volatile way (SD or flash)

I've wasted one week searching for it, but I hven't found good results...

First I would like to program just a blink code (Without using SDK or AXI GPIO, in a traditional way) What do you recomend me?

Thank you!

0 Kudos
6 Replies
vnsnhav
Xilinx Employee
Xilinx Employee
717 Views
Registered: ‎04-08-2019

Hi @ivanpb1992,

There are multiple ways to program the flash,

1. Program Flash using Vivado, Please follow the steps mentioned in the Document below Chapter 6.

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_1/ug908-vivado-programming-debugging.pdf

2. program_flash using SDK:

https://www.xilinx.com/html_docs/xilinx2019_1/SDK_Doc/SDK_references/sdk_u_program_flash.html

ivanpb1992
Visitor
Visitor
646 Views
Registered: ‎02-15-2019

Great thank you!

And to program from the SD is there any good tutorial?

Thanks!!!

0 Kudos
dgisselq
Scholar
Scholar
634 Views
Registered: ‎05-21-2015

@ivanpb1992,

Xilinx devices don't have the native ability to boot from an SD card, although many boards do.  For example, I have a board from Digilent (Nexys Video) that allows me to boot an FPGA from an SD card.  Typically the way you do this is to remove the SD card from the board, place the toplevel.bin (or .bit--check your manufacturers instructions) in the root directory of the SD card, put it back on the board and reconfigure the board.  (i.e. power it up, or issue an IPROG command or some such)  On these boards, an attached microprocessor (PIC) will read the design from the SD card and feed it to the FPGA via either the JTAG port or the SPI flash pins.

While you can reconfigure the FPGA from the SD card, and even read or write to the SD card, it usually takes more work.  In one recent project, I did boot entirely from the SD card.  I sent my customer the SD card, with the bit file on it, and he just plugged it in and went.  To get the CPU software running, the FPGA needed to contain a small (64kB) bootloader that would read a file from the SD card, using an SD card controller attached to the FATFS file system library, into memory.  The CPU would then jump to this memory and start executing instructions.  I had thought about using the CPU to program a second flash image onto the flash, but just haven't gotten that far yet.

Dan

ivanpb1992
Visitor
Visitor
528 Views
Registered: ‎02-15-2019

Thank you!!!

Yes, ZCU106 has an SD card and there is a .bin file and a .ub file inside it.

So, I only need the .bin file? and put the boot switches in SD mode

No FSBL, no. elf, no .ub, right?

Thank you so much!

0 Kudos
dgisselq
Scholar
Scholar
511 Views
Registered: ‎05-21-2015

@ivanpb1992,

No FSBL, no. elf, no .ub, right?


In my case, I wasn't starting a Zynq, but I was booting a CPU.  I had also placed my own first-stage boot loader (FSBL) into the FPGA's block RAM.  Hence, once the design was loaded from the SD card, it started running immediately from the logic in block RAM.  I don't know if you can do this with the Zynq or not.  That logic in the block RAM then read a program (software) from the SD card and wrote it to DDR3 SDRAM, then jumped to that location to start the software.

My point is, it's one thing to load the FPGA from an SD-card, and a second thing to get software running from an SD-card.  It's doable, but you might find it takes some work.

Is your intent to start Linux?  If so, my experience doesn't extend that far.

Dan

 

 

0 Kudos
ivanpb1992
Visitor
Visitor
506 Views
Registered: ‎02-15-2019

Thank you for your fast answer, 

My intention it's to program the FPGA in a non volatile way as easy as possible, and my code project it use only HW (no linux or any processor).

By the way, ZCU106 has processors so I could programme it download the program from the SDcard or the flash, and programme the FPGA...

Thank you!

0 Kudos