[W7500] Flash writing problem

Greetings,

i’m having an issue over writing the flash via IAP. I have a program that writes in flash data from Ethernet.
The code works fine, it gets the data and writes it down on flash on clean sector (code uses 0x4000, i’m writing after 0x10000), BUT if somehow the board restarts while i’m writing, the next time the program runs, the writing process get frozen. The only way to solve it is to reburn the mcu.

There is any solution to avoid this?

Thanks in advance.

I had a similar problem. The IAP function requires use of internal oscillator.

Thank you for replying,

what boggles my mind is the fact that the fault only occurs after a reset mid-process. Without that, the board can stay writing the flash for many cycles.