stacksmashing / tamarin-firmware

GNU General Public License v3.0
432 stars 51 forks source link

Troubleshooting guide #4

Open danylokos opened 1 year ago

danylokos commented 1 year ago

Hi, watched the Defcon talk, and it got me really excited, so I decided to try the project for myself. Unfortunately, I'm a complete noob in all of these - pico, soldering, and kernel debugging 😅 So, I'm not sure what I am doing wrong here.

I made the cable out of this LIghtning extension adapter, soldered the jumping wires and verified it for continuity using a multimeter. Just in case, I made two of those.

Next, I soldered the pins to the Pico and flashed the firmware. I tried connecting the pins to the Pico the way it's described in the README, starting with L1n (Purple) to GPIO1 and in another way like it was shown on the slides - L1n (Purple) to GPIO0. I'm not sure which way is correct, but the pins on the Pico start with GPIO0.

Screen Shot 2022-11-10 at 20 17 24

I'm using a demoted iPhone 7+ and t8010.cfg bonobo config for it. (openocd was also built from your fork.)

Unfortunatly I'm getting this error:

$  ../src/openocd -f interface/tamarin.cfg -f ~/test/bonobo-configs/t8010.cfg
Open On-Chip Debugger 0.10.0+dev-gc6d4abbe (2022-11-05-17:54)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Warn : Interface already configured, ignoring
Warn : Transport "swd" was already selected
Info : clock speed 10000 kHz
Info : SWD DPIDR 0x00010300

Assertion failed: (false), function tamarin_swd_switch_seq, file tamarin.c, line 325.
[1]    25771 abort      ../src/openocd -f interface/tamarin.cfg -f ~/test/bonobo-configs/t8010.cfg
Here is a more verbose output with `-d` flag ``` $ ../src/openocd -f interface/tamarin.cfg -f ~/test/bonobo-configs/t8010.cfg -d Open On-Chip Debugger 0.10.0+dev-gc6d4abbe (2022-11-05-17:54) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html User : 13 8 options.c:60 configuration_output_handler(): debug_level: 3 User : 14 8 options.c:60 configuration_output_handler(): Debug: 15 8 options.c:184 add_default_dirs(): bindir=/usr/local/bin Debug: 16 8 options.c:185 add_default_dirs(): pkgdatadir=/usr/local/share/openocd Debug: 17 8 options.c:186 add_default_dirs(): exepath=/Users/danylokos/test/openocd/src Debug: 18 8 options.c:187 add_default_dirs(): bin2data=../share/openocd Debug: 19 8 configuration.c:42 add_script_search_dir(): adding /Users/danylokos/.openocd Debug: 20 8 configuration.c:42 add_script_search_dir(): adding /Users/danylokos/test/openocd/src/../share/openocd/site Debug: 21 8 configuration.c:42 add_script_search_dir(): adding /Users/danylokos/test/openocd/src/../share/openocd/scripts Debug: 22 8 configuration.c:97 find_file(): found interface/tamarin.cfg Debug: 23 9 command.c:143 script_debug(): command - interface interface tamarin Info : 25 9 transport.c:117 allow_transports(): only one transport option; autoselect 'swd' Debug: 26 9 command.c:355 register_command_handler(): registering 'swd'... Debug: 27 9 command.c:143 script_debug(): command - transport transport select swd Warn : 28 9 transport.c:297 jim_transport_select(): Transport "swd" was already selected Debug: 29 9 command.c:143 script_debug(): command - adapter_khz adapter_khz 5000 Debug: 31 9 core.c:1636 jtag_config_khz(): handle jtag khz Debug: 32 9 core.c:1599 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 33 9 core.c:1599 adapter_khz_to_speed(): convert khz to interface specific speed value User : 34 9 options.c:60 configuration_output_handler(): adapter speed: 5000 kHz User : 35 9 options.c:60 configuration_output_handler(): Debug: 36 10 configuration.c:97 find_file(): found /Users/danylokos/test/bonobo-configs/t8010.cfg Debug: 37 10 command.c:143 script_debug(): command - interface interface bonobo Warn : 39 10 adapter.c:108 handle_interface_command(): Interface already configured, ignoring Debug: 40 10 command.c:143 script_debug(): command - transport transport select swd Warn : 41 10 transport.c:297 jim_transport_select(): Transport "swd" was already selected Debug: 42 10 command.c:143 script_debug(): command - adapter_khz adapter_khz 10000 Debug: 44 10 core.c:1636 jtag_config_khz(): handle jtag khz Debug: 45 10 core.c:1599 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 46 10 core.c:1599 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 47 10 command.c:143 script_debug(): command - reset_config reset_config srst_only Debug: 49 10 configuration.c:97 find_file(): found target/swj-dp.tcl Debug: 50 10 command.c:143 script_debug(): command - transport transport select Debug: 51 10 command.c:143 script_debug(): command - transport transport select Debug: 52 10 command.c:143 script_debug(): command - transport transport select Debug: 53 10 command.c:143 script_debug(): command - transport transport select Debug: 54 10 command.c:143 script_debug(): command - transport transport select Debug: 55 10 command.c:143 script_debug(): command - swd swd newdap iphone cpu -irlen 6 -ircapture 0x1 -irmask 0xf -expected-id 0x4ba02477 Debug: 56 10 tcl.c:567 jim_newtap_cmd(): Creating New Tap, Chip: iphone, Tap: cpu, Dotted: iphone.cpu, 8 params Debug: 57 10 core.c:1304 jtag_tap_init(): Created Tap: iphone.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0 Debug: 58 10 command.c:143 script_debug(): command - dap dap create iphone.dap -chain-position iphone.cpu Debug: 59 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 60 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 61 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 62 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 63 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 64 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 65 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 66 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 67 11 command.c:355 register_command_handler(): registering 'iphone.dap'... Debug: 68 11 command.c:143 script_debug(): command - target target create iphone.dbg mem_ap -endian little -dap iphone.dap -ap-num 1 Debug: 69 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 70 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 71 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 72 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 73 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 74 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 75 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 76 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 77 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 78 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 79 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 80 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 81 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 82 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 83 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 84 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 85 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 86 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 87 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 88 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 89 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 90 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 91 11 command.c:355 register_command_handler(): registering 'iphone.dbg'... Debug: 92 11 command.c:143 script_debug(): command - target target create iphone.mem mem_ap -endian little -dap iphone.dap -ap-num 4 Debug: 93 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 94 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 95 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 96 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 97 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 98 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 99 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 100 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 101 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 102 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 103 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 104 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 105 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 106 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 107 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 108 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 109 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 110 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 111 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 112 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 113 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 114 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 115 11 command.c:355 register_command_handler(): registering 'iphone.mem'... Debug: 116 11 command.c:143 script_debug(): command - cti cti create iphone.cpu0.cti -dap iphone.dap -ap-num 1 -ctibase 0xc2020000 Debug: 117 11 command.c:355 register_command_handler(): registering 'iphone.cpu0.cti'... Debug: 118 11 command.c:355 register_command_handler(): registering 'iphone.cpu0.cti'... Debug: 119 11 command.c:355 register_command_handler(): registering 'iphone.cpu0.cti'... Debug: 120 11 command.c:355 register_command_handler(): registering 'iphone.cpu0.cti'... Debug: 121 11 command.c:355 register_command_handler(): registering 'iphone.cpu0.cti'... Debug: 122 11 command.c:143 script_debug(): command - target target create iphone.cpu0 aarch64 -endian little -dap iphone.dap -ap-num 1 -dbgbase 0xc2010000 -cti iphone.cpu0.cti -coreid 0 -apple-utt 4 0x202040000 64 Debug: 123 11 command.c:355 register_command_handler(): registering 'catch_exc'... Debug: 124 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 125 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 126 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 127 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 128 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 129 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 130 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 131 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 132 11 command.c:355 register_command_handler(): registering 'aarch64'... Debug: 133 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 134 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 135 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 136 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 137 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 138 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 139 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 140 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 141 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 142 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 143 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 144 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 145 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 146 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 147 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 148 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 149 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 150 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 151 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 152 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 153 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 154 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 155 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 156 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 157 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 158 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 159 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 160 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 161 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 162 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 163 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 164 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 165 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 166 11 command.c:355 register_command_handler(): registering 'iphone.cpu0'... Debug: 167 11 command.c:143 script_debug(): command - cti cti create iphone.cpu1.cti -dap iphone.dap -ap-num 1 -ctibase 0xc2120000 Debug: 168 11 command.c:355 register_command_handler(): registering 'iphone.cpu1.cti'... Debug: 169 11 command.c:355 register_command_handler(): registering 'iphone.cpu1.cti'... Debug: 170 11 command.c:355 register_command_handler(): registering 'iphone.cpu1.cti'... Debug: 171 11 command.c:355 register_command_handler(): registering 'iphone.cpu1.cti'... Debug: 172 11 command.c:355 register_command_handler(): registering 'iphone.cpu1.cti'... Debug: 173 11 command.c:143 script_debug(): command - target target create iphone.cpu1 aarch64 -endian little -dap iphone.dap -ap-num 1 -dbgbase 0xc2110000 -cti iphone.cpu1.cti -coreid 1 -apple-utt 4 0x202140000 64 Debug: 174 11 command.c:377 register_command(): command 'catch_exc' is already registered in '' context Debug: 175 11 command.c:377 register_command(): command 'aarch64' is already registered in '' context Debug: 176 11 command.c:377 register_command(): command 'cache_info' is already registered in 'aarch64' context Debug: 177 11 command.c:377 register_command(): command 'dbginit' is already registered in 'aarch64' context Debug: 178 11 command.c:377 register_command(): command 'maskisr' is already registered in 'aarch64' context Debug: 179 11 command.c:377 register_command(): command 'mcr' is already registered in 'aarch64' context Debug: 180 11 command.c:377 register_command(): command 'mrc' is already registered in 'aarch64' context Debug: 181 11 command.c:377 register_command(): command 'smp' is already registered in 'aarch64' context Debug: 182 11 command.c:377 register_command(): command 'smp_on' is already registered in 'aarch64' context Debug: 183 11 command.c:377 register_command(): command 'smp_off' is already registered in 'aarch64' context Debug: 184 11 command.c:377 register_command(): command 'smp_gdb' is already registered in 'aarch64' context Debug: 185 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 186 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 187 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 188 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 189 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 190 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 191 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 192 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 193 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 194 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 195 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 196 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 197 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 198 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 199 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 200 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 201 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 202 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 203 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 204 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 205 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 206 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 207 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 208 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 209 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 210 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 211 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 212 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 213 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 214 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 215 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 216 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 217 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 218 11 command.c:355 register_command_handler(): registering 'iphone.cpu1'... Debug: 219 12 command.c:143 script_debug(): command - target target smp iphone.cpu0 iphone.cpu1 Debug: 220 12 target.c:5658 jim_target_smp(): 3 Debug: 221 12 target.c:5668 jim_target_smp(): iphone.cpu0 Debug: 222 12 target.c:5668 jim_target_smp(): iphone.cpu1 Debug: 223 12 command.c:143 script_debug(): command - target target create iphone.sep cortex_a -endian little -dap iphone.dap -ap-num 1 -dbgbase 0xcda20000 Debug: 224 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 225 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 226 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 227 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 228 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 229 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 230 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 231 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 232 12 command.c:355 register_command_handler(): registering 'arm'... Debug: 233 12 command.c:355 register_command_handler(): registering 'cache_config'... Debug: 234 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 235 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 236 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 237 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 238 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 239 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 240 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 241 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 242 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 243 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 244 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 245 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 246 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 247 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 248 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 249 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 250 12 command.c:355 register_command_handler(): registering 'cache'... Debug: 251 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 252 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 253 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 254 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 255 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 256 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 257 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 258 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 259 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 260 12 command.c:355 register_command_handler(): registering 'cortex_a'... Debug: 261 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 262 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 263 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 264 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 265 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 266 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 267 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 268 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 269 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 270 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 271 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 272 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 273 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 274 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 275 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 276 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 277 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 278 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 279 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 280 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 281 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 282 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 283 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 284 12 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 285 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 286 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 287 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 288 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 289 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 290 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 291 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 292 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 293 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 294 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 295 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 296 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 297 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 298 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 299 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 300 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 301 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 302 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 303 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 304 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 305 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 306 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 307 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 308 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 309 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 310 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 311 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 312 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 313 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 314 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 315 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 316 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 317 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 318 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 319 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 320 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 321 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 322 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 323 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 324 13 command.c:355 register_command_handler(): registering 'iphone.sep'... Debug: 325 13 command.c:143 script_debug(): command - init init Debug: 327 13 command.c:143 script_debug(): command - target target init Debug: 329 13 command.c:143 script_debug(): command - target target names Debug: 330 13 command.c:143 script_debug(): command - iphone.dbg iphone.dbg cget -event gdb-flash-erase-start Debug: 331 13 command.c:143 script_debug(): command - iphone.dbg iphone.dbg configure -event gdb-flash-erase-start reset init Debug: 332 13 command.c:143 script_debug(): command - iphone.dbg iphone.dbg cget -event gdb-flash-write-end Debug: 333 13 command.c:143 script_debug(): command - iphone.dbg iphone.dbg configure -event gdb-flash-write-end reset halt Debug: 334 13 command.c:143 script_debug(): command - iphone.dbg iphone.dbg cget -event gdb-attach Debug: 335 13 command.c:143 script_debug(): command - iphone.dbg iphone.dbg configure -event gdb-attach halt Debug: 336 13 command.c:143 script_debug(): command - iphone.mem iphone.mem cget -event gdb-flash-erase-start Debug: 337 13 command.c:143 script_debug(): command - iphone.mem iphone.mem configure -event gdb-flash-erase-start reset init Debug: 338 13 command.c:143 script_debug(): command - iphone.mem iphone.mem cget -event gdb-flash-write-end Debug: 339 13 command.c:143 script_debug(): command - iphone.mem iphone.mem configure -event gdb-flash-write-end reset halt Debug: 340 13 command.c:143 script_debug(): command - iphone.mem iphone.mem cget -event gdb-attach Debug: 341 13 command.c:143 script_debug(): command - iphone.mem iphone.mem configure -event gdb-attach halt Debug: 342 13 command.c:143 script_debug(): command - iphone.cpu0 iphone.cpu0 cget -event gdb-flash-erase-start Debug: 343 13 command.c:143 script_debug(): command - iphone.cpu0 iphone.cpu0 configure -event gdb-flash-erase-start reset init Debug: 344 13 command.c:143 script_debug(): command - iphone.cpu0 iphone.cpu0 cget -event gdb-flash-write-end Debug: 345 13 command.c:143 script_debug(): command - iphone.cpu0 iphone.cpu0 configure -event gdb-flash-write-end reset halt Debug: 346 13 command.c:143 script_debug(): command - iphone.cpu0 iphone.cpu0 cget -event gdb-attach Debug: 347 13 command.c:143 script_debug(): command - iphone.cpu0 iphone.cpu0 configure -event gdb-attach halt Debug: 348 13 command.c:143 script_debug(): command - iphone.cpu1 iphone.cpu1 cget -event gdb-flash-erase-start Debug: 349 13 command.c:143 script_debug(): command - iphone.cpu1 iphone.cpu1 configure -event gdb-flash-erase-start reset init Debug: 350 13 command.c:143 script_debug(): command - iphone.cpu1 iphone.cpu1 cget -event gdb-flash-write-end Debug: 351 13 command.c:143 script_debug(): command - iphone.cpu1 iphone.cpu1 configure -event gdb-flash-write-end reset halt Debug: 352 13 command.c:143 script_debug(): command - iphone.cpu1 iphone.cpu1 cget -event gdb-attach Debug: 353 13 command.c:143 script_debug(): command - iphone.cpu1 iphone.cpu1 configure -event gdb-attach halt Debug: 354 13 command.c:143 script_debug(): command - iphone.sep iphone.sep cget -event gdb-flash-erase-start Debug: 355 13 command.c:143 script_debug(): command - iphone.sep iphone.sep configure -event gdb-flash-erase-start reset init Debug: 356 13 command.c:143 script_debug(): command - iphone.sep iphone.sep cget -event gdb-flash-write-end Debug: 357 13 command.c:143 script_debug(): command - iphone.sep iphone.sep configure -event gdb-flash-write-end reset halt Debug: 358 13 command.c:143 script_debug(): command - iphone.sep iphone.sep cget -event gdb-attach Debug: 359 13 command.c:143 script_debug(): command - iphone.sep iphone.sep configure -event gdb-attach halt Debug: 360 13 target.c:1424 handle_target_init_command(): Initializing targets... Debug: 361 13 mem_ap.c:63 mem_ap_init_target(): mem_ap_init_target Debug: 362 13 mem_ap.c:63 mem_ap_init_target(): mem_ap_init_target Debug: 363 13 semihosting_common.c:97 semihosting_common_init(): Debug: 364 13 semihosting_common.c:97 semihosting_common_init(): Debug: 365 13 semihosting_common.c:97 semihosting_common_init(): Debug: 366 13 command.c:355 register_command_handler(): registering 'target_request'... Debug: 367 13 command.c:355 register_command_handler(): registering 'trace'... Debug: 368 13 command.c:355 register_command_handler(): registering 'trace'... Debug: 369 13 command.c:355 register_command_handler(): registering 'fast_load_image'... Debug: 370 13 command.c:355 register_command_handler(): registering 'fast_load'... Debug: 371 13 command.c:355 register_command_handler(): registering 'profile'... Debug: 372 13 command.c:355 register_command_handler(): registering 'virt2phys'... Debug: 373 13 command.c:355 register_command_handler(): registering 'reg'... Debug: 374 13 command.c:355 register_command_handler(): registering 'poll'... Debug: 375 13 command.c:355 register_command_handler(): registering 'wait_halt'... Debug: 376 13 command.c:355 register_command_handler(): registering 'halt'... Debug: 377 13 command.c:355 register_command_handler(): registering 'resume'... Debug: 378 13 command.c:355 register_command_handler(): registering 'reset'... Debug: 379 13 command.c:355 register_command_handler(): registering 'soft_reset_halt'... Debug: 380 13 command.c:355 register_command_handler(): registering 'step'... Debug: 381 13 command.c:355 register_command_handler(): registering 'mdd'... Debug: 382 13 command.c:355 register_command_handler(): registering 'mdw'... Debug: 383 13 command.c:355 register_command_handler(): registering 'mdh'... Debug: 384 13 command.c:355 register_command_handler(): registering 'mdb'... Debug: 385 13 command.c:355 register_command_handler(): registering 'mwd'... Debug: 386 13 command.c:355 register_command_handler(): registering 'mww'... Debug: 387 13 command.c:355 register_command_handler(): registering 'mwh'... Debug: 388 13 command.c:355 register_command_handler(): registering 'mwb'... Debug: 389 13 command.c:355 register_command_handler(): registering 'bp'... Debug: 390 13 command.c:355 register_command_handler(): registering 'rbp'... Debug: 391 13 command.c:355 register_command_handler(): registering 'wp'... Debug: 392 13 command.c:355 register_command_handler(): registering 'rwp'... Debug: 393 13 command.c:355 register_command_handler(): registering 'load_image'... Debug: 394 13 command.c:355 register_command_handler(): registering 'dump_image'... Debug: 395 13 command.c:355 register_command_handler(): registering 'verify_image_checksum'... Debug: 396 13 command.c:355 register_command_handler(): registering 'verify_image'... Debug: 397 13 command.c:355 register_command_handler(): registering 'test_image'... Debug: 398 13 command.c:355 register_command_handler(): registering 'reset_nag'... Debug: 399 13 command.c:355 register_command_handler(): registering 'ps'... Debug: 400 13 command.c:355 register_command_handler(): registering 'test_mem_access'... Debug: 401 22 core.c:1599 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 402 22 core.c:1603 adapter_khz_to_speed(): have interface set up Debug: 403 22 tamarin.c:245 tamarin_set_frequency(): Enqueue set frequency: 10000 Debug: 404 22 core.c:1599 adapter_khz_to_speed(): convert khz to interface specific speed value Debug: 405 22 core.c:1603 adapter_khz_to_speed(): have interface set up Info : 406 22 core.c:1381 adapter_init(): clock speed 10000 kHz Debug: 407 22 openocd.c:143 handle_init_command(): Debug Adapter init complete Debug: 408 22 command.c:143 script_debug(): command - transport transport init Debug: 410 22 transport.c:239 handle_transport_init(): handle_transport_init Debug: 411 22 command.c:143 script_debug(): command - dap dap init Debug: 413 22 arm_dap.c:105 dap_init_all(): Initializing all DAPs ... Debug: 414 22 tamarin.c:318 tamarin_swd_switch_seq(): JTAG-to-SWD Debug: 415 22 tamarin.c:301 tamarin_line_reset(): Enqueue line reset / SWD-to-JTAG sequence Debug: 416 22 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x24 Debug: 417 22 tamarin.c:225 tamarin_swd_write_reg(): Enqueue write: 0x00 - 0x0000001E Debug: 418 1137 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1137). This may cause trouble with GDB connections. Debug: 420 2138 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1001). This may cause trouble with GDB connections. Debug: 423 4232 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1094). This may cause trouble with GDB connections. Info : 425 4232 adi_v5_swd.c:136 swd_connect(): SWD DPIDR 0x0001030a Debug: 426 4232 arm_adi_v5.c:725 dap_dp_init(): iphone.dap Debug: 427 4232 tamarin.c:225 tamarin_swd_write_reg(): Enqueue write: 0x30 - 0x00000000 Debug: 428 4232 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 429 5354 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1122). This may cause trouble with GDB connections. Debug: 431 6409 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1055). This may cause trouble with GDB connections. Debug: 433 6409 tamarin.c:225 tamarin_swd_write_reg(): Enqueue write: 0x28 - 0x50000020 Debug: 434 6409 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 435 6409 tamarin.c:225 tamarin_swd_write_reg(): Enqueue write: 0x28 - 0x50000000 Debug: 436 6409 arm_adi_v5.c:770 dap_dp_init(): DAP: wait CDBGPWRUPACK Debug: 437 6409 arm_adi_v5.h:482 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000 Debug: 438 6409 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 439 7418 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1009). This may cause trouble with GDB connections. Debug: 441 8538 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1120). This may cause trouble with GDB connections. Debug: 443 9594 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1056). This may cause trouble with GDB connections. Debug: 445 10680 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1086). This may cause trouble with GDB connections. Debug: 447 10692 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 448 11703 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1023). This may cause trouble with GDB connections. Debug: 450 11715 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 451 12716 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1013). This may cause trouble with GDB connections. Debug: 453 12726 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 454 13821 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1105). This may cause trouble with GDB connections. Debug: 456 13832 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 457 14833 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1012). This may cause trouble with GDB connections. Debug: 459 14845 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 460 15960 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1127). This may cause trouble with GDB connections. Debug: 462 15971 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 463 17069 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1109). This may cause trouble with GDB connections. Debug: 465 17081 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 466 18204 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1135). This may cause trouble with GDB connections. Debug: 468 18216 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 469 19235 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1031). This may cause trouble with GDB connections. Debug: 471 19249 tamarin.c:202 tamarin_swd_read_reg(): Enqueue read: 0x0C Debug: 472 20266 log.c:409 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1031). This may cause trouble with GDB connections. Debug: 474 20277 arm_adi_v5.h:495 dap_dp_poll_register(): DAP: poll 4 timeout Debug: 475 20278 command.c:630 run_command(): Command 'dap init' failed with error code -5 User : 476 20278 command.c:695 command_run_line(): Debug: 477 20278 command.c:630 run_command(): Command 'init' failed with error code -4 User : 478 20278 command.c:695 command_run_line(): Debug: 479 20278 target.c:1962 target_free_all_working_areas_restore(): freeing all working areas Debug: 480 20278 target.c:1962 target_free_all_working_areas_restore(): freeing all working areas Debug: 481 20278 target.c:1962 target_free_all_working_areas_restore(): freeing all working areas Debug: 482 20278 target.c:1962 target_free_all_working_areas_restore(): freeing all working areas Debug: 483 20278 target.c:1962 target_free_all_working_areas_restore(): freeing all working areas Debug: 484 20279 tamarin.c:323 tamarin_swd_switch_seq(): SWD-to-JTAG Debug: 485 20279 tamarin.c:324 tamarin_swd_switch_seq(): NOT IMPLEMENTED Assertion failed: (false), function tamarin_swd_switch_seq, file tamarin.c, line 325. Debug: 486 20279 server.c:609 sig_handler(): Terminating on Signal 6 [1] 25804 abort ../src/openocd -f interface/tamarin.cfg -f ~/test/bonobo-configs/t8010.cfg -d ```

Because there are so many parts involved in to this process, I honestly don't know where to start debugging it, would appriciate any suggestion. And thanks again for the talk. It was very inspiring!

zaphodatreides commented 1 year ago

Hi, I had the same error... You have to wire the pico according to the picture, not the readme file. On a 8, openocd can attach but, I cannot halt the target...

amats211 commented 1 year ago

Having the same issue, do i need to connect all 8 pins is pico?

danylokos commented 1 year ago

I think @zaphodatreides meant iPhone 8

danylokos commented 1 year ago

Looks like L0p (white) and L0n (green) pins are not needed. But I wasn't able to figure out this issue, so I'm no longer sure about anything.

blackndoor commented 1 year ago

Hi, I have the exact same error. Did you fixe yours ?

nezza commented 1 year ago

If your lightning pinout (confirmed with multimeter) is correct, and the cable orientation is 100% correct, and the device is successfully demoted it should work. The error mainly happens when the electrical connection is incorrect

blackndoor commented 1 year ago

I checked the lightning pinout with a multimeter and it is correct. For the orientation of the cable I place the GND on the left. I guess my cable is not good. I use this one: https://fr.aliexpress.com/item/32812219943.html

Edit: I checked the cable and it seems OK. There is no chip near the lightning connector. So basically, I do:

$ sudo ./ipwndfu -p --demonte
// once done, I remove the apple cable and connect the tamarin one
$ sudo ./src/openocd -s /usr/local/share/openocd/scripts -f interface/tamarin.cfg -f ../bonobo-configs/t8015.cfg
blackndoor commented 1 year ago

Ok so, I made a new cable (shorter than the first one) and checked every connections. I still have the same result:

$ sudo ../openocd/src/openocd -s /usr/local/share/openocd/scripts  -f interface/tamarin.cfg -f t8015.cfg
Open On-Chip Debugger 0.10.0+dev-gc6d4abbe (2023-01-03-16:05)
Licensed under GNU GPL v2
For bug reports, read
      http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Warn : Interface already configured, ignoring
Warn : Transport "swd" was already selected
Info : clock speed 10000 kHz
Info : SWD DPIDR 0x00005623

openocd: src/jtag/drivers/tamarin.c:325: tamarin_swd_switch_seq: Assertion 'false' failed.
[1]    53994 IOT instruction  sudo ../openocd/src/openocd -s /usr/local/share/openocd/scripts -f  -f

I have this error whether the iPhone is connected or not which makes me think the pinout is not OK.

I tried:

and:

After checking the code, the second choice is the correct one but still no success.

danylokos commented 1 year ago

I'm also quite sure that my cable works well. Besides testing it with a multimeter, I did not throw away a second part of the extender and also soldered the jumper cables to it. The phone is fully detectable via both - System Information->USB and libimobiledevice's utils suite using it.

cable

btw, I'm using this lightning extender.

nezza commented 1 year ago

Does reset & DCSD work?

blackndoor commented 1 year ago

I'm not sure I understood your question. I'm unable to run openocd providing the bonobo-configs file. (Assertion 'false' failed)

The only thing I can do is:

$ sudo ../openocd/src/openocd -s /usr/local/share/openocd/scripts -f interface/tamarin.cfg
Open On-Chip Debugger 0.10.0+dev-gc6d4abbe (2023-01-12-17:18)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 5000 kHz
Warn : gdb services need one or more targets defined

And then:

$ sudo picocom /dev/ttyACM0

Type [C-a] [C-h] to see available commands
Terminal ready
Good morning!

1: JTAG mode
2: DCSD mode
3: Reset device
4: Reset and enter DFU mode
R: Reset Tamarin cable
> 
nezza commented 1 year ago

In your second paste you need to chose the mode. JTAG mode, DCSD, or reset the device. Does DCSD & reset work?

nezza commented 1 year ago

Did you use the serial interface to set the Tamarin cable to JTAG mode? Is DCSD & Reset working?

Thanks!

blackndoor commented 1 year ago

Thank you ! I had not understood that you should enable JTAG first, then run openocd cmd !

blackndoor commented 1 year ago

Well...

$ sudo ../openocd/src/openocd -s /usr/local/share/openocd/scripts -f interface/tamarin.cfg -f t8015.cfg
Open On-Chip Debugger 0.10.0+dev-gc6d4abbe (2023-01-12-17:18)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Warn : Interface already configured, ignoring
Warn : Transport "swd" was already selected
Info : clock speed 10000 kHz
Info : SWD DPIDR 0x03000067
Error: iphone.ecore0: missing UTT configuration, halt may not work
Info : iphone.ecore0: hardware has 2 breakpoints, 3 watchpoints
Error: iphone.ecore1: missing UTT configuration, halt may not work
Error: iphone.ecore1 powered down!
Error: iphone.ecore2: missing UTT configuration, halt may not work
Error: iphone.ecore2 powered down!
Error: iphone.ecore3: missing UTT configuration, halt may not work
Error: iphone.ecore3 powered down!
Error: iphone.pcore0: missing UTT configuration, halt may not work
Error: iphone.pcore0 powered down!
Error: iphone.pcore1: missing UTT configuration, halt may not work
Error: iphone.pcore1 powered down!
Error: iphone.sep: missing UTT configuration, halt may not work
Info : Listening on port 3333 for gdb connections
Info : Listening on port 3334 for gdb connections
Info : Listening on port 3335 for gdb connections
Info : Listening on port 3336 for gdb connections
Info : Listening on port 3337 for gdb connections
Info : Listening on port 3338 for gdb connections
Info : Listening on port 3339 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Error: Timeout waiting for target iphone.ecore0 halt
Error executing event gdb-attach on target iphone.ecore0:

Info : New GDB Connection: 1, Target iphone.ecore0, state: running
Info : dropped 'gdb' connection

The GDB connection is dropped instantly :(

danylokos commented 1 year ago

+1 didn't understand at first that you have to set JTAG mode over a serial interface like this, thanks for the clarification!

Now I'm also stuck with gdb dropping the connection:

openocd side:

Info : New GDB Connection: 1, Target iphone.cpu0, state: running
Info : dropped 'gdb' connection

and this how it loos form gdb:

(gdb) target remote :3333
Remote debugging using :3333
warning: Architecture rejected target-supplied description
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
Truncated register 8 in remote 'g' packet
xakermonkey commented 1 year ago

Hi. I understand correctly that only id0, l1n and l1p are involved in the code. id1, l0n and l0p are not involved in any way?

d34d633f commented 11 months ago

Well...

$ sudo ../openocd/src/openocd -s /usr/local/share/openocd/scripts -f interface/tamarin.cfg -f t8015.cfg
Open On-Chip Debugger 0.10.0+dev-gc6d4abbe (2023-01-12-17:18)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Warn : Transport "swd" was already selected
adapter speed: 5000 kHz

Warn : Interface already configured, ignoring
Warn : Transport "swd" was already selected
Info : clock speed 10000 kHz
Info : SWD DPIDR 0x03000067
Error: iphone.ecore0: missing UTT configuration, halt may not work
Info : iphone.ecore0: hardware has 2 breakpoints, 3 watchpoints
Error: iphone.ecore1: missing UTT configuration, halt may not work
Error: iphone.ecore1 powered down!
Error: iphone.ecore2: missing UTT configuration, halt may not work
Error: iphone.ecore2 powered down!
Error: iphone.ecore3: missing UTT configuration, halt may not work
Error: iphone.ecore3 powered down!
Error: iphone.pcore0: missing UTT configuration, halt may not work
Error: iphone.pcore0 powered down!
Error: iphone.pcore1: missing UTT configuration, halt may not work
Error: iphone.pcore1 powered down!
Error: iphone.sep: missing UTT configuration, halt may not work
Info : Listening on port 3333 for gdb connections
Info : Listening on port 3334 for gdb connections
Info : Listening on port 3335 for gdb connections
Info : Listening on port 3336 for gdb connections
Info : Listening on port 3337 for gdb connections
Info : Listening on port 3338 for gdb connections
Info : Listening on port 3339 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Error: Timeout waiting for target iphone.ecore0 halt
Error executing event gdb-attach on target iphone.ecore0:

Info : New GDB Connection: 1, Target iphone.ecore0, state: running
Info : dropped 'gdb' connection

The GDB connection is dropped instantly :(

Hello, I have encountered the same problem as you, did you solve it? I also tried iPhone7, but there is no way to halt the cpu. According to this article, our steps should be correct, and the value of DPIDR = 0x03000067 is also correct, but the CPU cannot be halted. I don't know what is wrong. Through the measurement of the voltmeter, I found that my configuration is consistent with that in README, I can use reset and dcsd normally, and the usb communication is also normal.

I found that when I use openocd, the serial port doesn't have any logs about jtag. When I use forced jtag mode, the serial port still doesn't have any logs. Does this mean that entering jtag mode failed?

I would be very grateful if someone could give me a little hint.

danylokos commented 10 months ago

Hi, nope, unfortunately, no.

I just tried one more time on iPhone 7 as well, unfortunately, I don't see the message saying that CPU has been halted successfully, halt command doesn't do anything for me.

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> targets iphone.cpu0
> targets            
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0  iphone.dbg         mem_ap     little iphone.cpu         running
 1  iphone.mem         mem_ap     little iphone.cpu         running
 2* iphone.cpu0        aarch64    little iphone.cpu         running
 3  iphone.cpu1        aarch64    little iphone.cpu         poweroff
 4  iphone.sep         cortex_a   little iphone.cpu         unknown

> halt

> halt

> halt
danylokos commented 9 months ago

nvm, turned out I was using a newer version of Pico SDK, once I switched to 4fe995d as literally the first line of the README states 🫠 it finally worked for me 🥳

> targets
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0  iphone.dbg         mem_ap     little iphone.cpu         running
 1  iphone.mem         mem_ap     little iphone.cpu         running
 2* iphone.cpu0        aarch64    little iphone.cpu         running
 3  iphone.cpu1        aarch64    little iphone.cpu         poweroff
 4  iphone.sep         cortex_a   little iphone.cpu         unknown

> halt
target halted in AArch64 state due to debug-request, current mode: EL1T
cpsr: 0x800002c4 pc: 0x100000508
MMU: enabled, D-Cache: enabled, I-Cache: enabled
(gdb) target remote :3333
Remote debugging using :3333
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x0000000100000508 in ?? ()
(gdb) x/5i $pc
=> 0x100000508: ret
   0x10000050c: hint    #0x45
   0x100000510: b       0x100000510
   0x100000514: stp     x28, x27, [sp, #-96]!
   0x100000518: stp     x26, x25, [sp, #16]
(gdb) x/s 0x100000200
0x100000200:    "SecureROM for t8010si, Copyright 2007-2015, Apple Inc."
(gdb) x/s 0x100000280
0x100000280:    "iBoot-2696.0.0.1.33"

(The above output is from iPhone 7., still can't halt IPhone X tho due to some timeout issue.)

Don't know what to do with all of this from this point on, but it was a fun experiment, thanks folks!