Hi,
How do you program the PFlash block?
You cannot execute any flash command from the same PFlash block you want to erase/program. The function should be place in RAM.
Also, check whether the PFlash area is protected or not. In case of a protection violation, FPVIOL flag is set in FSTAT register.
Please see the attached example code.
Regards,
Daniel