summaryrefslogtreecommitdiffstats
path: root/keyboard/infinity/tool
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard/infinity/tool')
-rw-r--r--keyboard/infinity/tool/README82
-rw-r--r--keyboard/infinity/tool/k20dx32_flash.cfg17
2 files changed, 96 insertions, 3 deletions
diff --git a/keyboard/infinity/tool/README b/keyboard/infinity/tool/README
index 3dd3316568..698314e250 100644
--- a/keyboard/infinity/tool/README
+++ b/keyboard/infinity/tool/README
@@ -2,7 +2,7 @@ OpenOCD config files for Kinetis
================================
http://nemuisan.blog.bai.ne.jp/?eid=192848#OPENOCD
-These are needed for SWD debug and programing bootloader. To flash keyboard firmware use 'dfu-util'.
+These are needed for debug and programing bootloader with SWD. To flash keyboard firmware use 'dfu-util'.
Flash security of Freescale kinetis
-----------------------------------
@@ -21,5 +21,83 @@ Flash bootloader:
Infinity SWD pinout
-------------------
-SWD pins are placed next to reset button; SWD_CLK, SWD_DIO, GND, VCC from top.
+SWD pins are placed next to reset button; SWD_CLK, SWD_DIO, GND, 5V from top.
Note that RESET is also needed to get full control with OpenOCD.
+
+ --------
+ | ___ o |CLK
+ ||RST| o |DIO
+ ||BTN| o |GND
+ | --- o |5V
+ --------
+
+
+Kinetis sercure state
+----------------------
+openocd 0.9.0
+
+Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
+Warn : **** ****
+Warn : **** Your Kinetis MCU is in secured state, which means that, ****
+Warn : **** with exception for very basic communication, JTAG/SWD ****
+Warn : **** interface will NOT work. In order to restore its ****
+Warn : **** functionality please issue 'kinetis mdm mass_erase' ****
+Warn : **** command, power cycle the MCU and restart OpenOCD. ****
+Warn : **** ****
+Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
+
+
+Info : MDM: Chip is unsecured. Continuing.
+target state: halted
+target halted due to debug-request, current mode: Thread
+xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
+auto erase enabled
+Info : Probing flash info for bank 0
+Warn : flash configuration field erased, please reset the device
+wrote 4096 bytes from file kiibohd_bootloader.bin in 2.442562s (1.638 KiB/s)
+Info : MDM: Chip is unsecured. Continuing.
+
+
+
+
+Open On-Chip Debugger 0.9.0-dev-00346-g3e1dfdc-dirty (2015-03-21-20:41)
+Licensed under GNU GPL v2
+For bug reports, read
+ http://openocd.sourceforge.net/doc/doxygen/bugs.html
+Info : only one transport option; autoselect 'cmsis-dap'
+Kinetis MUST need Hardware SRST Control to Recover Secure-State!
+adapter_nsrst_delay: 200
+srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
+Info : add flash_bank kinetis k20.pflash
+cortex_m reset_config sysresetreq
+adapter speed: 1000 kHz
+srst_only separate srst_nogate srst_open_drain connect_assert_srst
+Info : CMSIS-DAP: SWD Supported
+Info : CMSIS-DAP: Interface Initialised (SWD)
+Info : CMSIS-DAP: FW Version = 1.0
+Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
+Info : Connecting under reset
+Info : DAP_SWJ Sequence (reset: 50+ '1' followed by 0)
+Info : CMSIS-DAP: Interface ready
+Info : clock speed 1000 kHz
+Info : IDCODE 0x2ba01477
+Warn : Adapter returned success despite SSTICKYERR being set.
+Warn : Adapter returned success despite SSTICKYERR being set.
+Warn : Adapter returned success despite SSTICKYERR being set.
+Warn : Adapter returned success despite SSTICKYERR being set.
+Info : k20.cpu: hardware has 6 breakpoints, 4 watchpoints
+Info : MDM: Chip is unsecured. Continuing.
+Info : MDM: Chip is unsecured. Continuing.
+target state: halted
+target halted due to debug-request, current mode: Thread
+xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
+auto erase enabled
+Info : Probing flash info for bank 0
+Warn : flash configuration field erased, please reset the device
+wrote 4096 bytes from file kiibohd_bootloader.bin in 2.446902s (1.635 KiB/s)
+Info : MDM: Chip is unsecured. Continuing.
+Info : Halt timed out, wake up GDB.
+Error: timed out while waiting for target halted
+Runtime Error: tool/k20dx32_flash.cfg:81:
+in procedure 'mt_flash'
+in procedure 'halt' called at file "tool/k20dx32_flash.cfg", line 81
diff --git a/keyboard/infinity/tool/k20dx32_flash.cfg b/keyboard/infinity/tool/k20dx32_flash.cfg
index 714d9991f8..1e3deb0910 100644
--- a/keyboard/infinity/tool/k20dx32_flash.cfg
+++ b/keyboard/infinity/tool/k20dx32_flash.cfg
@@ -2,6 +2,22 @@
# Nemuisan's Special for MK20DN32VFT5,MK20DX32VFT5,MK10DN32VFT5,MK10DX32VFT5
+# 0.8.0 has no these procs
+proc using_jtag {} {
+ set _TRANSPORT [ transport select ]
+ expr { [ string first "jtag" $_TRANSPORT ] != -1 }
+}
+
+proc using_swd {} {
+ set _TRANSPORT [ transport select ]
+ expr { [ string first "swd" $_TRANSPORT ] != -1 }
+}
+
+proc using_hla {} {
+ set _TRANSPORT [ transport select ]
+ expr { [ string first "hla" $_TRANSPORT ] != -1 }
+}
+
source [find target/swj-dp.tcl]
if { [info exists CHIPNAME] } {
@@ -109,7 +125,6 @@ proc eraser {} {
shutdown
}
-
#debug_level 3
# HLA doesn't have cortex_m commands
if {![using_hla]} {