2013-07-11 06:19 AM
Hello,
is F4 Flash write can be random or only sequential? I've tryed to doFLASH_Unlock();
FLASH_EraseSector(FLASH_Sector_8, VoltageRange_3);
for(i=0, EEAddr=EEA;i<32;i++){
FLASH_ProgramWord(EEAddr, ParArray[i]);
EEAddr+=4;
}
FLASH_Lock();
and all works fine, but when I try to do this:
FLASH_Unlock();
FLASH_EraseSector(FLASH_Sector_8, VoltageRange_3);
for(i=1, EEAddr=EEA+4;i<32;i++){
FLASH_ProgramWord(EEAddr, ParArray[i]);
EEAddr+=4;
}
FLASH_ProgramWord(EEA, ParArray[0]);
FLASH_Lock();
the 1st word, that I've tried to write at the end, does not writes.
1st 4 bytes are still ''FF''.
So, write to flash should be sequential?
2013-07-14 04:39 AM
I don't think the point was about the method of delivery, but rather the out-of-order/sequence that was inherent, and thus tickling the bug/failure you're complaining about to a much wider audience. The lack of such reported failures, and the experiences people like Erik and I have, suggests the problem is elsewhere, in code and settings not within the code snippet provided.
To advance this discussion you'll need to condense your problem into some free standing and complete example that illustrates it. Encryption? Not sure that plays a role here, but make sure you're not blowing out buffers or stacks. I'd suggest you instrument your code, and parameters passed to the flashing routines to confirm the process is occurring as you would expect. If the flashing routines report error conditions, you might also want to check the state of the error flags within the flash controller before proceeding, and clear them as required.