Hi,
I am developing on MPC5746C.
I referred a sample code in below answer and the CRC calculation itself works but I have no idea why the CRC value is different after flash write.
The problem is CRC#2 and CRC#8 is different even if the data is same.
I think the only difference is CSTAT(CRC Current Status) value when I had a look at peripheral register in trace32.
But, still I have no idea why it is different.
The init_edma function is passed through but should I initialize something more?
Here is a current process.
---------------------------------------------------------------------
Let's say it is working on already.
1. A certain command for flash write is received.
2. Calculate CRC of all data in the structure except CRC field
3. Save the CRC value into the structure
: The data structure includes other information and CRC.
for example,
typedef struct st_data{
uint8_t num; //object to be checked from CRC
uint32_t crc;
}st_data
4. Write the data structure including CRC field into flash to store permanently.
5. target reset using trace32
6. Booting
7. Read data from flash and memcpy to the data structure on RAM
8. Calculate CRC data of the data structure (st_data) except CRC field
9. If the CRC value of #8 is same as "st_data.crc", it means no problem with flash read.
-------------------------------------------------------------------------------
Thanks
Katie