As far as I remember in my case the problem was when I erased entire flash memory, reseted the controller and then attemped to program. And the programm failed (as I understood) because after chip-erase flash protection bits are set. And these bits are taken into account only when controller starts up. That is why if you program immediately after erase your write operation would success. Take a look at chapter 17 "ColdFire Flash Module" (CFMPROT-CFM Protection Register)
For programm/verify I use the following algorithm:
0. Verify your "spi" clock sppen confirms the controller specification.
1. EnableEzPort.
2. WriteConfig - to configire Fclk.
3. CheckStatus.
4. BulkErase or SectorErase if you shall programm.
BulkErase: WriteEnable, CheckStatus, CMD_BE, WaitForOperationDone, CheckStatus(WEP,WIP)
if (ok) WriteEnable, UpdateConfig(Fclk)
SectorErase: CheckStatus(WEN), CMD_SE, WaitForOperationDone, CheckStatus(WEP,WIP)
!!! don't use SectorErase for blank(filled with 0xFF) sectors.
5. Programm or verify.
6. DisableEzPort.
I hope this will help you.
And ther is an appeal to motorola engeneers to describe the use of EzPort programming mechanism more detailed.