While writing/erasing flash at some random instance controller was continuously arriving in Flash Command Complete Interrupt. The behavior was very random and occurring very rarely.
While searching for solution I observed that same ISR was mentioned for flash command complete and read collision error interrupt in Vector table (vector.c). Both cases are seemed to be handled in ISR too. But while writing and erasing flash only command complete interrupt is enabled/disabled but not Read Collision interrupt. When I added enabling and disabling of Read Collision interrupt in parallel to Command Complete interrupt the issue was observed to be resolved. So I have following questions:
Controller: K10_100 Series controller without FlexMemory.
Processor Expert Version: Driver Suite v10.4
As you may notice, since you only have one flash controller and to ensure the information stored in the memory is reliable, is recommendable to use one flash operation at the time. If you have more than one, the information stored could not be reliable and that could be the reason is not enabled by default
So be careful with the flash operations that this not use the same flash space.
This is only to notify if there was a flash operation while you called another one if you look at the Flash_main and see the condition, it only returns to the main if this kind of error happens to not overlap flash operations.