Hi Kerry,
Thanks for the reply,
One mistake from our side , we were trying to program MK22FX512VLQ12 using MK22FX512AVLQ12 Project.
So we made the modification and created a new project for MK22FX512VLQ12 and made the modification suggested by marceli@controldevices.net .
As a result we were able to program the code multiple times. But in between we are facing certain issues like
1. while trying for multiple times debugg by terminating and relaunching in gives follwing error
ERROR: Could not connect to target.
SEGGER J-Link GDB Server V6.42b Command Line Version
JLinkARM.dll V6.42b (DLL compiled Feb 5 2019 17:31:40)
Command line: -nosilent -swoport 2337 -select USB=123456 -telnetport 2338 -singlerun -endian little -noir -speed auto -port 2339 -vd -device MK22FX512xxx12 -if SWD -halt -reportuseraction
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2339
SWO raw output listening port: 2337
Terminal I/O port: 2338
Accept remote connection: localhost only
Generate logfile: off
Verify download: on
Init regs on start: off
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: MK22FX512xxx12
Target interface: SWD
Target interface speed: auto
Target endian: little
Connecting to J-Link...
$$UserActionStart$$: Terms of use
$$UserActionEnd$$: Terms of use
J-Link is connected.
Device "MK22FX512XXX12" selected.
Firmware: J-Link OpenSDA 2 compiled May 27 2019 11:01:03
Hardware: V1.00
S/N: 621000000
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2339
Connecting to target...InitTarget()
Connect Under Reset
Device will be unsecured now.
Found SW-DP with ID 0x2BA01477
InitTarget()
Connect Under Reset
Device will be unsecured now.
Found SW-DP with ID 0x2BA01477
ERROR: DAP error while reading DP-Ctrl-Stat register.
ERROR: Could not connect to target.
2. After that we erase the flash using MCU Xpresso GUI flash erase tool. And again we tried to program and debug, Then it gives following error,

3. When we click on yes the it gives the same error again and then we click yes and then it goes into the following loop.

4. After that we terminate it and agian tried to launch and debug. then it again gives the error mentioned in 1st point. after that we shut down the power and also disconnect the Jlink from PC and again powerup both and then tried to program then it got programmed.
Only diffeence we observed is that it is erassing the flash using MCUXpresso GUI tool. and it is not required any Jlink commander til now,
What is the reason for the same? This behaviour is also not sure need the same sequence which we followed mentioned in 4 the point. Some times it is not allowing to erase the controller and it shows Point no 2 error. and gives the error "ERROR: DAP error while reading DP-Ctrl-Stat register."
Thanks
Gaurav More