openocd/src/flash
Tomas Vanek 6d5b4d709c flash Kinetis: Detect RESET/WDOG loop, fix detection of secured MCU
Kinetis driver checks MDM STAT register to detect secured state of MCU.
Original version often reported a blank device as secured one.
Change #3010 has not fixed all false reports.
After changes in arm_adi_v5 infrastructure secured devices was not detected
at all.

New algorithm uses multiple MDM STAT reads and counts MDM_STAT_SYSSEC and
MDM_STAT_FREADY bits. Both secured MCU and MCU locked-up in RESET/WDOG loop
are detected reliably.

Detection is run in both kx.cfg and klx.cfg from examine-start event,
not examine-end as before. Event is configured only for non hla adapter.

Minor fix in klx.cfg: commented out adapter_khz 24000 in reset-init.
Such frequency is not supported in VLPR CPU mode and with JTAG.

Change-Id: I2ec2b68c45bde9898159cd15fbdcbcfa538c41d9
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3547
Tested-by: jenkins
Reviewed-by: Steven Stallion <stallion@squareup.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-08-14 09:10:06 +01:00
..
nand Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
nor flash Kinetis: Detect RESET/WDOG loop, fix detection of secured MCU 2016-08-14 09:10:06 +01:00
common.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
common.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
Makefile.am build: add common.mk 2010-11-18 14:05:56 +00:00
mflash.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
mflash.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
startup.tcl Tcl exception codes cleanup, shutdown command amendments 2015-04-14 12:11:48 +01:00