2023-02-06 08:56 AM
i use SPC58EC80E1
if feature : flash size 4MB
the flash Consisted of low block, lager block, high block.
I want to write 4byte for low block (0xfc0000) in test1_func().
continuously, I want to write 4byte for low block (0xfc0004) in test2_func()
For example)
flash_low_block_erase(2); //0xfcc0000 erase
one_word_write(0xffc0000,0x12345678);
one_word_write(0xffc0004,0x9abcdef0);
onr_word_write(uint32 address, uint32 value)
{
tt_buffer[0] = value;
/* /* for write is byte unit, UINT32 tt_buffer : 0x04 */
returnCode = FlashProgram(&ssdConfig, FALSE, targetAddress, 4, &tt_buffer[0],
&pgmCtxData);
if (C55_OK == returnCode) {
// // Call FlashCheckStatus() to check status of the progress
while (C55_INPROGRESS == FlashCheckStatus(&ssdConfig,
C55_MODE_OP_PROGRAM, &opResult, &pgmCtxData)) {
//Add your code here
}
if (C55_OK != opResult) {
ErrorTrap(opResult);
}
} } else {
ErrorTrap(returnCode);
}
returnCode = ProgramVerify(&ssdConfig, targetAddress, 4, &tt_buffer[0], &failAddress,&failData, &failSource, &pvCtxData);
if (C55_OK == returnCode) {
/ /Call FlashCheckStatus() to check status of the progress
while (C55_INPROGRESS == FlashCheckStatus(&ssdConfig,
C55_MODE_OP_PROGRAM_VERIFY, &opResult, &pvCtxData)) {
//Add your code here
}
if (C55_OK != opResult) {
ErrorTrap(opResult);
}
}
} else {
ErrorTrap(returnCode);
}
}
But, do memory dump
SD:00FCC0000 : 12345678 FFFFFFFF FFFFFFFF .....
Of course, if you use 0x12345678 0x9abcdef0 continuously, it works well.
tt_buffer[0] =0x12345678;
tt_buffer[1] = 0x9abcdef0;
ProgramVerify(&ssdConfig, 0xFC0000, 8, &tt_buffer[0], ....
==> dump : SD:00FCC0000 : 123456789abcdef0 FFFFFFFF .....
So, I want to know if I write to a specific address in flash at least once, I can't use it again in the area around it.
If not, I want to know if there is a solution.
thanks
best regards.
PLEE
2023-02-06 08:05 PM
problem solved