This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Checksum calculation of a specific part of the code

Is it possible to force the compiler (with a directive or something) to store a specific part of the code in a predefined area in the memory?

What I want to do is to be able to calculate a checksum of some specific functions in my code, so I later can prove that they are unchanged since the last build.

My thought is that if I know in which memory area these functions are located then I can simply calculate a checksum of this area.

Any ideas, someone?

Parents
  • I thik this can help me:
    http://www.keil.com/support/docs/2215.htm

    That will be required but you may still get in trouble because of the linker moving variables. The linker will have an affect regardless of where you locate the critical code.

    I do not know how memory squeezed you are, but there is one solution to keeping objects constant.

    EACH and EVERY (global or local) variable in the critical area must be global this is raquired regardless of method and declared as extern ONLY my method below.

    These variables must be permanently located at absolute addresses in an assembler module.

    There are means (I think) for locating variables at fixed addresses in C, but the above assembler method serves me for fixed location variables.

    Erik

Reply
  • I thik this can help me:
    http://www.keil.com/support/docs/2215.htm

    That will be required but you may still get in trouble because of the linker moving variables. The linker will have an affect regardless of where you locate the critical code.

    I do not know how memory squeezed you are, but there is one solution to keeping objects constant.

    EACH and EVERY (global or local) variable in the critical area must be global this is raquired regardless of method and declared as extern ONLY my method below.

    These variables must be permanently located at absolute addresses in an assembler module.

    There are means (I think) for locating variables at fixed addresses in C, but the above assembler method serves me for fixed location variables.

    Erik

Children