Hi all,
I have an issue whit calculating the CRC on a flash memory area.
This area is defined in flash memory and it is written periodically every few minutes.
It is written using the function TI_Fee_WriteAsync and the block number is 1.
After the write is finished, there is no error returned by the function and I wait for the Flash status to go back to idle:
do
{
TI_Fee_MainFunction();
stFeeStatus = TI_Fee_GetStatus(GET_LAST_ACTION_STATUS);
}
while (stFeeStatus != IDLE);
After that, I go to calculate the CRC of the flash area using the functions:
trCrcConfig.crc_channel = 0U;
strCrcConfig.mode = CRC_FULL_CPU;
(I'm making sure the start data and size are correct)
/* Reset CRC module channel 0 */
crcChannelReset(ptrCrcRegs, 0U);
/* Calculate CRC */
crcSignGen(ptrCrcRegs, &strCrcConfig);
/* Get the calculated CRC value */
ctCrcValueCalc = crcGetPSASig(ptrCrcRegs, 0U);
When I calculate the CRC the very first time, on that flash memory area, it returns the correct value (I mean, the expected value). but when I write on it with TI_Fee_WriteAsync and then I calculate the CRC again, it doesn't change, it is still the same.
The only way for me to calculate the crc is to use the function TI_Fee_Read so to copy the content into a flash buffer and then calculate the CRC on it. In that case, I see the CRC changing every time i save new values on the flash.
I'm not very sure where the problem could be.
I'm aware that the flash area for bank 1 is above 0xF02XXXXXXU and the flash are I'm try to calculate the CRC is at 0x00039440.
How do I map the bank1 area with with my allocated memory area at 0x00039440? So when i write to the bank1 i can see my allocated memory area changed?
Thanks for your help
Giorgio