UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant jimfred
Participant
9,792 Views
Registered: ‎10-31-2011

How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution
I have a PL design running on a Zynq. At this stage of development, the PS is not used, not even for a clock. The design runs in the PL. The next step is to burn the design into SPI flash so that it auto-starts upon power up. The toolset used is Vivado 2014.2

 

Things I tried...

  • I tried both a Zybo and MicroZed board. Each has a Spansion S25FL128S, which is a 128 Mb, x4 SPI powered at 3.3V.
  • The jumpers on the Zybo and MicroZed are configured to boot from SPI flash
  • I tried using both write_cfgmem and Bootgen to create a .mcs file. 
    There are no errors when creating or downloading the .mcs file but, when booting from power-up the the Done LED doesn't turn on (the Done LED turns on and the design runs when downloading the .bit file over JTAG).
    I successfully use write_cfgmem to build .mcs files to boot Artix and Kintex designs but the same approach doesn't seem to work on a Zynq.
Documentation referenced...

Questions:

  • Is bootgen the appropriate tool to use?
  • Can the PL boot from SPI Flash without the PS configured or running?
  • If bootgen is the tool to use and a PS is not required, what do I put in the .bif file?
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Participant jimfred
Participant
14,843 Views
Registered: ‎10-31-2011

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

It works!

 

Here's the recipe:

  • Starting with a working PL design in Vivado...
  • Added a block design IP with just a Zynq. The Zynq had its Quad SPI Flash enabled and most everything else disabled. 
  • Instantiated the Block Design IP with nothing connected.
  • After Synth & Imp, exported the Hardware (and .bit file) to SDK and then opened the SDK.
  • Inside the SDK, added new app project using fsbl template. Made sure the fsbl project would run in the debugger then stopped the debugger before the next steps.
  • In the SDK, used menu Xilinx Tools / Create Boot Image and created a .bif file. This .bif file had just two entries: [1] a (bootloader) entry that referenced the newly created fsbl .elf file built by the SDK and [2] the .bit file for the PL design built by Vivado. The output for this step is a .bin file that is downloaded to SPI flash.
  • In the SDK, used menu Xilinx Tools / Program Flash, referencing the newly created .bin file, selecting a flash type of qspi_single. Offset was left blank. During programming, the PL stopped running on the board (as expected) and did not start running until the board was reset with a power cycle.
  • Boot time was very fast - maybe less than 1 second.
7 Replies
Explorer
Explorer
9,773 Views
Registered: ‎11-09-2013

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

Do you have the FSBL built and generated to include in your MCS? My understanding is that at a minimum, you still need at least the FSBL to run on the PS side prior to being able to use the PL. On the Zynq, the PS and PL are more closely coupled / have a sequencing requirement compared to competing product(s), where the analogous PS and PL may be treated more separately. This could either be a desired or undesired behaviour for your particular application.

0 Kudos
Participant jimfred
Participant
9,766 Views
Registered: ‎10-31-2011

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

That implies that maybe the PS does need to be configured to get the PL to boot. I'll try configuring a PS and generating a fsbl. The reason I thought a fsbl might not be necessary is that JTAG can initialize the PL and get it running without having a PS configured. 

 

I'd love to get my hands on the document or information I'm missing or have overlooked regarding the boot sequence and the required ingredients to boot. Most information I've found describes booting an OS but I want to do something simpler - just boot the PL.

0 Kudos
Explorer
Explorer
9,762 Views
Registered: ‎11-09-2013

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

I don't recall the exact documentation -- it's probably just synthesized in my brain at this point after a year or two with the Zynq and similar products and countless training seminars. I do recall that the PS can configure level shifters between the PS and PL, which would definitely be needed to get the bitstream into the fabric.

 

I think a simple FSBL should be sufficient, but I suppose you could always make a MCS with the FSBL, Bitstream (FSBL will load the bitstream) and then a simple app that is while(1). That should be a complete image that gives you the PL functionality -- you could try reducing ARM clocks, disabling the PLLs and other methods to reduce power, though I imagine you will eventually want to use the PS (otherwise why select the Zynq?), so perhaps it is not worth investing time in that.

Highlighted
Participant jimfred
Participant
14,844 Views
Registered: ‎10-31-2011

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

It works!

 

Here's the recipe:

  • Starting with a working PL design in Vivado...
  • Added a block design IP with just a Zynq. The Zynq had its Quad SPI Flash enabled and most everything else disabled. 
  • Instantiated the Block Design IP with nothing connected.
  • After Synth & Imp, exported the Hardware (and .bit file) to SDK and then opened the SDK.
  • Inside the SDK, added new app project using fsbl template. Made sure the fsbl project would run in the debugger then stopped the debugger before the next steps.
  • In the SDK, used menu Xilinx Tools / Create Boot Image and created a .bif file. This .bif file had just two entries: [1] a (bootloader) entry that referenced the newly created fsbl .elf file built by the SDK and [2] the .bit file for the PL design built by Vivado. The output for this step is a .bin file that is downloaded to SPI flash.
  • In the SDK, used menu Xilinx Tools / Program Flash, referencing the newly created .bin file, selecting a flash type of qspi_single. Offset was left blank. During programming, the PL stopped running on the board (as expected) and did not start running until the board was reset with a power cycle.
  • Boot time was very fast - maybe less than 1 second.
Observer kwolfe81-bah
Observer
8,621 Views
Registered: ‎08-12-2010

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

jimfred,

 

Sorry for digging up an old thread, but I need to thank you for your post.  I had to do exactly what you were doing, and your recipe got me there much faster than had I done it on my own.  These steps should definitely be included in some sort of user guide - but like most things with Xilinx, some old forum post contains the small nugget of information I really need.

 

Thanks again.

0 Kudos
Visitor raghav.vlsi
Visitor
7,577 Views
Registered: ‎07-22-2015

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

hi 

 

i done by adding the pl logic to zynq processor.

but my question is how to invoke the processor and pl .

 

please give me step by step process.

 

i need this inf.

 

mymail id gutti.raghu@gmail.com

my task is to spi flash using ps and pl

give the inf thanku

0 Kudos
Visitor raghav.vlsi
Visitor
7,572 Views
Registered: ‎07-22-2015

Re: How can I build a .mcs file to boot the PL on a Zynq from SPI flash?

Jump to solution

provide me doc file if possible ite imp for me

 

 

0 Kudos