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: 
Visitor wong0977
Visitor
447 Views
Registered: ‎07-24-2018

QSPI .mcs Image Checksum Bootup

Jump to solution

Hi,

May I know how to examine the integrity of the .mcs image during system bootup? The intention is to determine if the .mcs image store in QSPI has not been corrupted. Is there a way to generate a checksum value for the .mcs image initially before flashing into QSPI and subsequently compare it with the one flashed into the QSPI during QSPI bootup to see if the file has been edited. 

Thank you.

0 Kudos
1 Solution

Accepted Solutions
Scholar jg_bds
Scholar
410 Views
Registered: ‎02-01-2013

Re: QSPI .mcs Image Checksum Bootup

Jump to solution

 

Every line of an MCS file contains a checksum at the end. See:

       https://www.xilinx.com/support/answers/476.html

       http://downloads.ti.com/docs/esd/SLAU131S/intel-mcs-86-object-format-intel-option-stdz0792937.html

If you simply have an MCS file stored somewhere in a PROM (e.g., in a file system, of some sort) you can check the MCS file using the checksums, line-by-line.

However: if an MCS file has been used to program a PROM, the address and checksum information from the file was lost. The data from the MCS file was stored in the PROM based on the address information that was included in the MCS file, and the checksum information from that file was used by the programmer to verify the correctness of the data as it was written. So you don't really have an MCS file anymore, in that case; you have only the data from the MCS file.

Generally, to check the veracity of important data, one appends a CRC (which is much better than a checksum) at the end of the data. Before the data is used, a new CRC is computed based on the data after it has been read-back from its storage medium, and then compared against the stored CRC. If the CRC's match, the data can be used.

-Joe G.

 

View solution in original post

3 Replies
Scholar jg_bds
Scholar
411 Views
Registered: ‎02-01-2013

Re: QSPI .mcs Image Checksum Bootup

Jump to solution

 

Every line of an MCS file contains a checksum at the end. See:

       https://www.xilinx.com/support/answers/476.html

       http://downloads.ti.com/docs/esd/SLAU131S/intel-mcs-86-object-format-intel-option-stdz0792937.html

If you simply have an MCS file stored somewhere in a PROM (e.g., in a file system, of some sort) you can check the MCS file using the checksums, line-by-line.

However: if an MCS file has been used to program a PROM, the address and checksum information from the file was lost. The data from the MCS file was stored in the PROM based on the address information that was included in the MCS file, and the checksum information from that file was used by the programmer to verify the correctness of the data as it was written. So you don't really have an MCS file anymore, in that case; you have only the data from the MCS file.

Generally, to check the veracity of important data, one appends a CRC (which is much better than a checksum) at the end of the data. Before the data is used, a new CRC is computed based on the data after it has been read-back from its storage medium, and then compared against the stored CRC. If the CRC's match, the data can be used.

-Joe G.

 

View solution in original post

Visitor wong0977
Visitor
359 Views
Registered: ‎07-24-2018

Re: QSPI .mcs Image Checksum Bootup

Jump to solution

Hi, 

Thanks for the informative reply. Is this also applicable to the .bin file when flashed into QSPI? As you have mentioned earlier, information such as headers and checksum are removed and not write into the QSPI partition during the flash operation.

 

0 Kudos
Scholar jg_bds
Scholar
340 Views
Registered: ‎02-01-2013

Re: QSPI .mcs Image Checksum Bootup

Jump to solution

 

I don't think there's anything stopping you from creating a CRC for the entire .BIN file and storing it in the QSPI.  But how would you check the CRC--in the FSBL? The FSBL is contained in the .BIN file, so you'd have to rely on the file you're checking to check itself. (Note that the SDK Program Flash utility can verify that the .BIN file that it writes to a QSPI reads back correctly. But this initial check doesn't help you if it's possible for the .BIN file to become altered or corrupted later.)

There are some features inside the SW structures that provide verification as the boot process proceeds. See:

     https://www.xilinx.com/support/documentation/user_guides/ug821-zynq-7000-swdev.pdf

You also might want to look into the features of authentication and encryption, if you want rock-solid assurance during boot. See:

     https://www.xilinx.com/support/documentation/application_notes/xapp1225-rtic.pdf

-Joe G.

 

0 Kudos