]> git.gir.st - tmk_keyboard.git/blob - keyboard/infinity/tool/README
Merge commit '22b6e15a179031afb7c3534cf7b109b0668b602c'
[tmk_keyboard.git] / keyboard / infinity / tool / README
1 OpenOCD config files for Kinetis
2 ================================
3 http://nemuisan.blog.bai.ne.jp/?eid=192848#OPENOCD
4
5 These are needed for debug and programing bootloader with SWD. To flash keyboard firmware use 'dfu-util'.
6
7 Flash security of Freescale kinetis
8 -----------------------------------
9 If FSEC of flash config is changed accidentally SWD/JTAG you can't get debug access until doing 'mdm mass_erase' with JTAG, CMSIS-DAP or OpenSAD adapter. HLA(high level adapter) like stlink doesn't work for this.
10
11
12 Example
13 -------
14 Debug:
15 $ openocd -s tool -f tool/openocd.cfg
16 $ arm-none-eabi-gdb build/infinity.elf -ex "target remote localhost:3333"
17
18 Flash bootloader:
19 $ openocd -s tool -f tool/openocd.cfg -c "mt_flash kiibohd_bootloader.bin"
20
21
22 Infinity SWD pinout
23 -------------------
24 SWD pins are placed next to reset button; SWD_CLK, SWD_DIO, GND, 5V from top.
25 Note that RESET is also needed to get full control with OpenOCD.
26
27 --------
28 | ___ o |CLK
29 ||RST| o |DIO
30 ||BTN| o |GND
31 | --- o |5V
32 --------
33
34
35 Kinetis sercure state
36 ----------------------
37 openocd 0.9.0
38
39 Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
40 Warn : **** ****
41 Warn : **** Your Kinetis MCU is in secured state, which means that, ****
42 Warn : **** with exception for very basic communication, JTAG/SWD ****
43 Warn : **** interface will NOT work. In order to restore its ****
44 Warn : **** functionality please issue 'kinetis mdm mass_erase' ****
45 Warn : **** command, power cycle the MCU and restart OpenOCD. ****
46 Warn : **** ****
47 Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
48
49
50 Info : MDM: Chip is unsecured. Continuing.
51 target state: halted
52 target halted due to debug-request, current mode: Thread
53 xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
54 auto erase enabled
55 Info : Probing flash info for bank 0
56 Warn : flash configuration field erased, please reset the device
57 wrote 4096 bytes from file kiibohd_bootloader.bin in 2.442562s (1.638 KiB/s)
58 Info : MDM: Chip is unsecured. Continuing.
59
60
61
62
63 Open On-Chip Debugger 0.9.0-dev-00346-g3e1dfdc-dirty (2015-03-21-20:41)
64 Licensed under GNU GPL v2
65 For bug reports, read
66 http://openocd.sourceforge.net/doc/doxygen/bugs.html
67 Info : only one transport option; autoselect 'cmsis-dap'
68 Kinetis MUST need Hardware SRST Control to Recover Secure-State!
69 adapter_nsrst_delay: 200
70 srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
71 Info : add flash_bank kinetis k20.pflash
72 cortex_m reset_config sysresetreq
73 adapter speed: 1000 kHz
74 srst_only separate srst_nogate srst_open_drain connect_assert_srst
75 Info : CMSIS-DAP: SWD Supported
76 Info : CMSIS-DAP: Interface Initialised (SWD)
77 Info : CMSIS-DAP: FW Version = 1.0
78 Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
79 Info : Connecting under reset
80 Info : DAP_SWJ Sequence (reset: 50+ '1' followed by 0)
81 Info : CMSIS-DAP: Interface ready
82 Info : clock speed 1000 kHz
83 Info : IDCODE 0x2ba01477
84 Warn : Adapter returned success despite SSTICKYERR being set.
85 Warn : Adapter returned success despite SSTICKYERR being set.
86 Warn : Adapter returned success despite SSTICKYERR being set.
87 Warn : Adapter returned success despite SSTICKYERR being set.
88 Info : k20.cpu: hardware has 6 breakpoints, 4 watchpoints
89 Info : MDM: Chip is unsecured. Continuing.
90 Info : MDM: Chip is unsecured. Continuing.
91 target state: halted
92 target halted due to debug-request, current mode: Thread
93 xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
94 auto erase enabled
95 Info : Probing flash info for bank 0
96 Warn : flash configuration field erased, please reset the device
97 wrote 4096 bytes from file kiibohd_bootloader.bin in 2.446902s (1.635 KiB/s)
98 Info : MDM: Chip is unsecured. Continuing.
99 Info : Halt timed out, wake up GDB.
100 Error: timed out while waiting for target halted
101 Runtime Error: tool/k20dx32_flash.cfg:81:
102 in procedure 'mt_flash'
103 in procedure 'halt' called at file "tool/k20dx32_flash.cfg", line 81
Imprint / Impressum