If you don’t want to use NXP driver (what I would recommend anyway), you may write your own functions as flash simple programming example we have sometimes as following for instance:
https://community.nxp.com/docs/DOC-101849
Specifically for MPC5777C we don’t have prepared such one (standard software drivers are recommended) but you may see for instance following where I used simple programming method for injecting of 2b ECC error:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5777C-1b-2b-FLASH-ECC-error-injection...
Program data per 64-bit in the loop.