STR750 flash programming problem

I had problems with normal flash writing using OpenOCD so I tried this:

I tried to program the flash from my code in RAM, but when I execute the first flash command all the flash registers go to: 0xe6000010 (that’s what suppose to happen) and then they stay that way untill reset (that’s my problem). The same thing happens when I write to the NV flash protection registers.

I’m using YAGARTO, OpenOCD, LPT Wiggler JTAG and a STR751FR1 ARM.

The functions that I use come from ST and in debug everything seems OK (except of course the "0xe6000010’ moment).

All RAM debugging (using peripherals etc.) works fine too.

Did anyone have a similar problem? Because I try and I try to program the flash but everything fails so far.

I would be very grateful for any help