Forum Discussion

PHJ's avatar
PHJ
Icon for Occasional Contributor rankOccasional Contributor
7 years ago

mkpimage in Boot Tools User Guide

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 ?

5 Replies

  • PHJ's avatar
    PHJ
    Icon for Occasional Contributor rankOccasional Contributor

    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

  • Nooraini_Y_Intel's avatar
    Nooraini_Y_Intel
    Icon for Frequent Contributor rankFrequent Contributor

    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

  • PHJ's avatar
    PHJ
    Icon for Occasional Contributor rankOccasional Contributor

    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​

  • MelvinSwee_T_Intel's avatar
    MelvinSwee_T_Intel
    Icon for Occasional Contributor rankOccasional Contributor

    hi, Paul

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

    Melvin​

  • Ahmed_H_Intel1's avatar
    Ahmed_H_Intel1
    Icon for Frequent Contributor rankFrequent Contributor

    Hi Paul,

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

    Regards

    Ahmed