Hi Kerry,
Thank you so much for all of your suggestions !!!
As per your request i tried to program my modified project to the TWR-KE18F board directly and this operation was successful. I was able to see the following messages in Keil window:
Erase Done.
Programming Done.
Verify OK.
I then proceeded to try the JLink commander utility to test the erase operation on my custom board. This also seem to work fine.
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: MKE14F512XXX16
Type '?' for selection dialog
Device>MKE14F512XXX16
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>J
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>-1,-1
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>4000
Device "MKE14F512XXX16" selected.
Connecting to target via JTAG
InitTarget()
Connect Under Reset
Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set.
For debugger connection the device needs to be unsecured.
Note: Unsecuring will trigger a mass erase of the internal flash.
Executing default behavior previously saved in the registry.
Device will be unsecured now.
TotalIRLen = 4, IRPrint = 0x01
JTAG chain detection found 1 devices:
#0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x001C0000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
Cortex-M4 identified.
J-Link>Erase
Erasing device...
J-Link: Flash download: Total time needed: 0.604s (Prepare: 0.053s, Compare: 0.000s, Erase: 0.548s, Program: 0.000s, Verify: 0.000s, Restore: 0.002s)
Erasing done.
J-Link>
The issue however still remains.
Regards,
Aman