Calculating a CRC32 for program code over multiple pages via prm instructions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calculating a CRC32 for program code over multiple pages via prm instructions

Jump to solution
2,442 Views
Stephen
Contributor III
I have an application whose program code spans several 16k pages of Banked ROM.
I am trying to use the prm CHECKSUM instruction to calculate a CRC32 value for the program code, however I cannot find the right syntax for the CHECKSUM block to do this.
I have tried the following:
 
CHECKSUM
    CHECKSUM_ENTRY
        METHOD_CRC32
        OF      READ_ONLY   0x4004 TO 0x7FFF, 0xC000 TO 0xFFFF
        INTO    READ_ONLY   0x4000 SIZE 4
        UNDEFINED 0xFF
    END
END
and
CHECKSUM
    CHECKSUM_ENTRY
        METHOD_CRC32
        OF      READ_ONLY   0x4004 TO 0x7FFF
        OF      READ_ONLY   0xC000 TO 0xFFFF
        INTO    READ_ONLY   0x4000 SIZE 4
        UNDEFINED 0xFF
    END
END
Both generate error message from the linker
I am currently Code Warrior running version 4.5
Any suggestion please?
Steve
Labels (1)
Tags (1)
0 Kudos
1 Solution
661 Views
CrasyCat
Specialist III
Hello
 
That would be a feature request (or a change request).
I would recommend you to submit a service request for that through our web interface to ask for this extension.

Click here to submit a service request.
 
CrasyCat

View solution in original post

0 Kudos
5 Replies
661 Views
CrasyCat
Specialist III
Hello
 
  You cannot compute a checksum across page boundary.
  You need to define a CHECKSUM_ENTRY block for each page you are using in your PRM file.
 
  Checksum calculation cannot be performed on non-contiguous memory area.
  Also you cannot have several memory areas specified in a CHECKSUM_ENTRY block.
 
CrasyCat
0 Kudos
661 Views
Stephen
Contributor III
Thanks very much for your answer - not what I was hoping for but there you go. Is there any chance that Metrowerks will extend the checksum functionality in the future?
Steve
0 Kudos
661 Views
CompilerGuru
NXP Employee
NXP Employee
What's the gain of having a single checksum for two areas compared to 2 checksums for two separate areas?
In the end the code computing the checksum at runtime has to know the boundaries of the two areas explicitely anyway. I doubt that the single checksum area uses less flash as it explicitely has to combine the two checksum while the 2 checksum version can just reuse the same code twice.

It's a different story when we have 10 pages with the same range in each page, then a combined checksum would help a bit, but I doubt much.
Daniel
0 Kudos
661 Views
Stephen
Contributor III
Simple - the reason is that the customer specification asks that we give a single CRC32 checksum for the complete code.
0 Kudos
662 Views
CrasyCat
Specialist III
Hello
 
That would be a feature request (or a change request).
I would recommend you to submit a service request for that through our web interface to ask for this extension.

Click here to submit a service request.
 
CrasyCat
0 Kudos