Hi Feike,
It sounds like your not enabling flash for a write. Take a look at the IO Controller spec section 2.1.9 and refer to the FPEN bit. This must be set to 1 to enable a write to flash.
http://www.logicpd.com/do...N_70000015_Rev_D.pdf
Let me know if this solves the issue that you are seeing.
Thanks,