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 derekyu
Visitor
4,821 Views
Registered: ‎10-03-2016

How to enable FSBL checksum

Jump to solution

In the bare metal FSBL example code, the partition attribute has a ATTRIBUTE_CHECKSUM_TYPE_MASK to enable image checksum check. However, this bit doesn't get enabled in the standard boot image generated using the SDK.

 

There is also a "checksum=<value>" identifier in the BIF file attributes but it requires manually insert a MD5 checksum

 

How can I enable this bit and is there any way to automatically included the MD5 image checksum in the partition header

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor derekyu
Visitor
8,816 Views
Registered: ‎10-03-2016

Re: How to enable FSBL checksum

Jump to solution

It turns out the documentation is not very clear on this. I simply change the BIF file to add [checksum=md5] like:

 

the_ROM_image:
{
    [bootloader]D:\test\fsbl\Debug\fsbl.elf
    [checksum=md5]D:\test\test_soc_hw_platform_0\test_soc.bit
    [checksum=md5]D:\test\test\Debug\test.elf
}

 

bootgen will automatically set the checksum bit and insert the md5 checksum into the partition header.

0 Kudos
5 Replies
Scholar austin
Scholar
4,785 Views
Registered: ‎02-27-2008

Re: How to enable FSBL checksum

Jump to solution

d,

 

Which software version?  The frame checksum is only used on a few bytes to recognize the FSBL.  Perhaps what you really need is to use the HMAC?

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Visitor derekyu
Visitor
4,778 Views
Registered: ‎10-03-2016

Re: How to enable FSBL checksum

Jump to solution

I am using SDK 2015.4.

 

In the bare metal FSBL template code generated, the image_mover.c has the code:

/*
* Check for partition checksum check
*/
if (PartitionAttr & ATTRIBUTE_CHECKSUM_TYPE_MASK) {
    PartitionChecksumFlag = 1;
}

 

Once the flag is set, the FSBL will validate the partition image:

 

if (PartitionChecksumFlag) {
    /*
    * Validate the partition data with checksum
    */
    Status = ValidateParition(PartitionStartAddr,
        (PartitionTotalSize << WORD_LENGTH_SHIFT),
        address +
        (PartitionChecksumOffset << WORD_LENGTH_SHIFT));

....

 

I want to know how I can generate an image with ATTRIBUTE_CHECKSUM_TYPE_MASK set.

 

My intention is to validate the image before fallback to use it. I also want to know if there is way to automatically generate the checksum in the build process.

 

 

 

0 Kudos
Highlighted
Visitor derekyu
Visitor
8,817 Views
Registered: ‎10-03-2016

Re: How to enable FSBL checksum

Jump to solution

It turns out the documentation is not very clear on this. I simply change the BIF file to add [checksum=md5] like:

 

the_ROM_image:
{
    [bootloader]D:\test\fsbl\Debug\fsbl.elf
    [checksum=md5]D:\test\test_soc_hw_platform_0\test_soc.bit
    [checksum=md5]D:\test\test\Debug\test.elf
}

 

bootgen will automatically set the checksum bit and insert the md5 checksum into the partition header.

0 Kudos
Visitor wong0977
Visitor
866 Views
Registered: ‎07-24-2018

Re: How to enable FSBL checksum

Jump to solution

Hi, May I know how to proceed on with the setting of Checksum=md5  in terms of providing an error message if the integrity of the .mcs file has been compromised? To further elaborate, I would like to generate a checksum value initially before flashing into QSPI and compare it with the one flashed into the QSPI during QSPI bootup to see if the file has been edited. The image file can be treated in this case as a hello world program. Thank you.

0 Kudos
Moderator
Moderator
796 Views
Registered: ‎07-31-2012

Re: How to enable FSBL checksum

Jump to solution

Hi @wong0977,

 

The original post is already answered so please create a new post with your query in https://forums.xilinx.com/t5/Embedded-Boot-and-Configuration/bd-p/EmbBoot board to get help.

 

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos