Hi Jing !
In my case I have enable MPU and WriteBuffer, L1 Code and System caches. I try to have better performance for some math operations . In MPU all execution from RAM is disabled and I have created special section where allocate all code
from flash drivers what should be executed.
Should I really disable WriteBuffer, Invalidate code and system caches before and/or after erase/write operations to flash memory ?
Also I have some interrupt driven peripherals and FreeRTOS and I found out that ,for avoid sudden reboot
, I should disable/enable all interrupts or almost all. In case writing operations, writing whole sector 4KB is not even possible, may be it take long time and reboot happens without any hardfault and etc.
asm volatile ("cpsid f"); // or
//asm volatile ("cpsid i");
result = FLASH_Erase(&s_flashDriver, destAdrss, pflashSectorSize, kFTFx_ApiEraseKey);
//asm volatile ("cpsie i"); // ror
asm volatile ("cpsie f");
The same with FLASH_Write()
What can be recommendation for handle interrupts while Flash erase/write operations ?
In my design I have used LLS3 low power mode.
What can be recommendation for handle Write buffer/L1 Code and System caches when I go in/resume to/from LLS3 mode ?
Thank you !
Regards,
Eugene