I wrote a flash driver and it works fine on K70 cpus .
Flash erase works fine and flash programming works fine.
Flash erase starts from address 0x20000 and goes to the end of the flash (1MB for K70) erasing 4kB sector at the time.
However, same code, on K60 cpu, does not work.
When first flash sector erase command is invoked to start erasing from address 0x20000 I get Flash Access Error Flag.
Strange thing is that if I break (breakpoint, IAR) before erase command is invoked, than erase command runs successfully.
What could be causing this? Does anyone have any idea?
I appreciate any help.