Hi Jorge,
Thanks again for the help.
Yes the Ezport works 100% of the time UNLESS we are in this stange
mode. The K20 is programmed via Ezport from a iMX53. We've really
tested the Ezport programming quite a lot, even interrupting it while
in the middle of programming, and it's pretty solid.
It occurred to me that maybe you wanted me to do the erase (without
connect), unlock kinetis, connect, and mem 0x400 10 commands when I
was in the secure mode. I did that and the log is below.
I put file1.bin and file2.bin here if you wanted to try something.
http://members.efn.org/~rick/pub/springdale/file1.bin
http://members.efn.org/~rick/pub/springdale/file2.bin
Thanks,
Rick
----------------------
/opt/SEGGER/JLink/JLinkExe -device MK20FN1M0xxx12 -if JTAG -speed 4000 -JTAGConf -1,-1 -AutoConnect 1
SEGGER J-Link Commander V5.10g (Compiled Jan 6 2016 13:54:12)
DLL version V5.10g, compiled Jan 6 2016 13:54:07
Connecting to J-Link via USB...O.K.
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Hardware version: V7.00
S/N: 20090928
License(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
Emulator has Trace capability
VTref = 3.300V
Device "MK20FN1M0XXX12" selected.
TotalIRLen = 4, IRPrint = 0x01
TotalIRLen = 4, IRPrint = 0x01
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl 0 @ E00FF000
ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
ROMTbl 0 [6]: FFF43000, CID: B105900D, PID: 003BB907 ETB
ROMTbl 0 [7]: FFF44000, CID: B105900D, PID: 001BB908 CSTF
Found 1 JTAG device, Total IRLen = 4:
#0 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
Cortex-M4 identified.
J-Link>loadfile /opt/springdale/rd/opt/testing/bin/k20_test.bin
Downloading file [/opt/springdale/rd/opt/testing/bin/k20_test.bin]...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Programming flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (81920 bytes)
J-Link: Flash download: Total time needed: 2.523s (Prepare: 0.423s, Compare: 0.023s, Erase: 0.052s, Program: 1.993s, Verify: 0.006s, Restore: 0.024s)
O.K.
J-Link>r
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
J-Link>g
J-Link>loadfile /opt/springdale/achc-56.bin
Downloading file [/opt/springdale/achc-56.bin]...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Restarting flash programming due to program error (possibly skipped erasure of half-way erased sector).
J-Link: Flash download: Skip optimizations disabled for second try.
Error while programming flash: Programming failed.
J-Link>exit
/opt/SEGGER/JLink/JLinkExe -device MK20FN1M0xxx12 -if JTAG -speed 4000 -JTAGConf -1,-1
SEGGER J-Link Commander V5.10g (Compiled Jan 6 2016 13:54:12)
DLL version V5.10g, compiled Jan 6 2016 13:54:07
Connecting to J-Link via USB...O.K.
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Hardware version: V7.00
S/N: 20090928
License(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
Emulator has Trace capability
VTref = 3.300V
Type "connect" to establish a target connection, '?' for help
J-Link>erase
Target connection not established yet but required for command.
Device "MK20FN1M0XXX12" selected.
TotalIRLen = 4, IRPrint = 0x01
Secured Kinetis device detected. For debugger connection the device needs to be unsecured.
Device will be unsecured now.
Note: Unsecuring will trigger a mass erase of the internal flash.
TotalIRLen = 4, IRPrint = 0x01
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl 0 @ E00FF000
ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
ROMTbl 0 [6]: FFF43000, CID: B105900D, PID: 003BB907 ETB
ROMTbl 0 [7]: FFF44000, CID: B105900D, PID: 001BB908 CSTF
Found 1 JTAG device, Total IRLen = 4:
#0 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
Cortex-M4 identified.
Erasing device (MK20FN1M0xxx12)...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Total time needed: 1.973s (Prepare: 0.402s, Compare: 0.000s, Erase: 1.547s, Program: 0.000s, Verify: 0.000s, Restore: 0.023s)
Erasing done.
J-Link> mem 0x400 10
00000400 = FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
J-Link>unlock kinetis
Found SWD-DP with ID 0x2BA01477
Unlocking device...O.K.
J-Link>connect
Device "MK20FN1M0XXX12" selected.
TotalIRLen = 4, IRPrint = 0x01
TotalIRLen = 4, IRPrint = 0x01
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl 0 @ E00FF000
ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
ROMTbl 0 [6]: FFF43000, CID: B105900D, PID: 003BB907 ETB
ROMTbl 0 [7]: FFF44000, CID: B105900D, PID: 001BB908 CSTF
Found 1 JTAG device, Total IRLen = 4:
#0 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
Cortex-M4 identified.
J-Link> mem 0x400 10
00000400 = FF FF FF FF FF FF FF FF FF FF FF FF FE FF FF FF