1 https://www.youtube.com/watch?v=hWYzgw0WhYU
3 pi@pihdmi:~/openocd $ ./src/openocd -f tcl/interface/raspberrypi2-native.cfg
4 Open On-Chip Debugger 0.10.0+dev-01489-g06c7a53f1-dirty (2020-11-14-15:21)
5 Licensed under GNU GPL v2
7 http://openocd.org/doc/doxygen/bugs.html
8 BCM2835 GPIO nums: swclk = 11, swdio = 25
10 Info : Listening on port 6666 for tcl connections
11 Info : Listening on port 4444 for telnet connections
12 Info : BCM2835 GPIO JTAG/SWD bitbang driver
13 Error: An adapter speed is not selected in the init script. Insert a call to "adapter speed" or "jtag_rclk" to proceed.
17 IO1 gpio17 level=1 fsel=0 func=INPUT "ds18b20_temp@2" out hi
18 IO2 gpio18 level=0 fsel=0 func=INPUT io
19 IO3 gpio27 level=0 fsel=0 func=INPUT clk
22 pi@pihdmi:~/openocd-stm32 $ openocd -f pihdmi-rpi2.cfg
23 Open On-Chip Debugger 0.10.0+dev-01489-g06c7a53f1-dirty (2020-11-14-15:21)
24 Licensed under GNU GPL v2
26 http://openocd.org/doc/doxygen/bugs.html
28 Info : Listening on port 6666 for tcl connections
29 Info : Listening on port 4444 for telnet connections
30 Info : BCM2835 GPIO JTAG/SWD bitbang driver
31 Info : clock speed 100 kHz
32 Warn : gdb services need one or more targets defined
35 https://github.com/antongus/stm32tpl/blob/master/stm32.h
38 0xe0042000: 20036410 00000000 00000000 00000000
42 Failed to read memory at 0x1fff7a14
45 0x1ffff7e8: 0670ff48 56558967 67064740 ffff00ff
49 openocd -f pihdmi-rpi2.cfg -f target/stm32f1x.cfg
52 #0 : stm32f1x.flash (stm32f1x) at 0x08000000, size 0x00000000, buswidth 0, chipwidth 0
54 > flash read_bank 0 bank0.bin
55 device id = 0x20036410
56 flash size = 128kbytes
57 wrote 131072 bytes to file bank0.bin from flash bank 0 at offset 0x00000000 in 1.273383s (100.520 KiB/s)
64 # if it failed, re-try command again
65 flash write_bank 0 image.bin
72 (gdb) set architecture arm
73 The target architecture is assumed to be arm
75 (gdb) target remote localhost:3333
76 Remote debugging using localhost:3333
77 warning: No executable has been specified and target does not support
78 determining executable automatically. Try using the "file" command.
86 => 0x8000194: subs r0, r0, #1
88 0x8000198: bne.n 0x8000194
90 0x800019c: push {r3, lr}
91 0x800019e: movs r1, #1
92 0x80001a0: movs r0, #16
93 0x80001a2: bl 0x80002ec
94 0x80001a6: mov.w r0, #8192 ; 0x2000
95 0x80001aa: strh.w r0, [sp]
98 Breakpoint 1 at 0x800019a
102 Note: automatically using hardware breakpoints for read-only addresses.
104 Breakpoint 1, 0x0800019a in ?? ()