Thanks Daniel!
The Flash operation is in the flash driver provided in the SDK “S32SDK_S32K1xx_BETA_2_9_0” in the file “flash_driver.c” and the function is “FLASH_DRV_CommandSequence”.
Tried another experiment.
If the same code is flashed, flash erase and program works successfully (verified through LED indication if erase and program is successful).
But the same does not work if it is debugged.
Any specific reason for such behavior?
Thanks!