Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12595 Discussions

mkpimage in Boot Tools User Guide

PHJ
New Contributor I
1,894 Views

In section 7.3.2 of the Boot Tools User Guide (ug-1137 | 2018.09.24) is the following description​:

"The header checksum for both versions of the mkpimage header is the CRC checksum of the byte value from offset 0x0 to (n*4)-4 bytes where n is the program length."

Surely, this is the image CRC and not the header checksum ? .....also the description of n seems to apply to version 0 of the header and not version 1.

Is the program length in version 1 of the header guaranteed to be a multiple of 4 bytes ?

0 Kudos
5 Replies
Nooraini_Y_Intel
Employee
692 Views

Hi,

 

Currently I am reviewing the forum for any open questions and found this thread. I apologize that no one seems to answer this question that you posted. Since it has been a while you posted this question, I'm wondering if you have found the answer? If not, please let me know, I will try to assign/find someone to assist you. Thank you.

 

Regards,

Nooraini

0 Kudos
PHJ
New Contributor I
692 Views

Hi Nooraini -

 

I've moved beyond this now assuming that the description was for the image CRC and not the header CRC and that (n*4)-4 should be used for version 0 header, and (n-4) should be used for version 1 - it would be good to get confirmation that the documentation is indeed incorrect though, and that the program length is guaranteed to be a multiple of 4 bytes.

 

Thanks,

 

Paul​

0 Kudos
MelvinSwee_T_Intel
692 Views

hi, Paul

 

Thank you for the updates. Appreciate your sharing, please let me know if you need any further assistance.

 

Melvin​

0 Kudos
Ahmed_H_Intel1
Employee
692 Views

Hi Paul,

Can you please explain more to me how you confirmed that the document is incorrect?

Regards

Ahmed

0 Kudos
PHJ
New Contributor I
692 Views

Hi Ahmed -

 

I confirmed this by adding a validation routine for new bootloader images that had version 1 of the header - the checksum was correct when done over (n-4) bytes ​- it also makes sense that the length (n) in version 0 headers are in 32-bit words compared with bytes in the version 1 header and therefore needs the x4 factor in the calculation only for version 0 headers.

The text "header checksum" is just incorrect - the header checksum is just the checksum of the header portion of the image - the image checksum is what is described.

 

Best Regards,

 

Paul

Reply