Hello!
I´ve questions about the data compress flash command of the S12XDP512 MCU:
- Is it possible for the MCU to execute from flash while the data compress command is executed (even if it uses the same flash block?) or must the MCU execute in RAM while the command is running?
- I´ve written a piece of software for the pc to calculate the signature, but I don't get correct results. Maybe I didn't understand the underlying algorithm correct, which is described in the datasheet (S12XFTX512K4V2, page 1135 of the s12xdp512 datasheet; for a single misr):
1) MISR is set to 0xFFFF
2) 0xFFFF is compressed (-> Result is 0x0001)
3) Data is compressed (with address incrementing)
4) Data is compressed (with address decrementing)
5) Result in MISR (on the MCU it is written to FDATA)
I`ve tested this with one word, compressed with the MCU, the Data Compress Util (downloaded from freescale) and my own software:
Here the results: (Testword-Data: 0xFFFF)
MCU: 0xFFFA
Data Compress Util: 0xFFFA
My Software: 0x0004
Here is a line of my software, which calculates the content of the misr:
misr=((misr<<1) | (((misr>>15) ^ (misr>>4) ^ (misr>>2) ^ (misr>>1)) & 0x01)) ^ data;
On Start MISR ist initialized to 0xFFFF and then this line is executed 3 times (init; address increment; address decrement) with data=0xFFFF -> gives 0x0004
What's wrong?
Thanks for help, Noir.