cancel
Showing results for 
Search instead for 
Did you mean: 

F4 Flash Write - random or sequential?

martinmartin9129
Associate II
Posted on July 11, 2013 at 15:19

Hello,

is F4 Flash write can be random or only sequential? I've tryed to do

FLASH_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?
10 REPLIES 10
Posted on July 14, 2013 at 13:39

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..