Hi @dpchoudh
There's an option to enable Flash Security feature via the FSEC byte in flash configuration field. Take a look at following sections in S32K1 reference manual:
"5.2.1 Flash memory security"
"36.4.4.1.4 Flash Security Register (FSEC)"
If mass erase option is not disabled by MEEN bit field in FSEC, it is possible to run mass erase function even if the device is secured. Then new program can be loaded. If you disable mass erase by MEEN, it's not possible to read the flash and it's not possible to run mass erase.
If CSEc is enabled, the mass erase cannot be perform regardless of MEEN. It's blocked by CSEc. The only option to remove the partition (i.e. disable CSEc) and to enable mass erase again is to run CMD_DBG_CHAL and CMD_DBG_AUTH commands with knowledge of MASTER_ECU_KEY.
So, to answer your questions directly - if CSEc is enabled and if flash security is enabled by FSEC, it's not possible to read the flash and to reprogram the device via JTAG.
Regards,
Lukas