Hi experts,
My customer wants to achieve a function that cpu2 writes a set of data (from cpu1) to flash every 25 seconds, and the amount of data is small (maybe 16 bytes). The design life of the system should be 25 years, is this feasible?
After the programming is completed, turn off the power for the first time and turn it on again, and the MCU will work normally. When the power is turned off for the second time and turn it on then, CPU1 resets every 4 seconds and CPU2 don't work. It is the same when powering off and on again later, until it is reprogrammed.
The customer tests that if the read Flash operation is not added, the MCU will always work normally when the power is turned off and then turned on again. If read operation is added, the above problem will appear. So they suspect that there is a problem with the read operation.
The customer's read Flash function is as follows:
#pragma CODE_SECTION(Example_CallFlashRead, ramFuncSection);
void Example_CallFlashRead(void)
{
uint32 u32Index = 0UL;
uint16 i = 0U;
for(i=0, u32Index = Bzero_SectorC_start;(u32Index < (Bzero_SectorC_start + WORDS_IN_FLASH_BUFFER)); i+= 1, u32Index+=1)
{
*(ReadBufferCB+i) = *(uint16 *)u32Index;
}
}
Customers still have a doubt about why the buffer (pu32ReadBuffer) in the read function(pu32ReadBuffer) of Flash API functions is 32-bit? When they use *(uint32 *)u32Index, the read data is wrong so they use *(uint16 *)u32Index. They want to view the source code of the API functions, especially the read functions.
Best regards.
Jim