cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
4,859 Views
Registered: ‎09-30-2011

Simplest of Simple Zynq Multiboot - How?

Jump to solution

I have been struggling with this conundrum even though it ought to be simple and straight forward. I want to build a single bin file to have an update and golden image for my Zynq with  QSPI PROM. There is no OS. My golden image has {FSBL,Bitstream, App}. I use bootgen and build a bin file to make a successfully executable image. Yay.

 

I have a golden image which I can also make a bin file out of using bootgen. I can program it to my Zynq and it works , too

 

It looks like I can take the update bin file and program it at address 0x00000 and I can take the golden image an program it at address 0x6D0000 and that seems to work too.

 

What I am struggling with is how to build a bif file to create a single bin file to program my PROM to make the whole fallback multiboot arrangement work. Can that be done? bootgen seems to add things that make the resulting bin file non-functional. Any guidance out there? This should be easy, I know it!

 

0 Kudos
1 Solution

Accepted Solutions
5,847 Views
Registered: ‎09-30-2011

So, in the end, to close out this query, you do not use bootgen to make a single complete multiboot image. You take a bin file that you generated from bootgen as a golden image and another that you generated from bootgen as an update image.  You combine them by writing a simple script (I did it in python, there's not much to it) that takes the update bin and puts it at as the top of the file (address 0x000000). I have a command line switch that allows you to choose an 32KB aligned address at which to put the golden bin image. The script fills the bytes between the end of the update image and the start of the golden image with 0xFF (the erased PROM cell value) and then appends the golden image. For completeness, the script fills the bytes between the end of the golden image with the end of the PROM with 0xFF. The resulting bin image can be programmed using any of the Xilinx tools and is accepted as a file by programming houses that preprogram PROMs.

 

There it is. I hope this helps and saves you some time.

View solution in original post

0 Kudos
10 Replies
kvasantr
Moderator
Moderator
4,815 Views
Registered: ‎04-12-2017

Hello neil@formidableengineeringconsultants.com,

 

The basic demand of multi boot functionality is to have a backup golden bit stream; which will handle the basic functionality if there is any fallback with updated bit stream.

 

I believe you are asking if we can have only one bit stream and have same functionality, Please correct me if I am wrong.

 

This may not work; because it goes against the basic requirement of multi boot which is multiple bit streams.

 

Hope this helps.

Thank you.

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
4,806 Views
Registered: ‎09-30-2011

No.Not exactly. Sorry for the confusion. I have two images an update image bin file (containing FSBL_update, bit update, application update) and a golden image bin file (containing FSBL golden, bit golden, application golden). What confounds me is how to combine these two bin files into a single bin file using bootgen. The documentation seems to suggest that you should not do this rather that you should program your update image bin at 0x000000 and your golden image bin at 0x6D0000 (say) as two separate bin files. 

 

Is there a way to combine them into a single bin file?

0 Kudos
kvasantr
Moderator
Moderator
4,783 Views
Registered: ‎04-12-2017

Hello neil@formidableengineeringconsultants.com,

 

Yes that is the only correct method of multi boot.

 

Since you expect to have multi boot functionality combining both of them as one will not fulfill that.

 

Hope this helps clear your query.

 

Thank you.

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
4,770 Views
Registered: ‎09-30-2011

Well, not exactly. You see I want to provide a single file to my programming house for them to program in my QSPI. It would be great if bootgen or some other tool can be used to concatenate and pad (as appropriate) my two bin images into a single bin image. If such a tool does not exist, it is easy enough to write. That, I suppose, is the essence of my question

0 Kudos
5,848 Views
Registered: ‎09-30-2011

So, in the end, to close out this query, you do not use bootgen to make a single complete multiboot image. You take a bin file that you generated from bootgen as a golden image and another that you generated from bootgen as an update image.  You combine them by writing a simple script (I did it in python, there's not much to it) that takes the update bin and puts it at as the top of the file (address 0x000000). I have a command line switch that allows you to choose an 32KB aligned address at which to put the golden bin image. The script fills the bytes between the end of the update image and the start of the golden image with 0xFF (the erased PROM cell value) and then appends the golden image. For completeness, the script fills the bytes between the end of the golden image with the end of the PROM with 0xFF. The resulting bin image can be programmed using any of the Xilinx tools and is accepted as a file by programming houses that preprogram PROMs.

 

There it is. I hope this helps and saves you some time.

View solution in original post

0 Kudos
boyerkg
Observer
Observer
4,292 Views
Registered: ‎08-18-2017

Hi All,

 

I'm building a Quad Spi controller that allows us to write and read the flash.

 

We would also like to read the flash to check the CRC32, either single image or multi-boot.

 

Do you know which bytes are included in the CRC32?  This is my example mcs file, start.

 

Are the bits of each byte bit swapped?  I would like a concrete example, if anyone has one.

 

I have the CRC32 polynomial parallel bit serial xor tree, I think?

 

Keith

 

:020000040000FA
:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
:10002000000000BB11220044FFFFFFFFFFFFFFFFA6
:10003000AA995566200000003003E0010000026B21
:10004000300080010000001220000000300220017A
:1000500000000000300200010000000030008001BC
:1000600000000000200000003000800100000007B8
:1000700020000000200000003002600100000000AD
:100080003001200102003FE53001C0010000010005
:10009000300180010363609330008001000000099B
:1000A000200000003000C001000004013000A00169
:1000B000000004013000C001000000003003000116
:1000C00000000000200000002000000020000000D0
:1000D00020000000200000002000000020000000A0
:1000E00020000000300020010000000030008001EE
:1000F00000000001200000003000400050251C508E
:1001000000000000000000000000000000000000EF

0 Kudos
guillaumeibanez
Visitor
Visitor
3,194 Views
Registered: ‎05-12-2018

Hi,

I'm opening this post because my question is linked to this one.

In a context of sofety of operation, I would like to know if it's possible to:

- have multiple (same) FSBL in QSPI memory, and load from the first one to the second one... when the FSBL is not correct

- then, load the image (u-boot,bitstream and app elf) in the NAND memory and load the second one (probably different than the first one) when the image is not correct

boot.png

Finally, which level of trust can we have in the eFuse memomry in terms of radiation? 

 

Thank you

Guillaume

0 Kudos
joaragj
Observer
Observer
2,055 Views
Registered: ‎09-10-2018

Glad it worked out for you. I am having the same issue as well. Would you mind sharing your script with us?

0 Kudos
aniltirli
Observer
Observer
964 Views
Registered: ‎12-23-2018

We need the same thing for production. Can you share your python script for reference ?

0 Kudos
grigosback
Visitor
Visitor
732 Views
Registered: ‎08-01-2018

Hi @joaragj @aniltirli , I made the python script described by neil@formidableengineeringconsultants.com, I don't know if it necessary to complete the image with 0xFF, but doing that works for me (I didn't try the other way)

 

#%%
import numpy as np

# Specify your QSPI size, in this case 16 MB
qspi_size = int(16 * 1024 * 1024)
# Set the offset of the first image, it has to be a multiple of 32 KB
offset_0 = 0
# Set the offset of the second image, it has to be a multiple of 32 KB
offset_1 = 32 * 1024 * 12
# Set the array that contains the output image data
bin_out_data = np.ones(qspi_size, dtype=int) * int("0xFF", 0)
#%%
# Open the first image in bin_in0_fd, change "Hello_World_1.bin"
# to the path of your first image
bin_in0_fd = open("Hello_World_1.bin", "rb")
bin_in0_data = np.asarray(list(bin_in0_fd.read()))
bin_in0_size = bin_in0_data.size
bin_in0_fd.close()
# %%
# Open the second image in bin_in1_fd, change "Hello_World_2.bin"
# to the path of your second image
bin_in1_fd = open("Hello_World_2.bin", "rb")
bin_in1_data = np.asarray(list(bin_in1_fd.read()))
bin_in1_size = bin_in1_data.size
bin_in1_fd.close()
# %%
# Open and write the output image, change "BOOT.bin" to the path of your
# output image
bin_out_fd = open("BOOT.bin", "wb")
bin_out_data[offset_0 : offset_0 + bin_in0_size] = bin_in0_data
bin_out_data[offset_1 : offset_1 + bin_in1_size] = bin_in1_data
bin_out_fd.write(bytearray(bin_out_data.tolist()))
bin_out_fd.close()

 

0 Kudos