flash memory problem - mvo

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi group,

I am working with a terminal, 512K RAM (small huh?). Little bit
old-fashioned H8510 micro or so.
I want to calculate a simple 1-byte xor-checksum (crc) over the bytes
written in Flash (where among others the program-code resides). This
is the map from 0 to 80000:

#                            -Z(CODE)INTVEC00%0000-0001FF            
        #
#                            -Z(CODE)BOOT,CODELIBS00%0200-00FE7F      
        #
#                            -Z(CODE)CODE01%0000-01FFFF              
        #
#                          
-Z(CODE)CODELIBS2,CDATA,CONST,CSTR,ZVECT,CCSTR,   #
#                            RCODE02%0000-02FFFF                      
        #
#                            -Z(CODE)CODELIBS303%0000-03FFFF          
        #
...
#                            -Z(CODE)CODELIBS707%0000-07FFFF -R -B -z
        #

With a function called read_mem (from the IAR compiler) I can read
bytes from any place in memory. Also cool! :p
With a small software all works great, the checksum is steady.

The problem is; each time the crc is calculated for a big sized
program in flash, it ends up being a different value.
While I thought the program code in flash was always the same. At both
the first crc-calculating and in my calc-routine the bytes x00 and xFF
are ignored because some blocks in the flash seem to be xFF where the
original byte-code contains x00's.

Can somebody explain why my crc-calculating differs eacht time I
execute the function?

Mark

Re: flash memory problem - mvo
snipped-for-privacy@gmx.net (Mark) wrote in

Quoted text here. Click to load it

Your CRC routine is broken? Run the routine through a debugger and ensure
that given a fixed array of input data that it yields the same answer each
time. And


--
- Mark ->
--

Re: flash memory problem - mvo

Quoted text here. Click to load it

I suspect that you are either including the data area in the CRC (which can
change as you
run the program, especially with interrupts occurring), or that you are reading
an address
that has nothing attached to it, so that the data bus is floating.

Thad

Site Timeline