Hi !
I have ECC error all the time even Flash prefetch is disabled,
I have initialized FLASH_Init at 96Mhz and use it at 12Mhz as well.
I have dumped 16 bytes at different stages, But 512 erase/write in use.
+FMCCR 0x101A
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <--- erased flashmemory
01 00 00 00 00 02 00 00 00 C4 02 10 FF FF FF FF <--------- memory buffer for write
FLASH_Program() new slot at 0x2C000 , size 512
21 00 00 00 00 02 00 00 00 C4 02 10 FF FF FF FF <--- read flash memory directly
116 Unknown status <--- print error 116 ( kStatus_FLASH_EccError)
FLASH_Verify( 116 ) fail, Addr - 0x2C000, Data - 0x2E2E2E2E <-- call verify after that
You can see that first byte have value 0x21 instead of 0x01.
And it can happens in different places.
After that even reading of this memory cause HardFault and erasing of this sector dosn't help, even erase/Verify return OK.
Only mass erase or erase by sectors can recover this flash sector.
Can you explain what can be problems with Flash memory ?
Some caches, prefetches should be not only disabled but also flushed some how ?
MPU is active on nonsecure side. But flash access done via NSC call but source memory buffer on secure side.
Flash API is called with disable interrupts aslo.
__disable_irq();
__DSB();
__ISB();
status = FLASH_Program(&flashInstance, dest_address, (uint8_t*) &buffer[0], sizeof(buffer));
__enable_irq();
__NOP();
verify_status(status);
What can be problem with IAP usage of flash memory ?
Regards,
Eugene