This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[nRF52832][Bluefruit Feather] OpenOCD unable to connect to the target

Dear all,

I did below steps to connect to the BluFruit Feather board via STLink V2:

1) Install OpenOcd and STLink USB driver as: https://pcbreflux.blogspot.com/2016/09/nrf52832-first-steps-with-st-link-v2.html

+ OpenOcd has been configured as below option:

      LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include ../configure --enable-stlink

After that without connecting to the board, I can see below message:

~$ lsusb | grep  STM
Bus 003 Device 007: ID 0483:3748 STMicroelectronics ST-LINK/V2

# Checking kernel log by dmesg
[ 2612.490404] usb 3-10: new full-speed USB device number 7 using xhci_hcd
[ 2612.632256] usb 3-10: New USB device found, idVendor=0483, idProduct=3748
[ 2612.632263] usb 3-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2612.632267] usb 3-10: Product: STM32 STLink
[ 2612.632271] usb 3-10: Manufacturer: STMicroelectronics
[ 2612.632275] usb 3-10: SerialNumber: RÿkH\xffffffc2\xffffff83RHF9\xffffffc2\xffffff87

=> That means the STLink is properly detected.

2) Connecting the board --> ST Link V2, based o the nRF52832 schematic, BlueFruit pinout and ST Link V2 pinout and connect as:

SWDIO (pin name: 11/25) -->  SWDIO (pin 6)

SWCLK (pin name: SCK/26)--> SWCLK(pin 4)

GND (pin name: G) --> GND (pin 7)

3v (pin name: 3V) --> 3V3 (pin 2)

Ref: 

https://www.aliexpress.com/item/Best-Quality-ST-Link-stlink-V2-for-STM8S-STM8L-STM32-Cortex-M0-Cortex-M3-SWIM-JTAG/32676015777.html?spm=2114.search0104.3.1.42197c39KJSD82&ws_ab_test=searchweb0_0,searchweb201602_3_10152_10151_10065_10344_10068_5722815_10342_10343_10340_5722915_10341_5722615_10696_10084_10083_10618_10304_10307_10820_10821_10302_5722715_10843_10059_306_100031_10103_10624_10623_10622_5722515_10621_10620,searchweb201603_50,ppcSwitch_5&algo_expid=9a4fdee5-7ee5-420e-8e14-47c2d26f95ba-0&algo_pvid=9a4fdee5-7ee5-420e-8e14-47c2d26f95ba&transAbTest=ae803_2&priceBeautifyAB=0

https://learn.adafruit.com/adafruit-nrf52-pro-feather/device-pinout

But I can't make the OpenOcd to connect to the board:

$ ./src/openocd -d2 -f openocd_nrf52.cfg -s ../tcl/
Open On-Chip Debugger 0.10.0+dev-00430-g0612315 (2018-06-15-10:18)
Licensed under GNU GPL v2
For bug reports, read
openocd.org/.../bugs.html
debug_level: 2
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v21 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.222134
Error: init mode failed (unable to connect to the target)
in procedure 'init'
in procedure 'ocd_bouncer'

Warn : Flash driver of nrf52.flash does not support free_driver_priv()
Warn : Flash driver of nrf52.uicr does not support free_driver_priv()

My openocd_nrf52.cfg file is:

#nRF52832 Target
source [find interface/stlink-v2.cfg]

transport select hla_swd

source [find target/nrf52.cfg]

Could you please help to correct my steps?

Best Regards,

James, Dinh

Parents
  • Hi,

    I would like to add additional log (debug level = 3) when running OpenOcd:

    ./src/openocd -s ../tcl/ -d3 -f openocd_nrf52.cfg
    Open On-Chip Debugger 0.10.0+dev-00430-g0612315 (2018-06-15-10:18)
    Licensed under GNU GPL v2
    For bug reports, read
    openocd.org/.../bugs.html
    User : 13 3 command.c:544 command_print(): debug_level: 3
    Debug: 14 3 options.c:184 add_default_dirs(): bindir=/usr/local/bin
    Debug: 15 3 options.c:185 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
    Debug: 16 3 options.c:186 add_default_dirs(): exepath=/home/lamdinh/work/tools/openocd/_build/src
    Debug: 17 3 options.c:187 add_default_dirs(): bin2data=../share/openocd
    Debug: 18 3 configuration.c:42 add_script_search_dir(): adding /home/lamdinh/.openocd
    Debug: 19 3 configuration.c:42 add_script_search_dir(): adding /home/lamdinh/work/tools/openocd/_build/src/../share/openocd/site
    Debug: 20 3 configuration.c:42 add_script_search_dir(): adding /home/lamdinh/work/tools/openocd/_build/src/../share/openocd/scripts
    Debug: 21 4 configuration.c:97 find_file(): found openocd_nrf52.cfg
    Debug: 22 4 configuration.c:97 find_file(): found ../tcl//interface/stlink.cfg
    Debug: 23 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface hla
    Debug: 24 4 command.c:143 script_debug(): command - interface ocd_interface hla
    Debug: 26 4 command.c:364 register_command_handler(): registering 'ocd_hla_device_desc'...
    Debug: 27 4 command.c:364 register_command_handler(): registering 'ocd_hla_serial'...
    Debug: 28 4 command.c:364 register_command_handler(): registering 'ocd_hla_layout'...
    Debug: 29 4 command.c:364 register_command_handler(): registering 'ocd_hla_vid_pid'...
    Debug: 30 4 command.c:364 register_command_handler(): registering 'ocd_hla_command'...
    Debug: 31 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_layout stlink
    Debug: 32 4 command.c:143 script_debug(): command - hla_layout ocd_hla_layout stlink
    Debug: 34 4 hla_interface.c:244 hl_interface_handle_layout_command(): hl_interface_handle_layout_command
    Debug: 35 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_device_desc ST-LINK
    Debug: 36 4 command.c:143 script_debug(): command - hla_device_desc ocd_hla_device_desc ST-LINK
    Debug: 38 4 hla_interface.c:218 hl_interface_handle_device_desc_command(): hl_interface_handle_device_desc_command
    Debug: 39 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b
    Debug: 40 4 command.c:143 script_debug(): command - hla_vid_pid ocd_hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b
    Debug: 42 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select hla_swd
    Debug: 43 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select hla_swd
    Debug: 44 5 hla_transport.c:191 hl_transport_select(): hl_transport_select
    Debug: 45 5 command.c:364 register_command_handler(): registering 'ocd_hla'...
    Debug: 46 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 47 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 48 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 49 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 50 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 51 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 52 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 53 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 54 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 55 5 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
    Debug: 56 5 configuration.c:97 find_file(): found ../tcl//target/nrf52.cfg
    Debug: 57 5 configuration.c:97 find_file(): found ../tcl//target/swj-dp.tcl
    Debug: 58 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 59 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 60 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 61 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 62 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 63 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 64 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 65 6 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 66 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla newtap nrf52 cpu -expected-id 0x2ba01477
    Debug: 67 6 command.c:143 script_debug(): command - ocd_hla ocd_hla newtap nrf52 cpu -expected-id 0x2ba01477
    Debug: 68 6 hla_tcl.c:111 jim_hl_newtap_cmd(): Creating New Tap, Chip: nrf52, Tap: cpu, Dotted: nrf52.cpu, 2 params
    Debug: 69 6 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -expected-id
    Debug: 70 6 core.c:1304 jtag_tap_init(): Created Tap: nrf52.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
    Debug: 71 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_dap create nrf52.dap -chain-position nrf52.cpu
    Debug: 72 6 command.c:143 script_debug(): command - ocd_dap ocd_dap create nrf52.dap -chain-position nrf52.cpu
    Debug: 73 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create nrf52.cpu cortex_m -dap nrf52.dap
    Debug: 74 6 command.c:143 script_debug(): command - ocd_target ocd_target create nrf52.cpu cortex_m -dap nrf52.dap
    Info : 75 6 target.c:5532 target_create(): The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    Debug: 76 6 hla_target.c:367 adapter_target_create(): adapter_target_create
    Debug: 77 6 hla_target.c:338 adapter_init_arch_info(): adapter_init_arch_info
    Debug: 78 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 79 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 80 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 81 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 82 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 83 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 84 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 85 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 86 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 87 6 command.c:364 register_command_handler(): registering 'ocd_tpiu'...
    Debug: 88 6 command.c:364 register_command_handler(): registering 'ocd_itm'...
    Debug: 89 6 command.c:364 register_command_handler(): registering 'ocd_itm'...
    Debug: 90 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 91 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 92 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 93 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 94 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 95 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 96 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 97 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 98 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 99 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 100 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 101 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 102 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 103 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 104 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 105 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 106 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 107 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 108 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 109 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 110 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 111 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 112 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 113 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 114 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 115 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 116 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 117 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 118 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 119 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 120 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 121 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 122 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 123 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 124 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 125 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 126 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 1000
    Debug: 127 7 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 1000
    Debug: 129 7 core.c:1645 jtag_config_khz(): handle jtag khz
    Debug: 130 7 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 131 7 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    User : 132 7 command.c:544 command_print(): adapter speed: 1000 kHz
    Debug: 133 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
    Debug: 134 7 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
    Debug: 135 7 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 136 7 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 137 7 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 138 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 139 7 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 140 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash bank nrf52.flash nrf5 0x00000000 0 1 1 nrf52.cpu
    Debug: 141 7 command.c:143 script_debug(): command - ocd_flash ocd_flash bank nrf52.flash nrf5 0x00000000 0 1 1 nrf52.cpu
    Debug: 143 7 command.c:323 command_new(): BUG: command 'nrf5 mass_erase' does not have the '.usage' field filled out
    Debug: 144 7 command.c:364 register_command_handler(): registering 'ocd_nrf5'...
    Debug: 145 7 command.c:323 command_new(): BUG: command 'nrf51 mass_erase' does not have the '.usage' field filled out
    Debug: 146 7 command.c:364 register_command_handler(): registering 'ocd_nrf51'...
    Debug: 147 7 tcl.c:1146 handle_flash_bank_command(): 'nrf5' driver usage field missing
    Debug: 148 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash bank nrf52.uicr nrf5 0x10001000 0 1 1 nrf52.cpu
    Debug: 149 7 command.c:143 script_debug(): command - ocd_flash ocd_flash bank nrf52.uicr nrf5 0x10001000 0 1 1 nrf52.cpu
    Debug: 151 7 command.c:399 register_command(): command 'nrf5' is already registered in '<global>' context
    Debug: 152 7 command.c:399 register_command(): command 'mass_erase' is already registered in 'nrf5' context
    Debug: 153 7 command.c:399 register_command(): command 'nrf51' is already registered in '<global>' context
    Debug: 154 7 command.c:399 register_command(): command 'mass_erase' is already registered in 'nrf51' context
    Debug: 155 7 tcl.c:1146 handle_flash_bank_command(): 'nrf5' driver usage field missing
    Info : 156 8 server.c:307 add_service(): Listening on port 6666 for tcl connections
    Info : 157 8 server.c:307 add_service(): Listening on port 4444 for telnet connections
    Debug: 158 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
    Debug: 159 8 command.c:143 script_debug(): command - init ocd_init
    Debug: 161 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
    Debug: 162 8 command.c:143 script_debug(): command - ocd_target ocd_target init
    Debug: 164 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
    Debug: 165 8 command.c:143 script_debug(): command - ocd_target ocd_target names
    Debug: 166 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu cget -event gdb-flash-erase-start
    Debug: 167 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu cget -event gdb-flash-erase-start
    Debug: 168 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -event gdb-flash-erase-start reset init
    Debug: 169 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -event gdb-flash-erase-start reset init
    Debug: 170 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu cget -event gdb-flash-write-end
    Debug: 171 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu cget -event gdb-flash-write-end
    Debug: 172 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -event gdb-flash-write-end reset halt
    Debug: 173 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -event gdb-flash-write-end reset halt
    Debug: 174 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu cget -event gdb-attach
    Debug: 175 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu cget -event gdb-attach
    Debug: 176 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -event gdb-attach halt
    Debug: 177 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -event gdb-attach halt
    Debug: 178 8 target.c:1362 handle_target_init_command(): Initializing targets...
    Debug: 179 8 hla_target.c:357 adapter_init_target(): adapter_init_target
    Debug: 180 8 semihosting_common.c:97 semihosting_common_init():
    Debug: 181 8 command.c:364 register_command_handler(): registering 'ocd_target_request'...
    Debug: 182 8 command.c:364 register_command_handler(): registering 'ocd_trace'...
    Debug: 183 8 command.c:364 register_command_handler(): registering 'ocd_trace'...
    Debug: 184 8 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
    Debug: 185 8 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
    Debug: 186 8 command.c:364 register_command_handler(): registering 'ocd_profile'...
    Debug: 187 8 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
    Debug: 188 9 command.c:364 register_command_handler(): registering 'ocd_reg'...
    Debug: 189 9 command.c:364 register_command_handler(): registering 'ocd_poll'...
    Debug: 190 9 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
    Debug: 191 9 command.c:364 register_command_handler(): registering 'ocd_halt'...
    Debug: 192 9 command.c:364 register_command_handler(): registering 'ocd_resume'...
    Debug: 193 9 command.c:364 register_command_handler(): registering 'ocd_reset'...
    Debug: 194 9 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
    Debug: 195 9 command.c:364 register_command_handler(): registering 'ocd_step'...
    Debug: 196 9 command.c:364 register_command_handler(): registering 'ocd_mdd'...
    Debug: 197 9 command.c:364 register_command_handler(): registering 'ocd_mdw'...
    Debug: 198 9 command.c:364 register_command_handler(): registering 'ocd_mdh'...
    Debug: 199 9 command.c:364 register_command_handler(): registering 'ocd_mdb'...
    Debug: 200 9 command.c:364 register_command_handler(): registering 'ocd_mwd'...
    Debug: 201 9 command.c:364 register_command_handler(): registering 'ocd_mww'...
    Debug: 202 9 command.c:364 register_command_handler(): registering 'ocd_mwh'...
    Debug: 203 9 command.c:364 register_command_handler(): registering 'ocd_mwb'...
    Debug: 204 9 command.c:364 register_command_handler(): registering 'ocd_bp'...
    Debug: 205 9 command.c:364 register_command_handler(): registering 'ocd_rbp'...
    Debug: 206 9 command.c:364 register_command_handler(): registering 'ocd_wp'...
    Debug: 207 9 command.c:364 register_command_handler(): registering 'ocd_rwp'...
    Debug: 208 9 command.c:364 register_command_handler(): registering 'ocd_load_image'...
    Debug: 209 9 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
    Debug: 210 9 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
    Debug: 211 9 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
    Debug: 212 9 command.c:364 register_command_handler(): registering 'ocd_test_image'...
    Debug: 213 9 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
    Debug: 214 9 command.c:364 register_command_handler(): registering 'ocd_ps'...
    Debug: 215 9 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
    Debug: 216 9 hla_interface.c:109 hl_interface_init(): hl_interface_init
    Debug: 217 9 hla_layout.c:83 hl_layout_init(): hl_layout_init
    Debug: 218 9 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 219 9 core.c:1615 adapter_khz_to_speed(): have interface set up
    Info : 220 9 stlink_usb.c:1941 stlink_speed(): Unable to match requested speed 1000 kHz, using 950 kHz
    Debug: 221 9 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 222 9 core.c:1615 adapter_khz_to_speed(): have interface set up
    Info : 223 9 stlink_usb.c:1941 stlink_speed(): Unable to match requested speed 1000 kHz, using 950 kHz
    Info : 224 9 core.c:1394 adapter_init(): clock speed 950 kHz
    Debug: 225 9 openocd.c:142 handle_init_command(): Debug Adapter init complete
    Debug: 226 10 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
    Debug: 227 10 command.c:143 script_debug(): command - ocd_transport ocd_transport init
    Debug: 229 10 transport.c:239 handle_transport_init(): handle_transport_init
    Debug: 230 10 hla_transport.c:152 hl_transport_init(): hl_transport_init
    Debug: 231 10 hla_transport.c:169 hl_transport_init(): current transport hla_swd
    Debug: 232 10 hla_interface.c:42 hl_interface_open(): hl_interface_open
    Debug: 233 10 hla_layout.c:40 hl_layout_open(): hl_layout_open
    Debug: 234 10 stlink_usb.c:2010 stlink_usb_open(): stlink_usb_open
    Debug: 235 10 stlink_usb.c:2024 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3744 serial:
    Debug: 236 10 stlink_usb.c:2024 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial:
    Debug: 237 10 stlink_usb.c:2024 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374b serial:
    Info : 238 15 stlink_usb.c:641 stlink_usb_version(): STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
    Info : 239 15 stlink_usb.c:2136 stlink_usb_open(): using stlink api v2
    Debug: 240 15 stlink_usb.c:842 stlink_usb_init_mode(): MODE: 0x01
    Info : 241 15 stlink_usb.c:673 stlink_usb_check_voltage(): Target voltage: 3.545346
    Debug: 242 15 stlink_usb.c:897 stlink_usb_init_mode(): MODE: 0x01
    Debug: 243 16 stlink_usb.c:495 stlink_usb_error_check(): unknown/unexpected STLINK status code 0x9
    Error: 244 16 stlink_usb.c:2145 stlink_usb_open(): init mode failed (unable to connect to the target)
    Debug: 245 16 hla_layout.c:47 hl_layout_open(): failed
    Debug: 246 16 command.c:642 run_command(): Command failed with error code -4
    User : 247 16 command.c:705 command_run_line(): in procedure 'init'
    in procedure 'ocd_bouncer'
    Debug: 248 16 command.c:642 run_command(): Command failed with error code -4
    User : 249 16 command.c:705 command_run_line():
    Debug: 250 16 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Warn : 251 16 core.c:189 flash_free_all_banks(): Flash driver of nrf52.flash does not support free_driver_priv()
    Warn : 252 16 core.c:189 flash_free_all_banks(): Flash driver of nrf52.uicr does not support free_driver_priv()
    Debug: 253 16 hla_interface.c:117 hl_interface_quit(): hl_interface_quit

    => This mean the STLink connection should be the problem. 

Reply
  • Hi,

    I would like to add additional log (debug level = 3) when running OpenOcd:

    ./src/openocd -s ../tcl/ -d3 -f openocd_nrf52.cfg
    Open On-Chip Debugger 0.10.0+dev-00430-g0612315 (2018-06-15-10:18)
    Licensed under GNU GPL v2
    For bug reports, read
    openocd.org/.../bugs.html
    User : 13 3 command.c:544 command_print(): debug_level: 3
    Debug: 14 3 options.c:184 add_default_dirs(): bindir=/usr/local/bin
    Debug: 15 3 options.c:185 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
    Debug: 16 3 options.c:186 add_default_dirs(): exepath=/home/lamdinh/work/tools/openocd/_build/src
    Debug: 17 3 options.c:187 add_default_dirs(): bin2data=../share/openocd
    Debug: 18 3 configuration.c:42 add_script_search_dir(): adding /home/lamdinh/.openocd
    Debug: 19 3 configuration.c:42 add_script_search_dir(): adding /home/lamdinh/work/tools/openocd/_build/src/../share/openocd/site
    Debug: 20 3 configuration.c:42 add_script_search_dir(): adding /home/lamdinh/work/tools/openocd/_build/src/../share/openocd/scripts
    Debug: 21 4 configuration.c:97 find_file(): found openocd_nrf52.cfg
    Debug: 22 4 configuration.c:97 find_file(): found ../tcl//interface/stlink.cfg
    Debug: 23 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_interface hla
    Debug: 24 4 command.c:143 script_debug(): command - interface ocd_interface hla
    Debug: 26 4 command.c:364 register_command_handler(): registering 'ocd_hla_device_desc'...
    Debug: 27 4 command.c:364 register_command_handler(): registering 'ocd_hla_serial'...
    Debug: 28 4 command.c:364 register_command_handler(): registering 'ocd_hla_layout'...
    Debug: 29 4 command.c:364 register_command_handler(): registering 'ocd_hla_vid_pid'...
    Debug: 30 4 command.c:364 register_command_handler(): registering 'ocd_hla_command'...
    Debug: 31 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_layout stlink
    Debug: 32 4 command.c:143 script_debug(): command - hla_layout ocd_hla_layout stlink
    Debug: 34 4 hla_interface.c:244 hl_interface_handle_layout_command(): hl_interface_handle_layout_command
    Debug: 35 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_device_desc ST-LINK
    Debug: 36 4 command.c:143 script_debug(): command - hla_device_desc ocd_hla_device_desc ST-LINK
    Debug: 38 4 hla_interface.c:218 hl_interface_handle_device_desc_command(): hl_interface_handle_device_desc_command
    Debug: 39 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b
    Debug: 40 4 command.c:143 script_debug(): command - hla_vid_pid ocd_hla_vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b
    Debug: 42 4 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select hla_swd
    Debug: 43 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select hla_swd
    Debug: 44 5 hla_transport.c:191 hl_transport_select(): hl_transport_select
    Debug: 45 5 command.c:364 register_command_handler(): registering 'ocd_hla'...
    Debug: 46 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 47 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 48 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 49 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 50 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 51 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 52 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 53 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 54 5 command.c:364 register_command_handler(): registering 'ocd_jtag'...
    Debug: 55 5 command.c:364 register_command_handler(): registering 'ocd_jtag_ntrst_delay'...
    Debug: 56 5 configuration.c:97 find_file(): found ../tcl//target/nrf52.cfg
    Debug: 57 5 configuration.c:97 find_file(): found ../tcl//target/swj-dp.tcl
    Debug: 58 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 59 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 60 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 61 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 62 5 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 63 5 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 64 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 65 6 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 66 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_hla newtap nrf52 cpu -expected-id 0x2ba01477
    Debug: 67 6 command.c:143 script_debug(): command - ocd_hla ocd_hla newtap nrf52 cpu -expected-id 0x2ba01477
    Debug: 68 6 hla_tcl.c:111 jim_hl_newtap_cmd(): Creating New Tap, Chip: nrf52, Tap: cpu, Dotted: nrf52.cpu, 2 params
    Debug: 69 6 hla_tcl.c:121 jim_hl_newtap_cmd(): Processing option: -expected-id
    Debug: 70 6 core.c:1304 jtag_tap_init(): Created Tap: nrf52.cpu @ abs position 0, irlen 0, capture: 0x0 mask: 0x0
    Debug: 71 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_dap create nrf52.dap -chain-position nrf52.cpu
    Debug: 72 6 command.c:143 script_debug(): command - ocd_dap ocd_dap create nrf52.dap -chain-position nrf52.cpu
    Debug: 73 6 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target create nrf52.cpu cortex_m -dap nrf52.dap
    Debug: 74 6 command.c:143 script_debug(): command - ocd_target ocd_target create nrf52.cpu cortex_m -dap nrf52.dap
    Info : 75 6 target.c:5532 target_create(): The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    Debug: 76 6 hla_target.c:367 adapter_target_create(): adapter_target_create
    Debug: 77 6 hla_target.c:338 adapter_init_arch_info(): adapter_init_arch_info
    Debug: 78 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 79 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 80 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 81 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 82 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 83 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 84 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 85 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 86 6 command.c:364 register_command_handler(): registering 'ocd_arm'...
    Debug: 87 6 command.c:364 register_command_handler(): registering 'ocd_tpiu'...
    Debug: 88 6 command.c:364 register_command_handler(): registering 'ocd_itm'...
    Debug: 89 6 command.c:364 register_command_handler(): registering 'ocd_itm'...
    Debug: 90 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 91 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 92 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 93 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 94 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 95 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 96 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 97 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 98 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 99 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 100 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 101 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 102 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 103 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 104 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 105 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 106 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 107 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 108 6 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 109 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 110 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 111 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 112 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 113 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 114 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 115 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 116 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 117 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 118 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 119 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 120 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 121 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 122 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 123 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 124 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 125 7 command.c:364 register_command_handler(): registering 'ocd_nrf52.cpu'...
    Debug: 126 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 1000
    Debug: 127 7 command.c:143 script_debug(): command - adapter_khz ocd_adapter_khz 1000
    Debug: 129 7 core.c:1645 jtag_config_khz(): handle jtag khz
    Debug: 130 7 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 131 7 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    User : 132 7 command.c:544 command_print(): adapter speed: 1000 kHz
    Debug: 133 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
    Debug: 134 7 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
    Debug: 135 7 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 136 7 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 137 7 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 138 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport select
    Debug: 139 7 command.c:143 script_debug(): command - ocd_transport ocd_transport select
    Debug: 140 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash bank nrf52.flash nrf5 0x00000000 0 1 1 nrf52.cpu
    Debug: 141 7 command.c:143 script_debug(): command - ocd_flash ocd_flash bank nrf52.flash nrf5 0x00000000 0 1 1 nrf52.cpu
    Debug: 143 7 command.c:323 command_new(): BUG: command 'nrf5 mass_erase' does not have the '.usage' field filled out
    Debug: 144 7 command.c:364 register_command_handler(): registering 'ocd_nrf5'...
    Debug: 145 7 command.c:323 command_new(): BUG: command 'nrf51 mass_erase' does not have the '.usage' field filled out
    Debug: 146 7 command.c:364 register_command_handler(): registering 'ocd_nrf51'...
    Debug: 147 7 tcl.c:1146 handle_flash_bank_command(): 'nrf5' driver usage field missing
    Debug: 148 7 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_flash bank nrf52.uicr nrf5 0x10001000 0 1 1 nrf52.cpu
    Debug: 149 7 command.c:143 script_debug(): command - ocd_flash ocd_flash bank nrf52.uicr nrf5 0x10001000 0 1 1 nrf52.cpu
    Debug: 151 7 command.c:399 register_command(): command 'nrf5' is already registered in '<global>' context
    Debug: 152 7 command.c:399 register_command(): command 'mass_erase' is already registered in 'nrf5' context
    Debug: 153 7 command.c:399 register_command(): command 'nrf51' is already registered in '<global>' context
    Debug: 154 7 command.c:399 register_command(): command 'mass_erase' is already registered in 'nrf51' context
    Debug: 155 7 tcl.c:1146 handle_flash_bank_command(): 'nrf5' driver usage field missing
    Info : 156 8 server.c:307 add_service(): Listening on port 6666 for tcl connections
    Info : 157 8 server.c:307 add_service(): Listening on port 4444 for telnet connections
    Debug: 158 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_init
    Debug: 159 8 command.c:143 script_debug(): command - init ocd_init
    Debug: 161 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target init
    Debug: 162 8 command.c:143 script_debug(): command - ocd_target ocd_target init
    Debug: 164 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_target names
    Debug: 165 8 command.c:143 script_debug(): command - ocd_target ocd_target names
    Debug: 166 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu cget -event gdb-flash-erase-start
    Debug: 167 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu cget -event gdb-flash-erase-start
    Debug: 168 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -event gdb-flash-erase-start reset init
    Debug: 169 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -event gdb-flash-erase-start reset init
    Debug: 170 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu cget -event gdb-flash-write-end
    Debug: 171 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu cget -event gdb-flash-write-end
    Debug: 172 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -event gdb-flash-write-end reset halt
    Debug: 173 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -event gdb-flash-write-end reset halt
    Debug: 174 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu cget -event gdb-attach
    Debug: 175 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu cget -event gdb-attach
    Debug: 176 8 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_nrf52.cpu configure -event gdb-attach halt
    Debug: 177 8 command.c:143 script_debug(): command - ocd_nrf52.cpu ocd_nrf52.cpu configure -event gdb-attach halt
    Debug: 178 8 target.c:1362 handle_target_init_command(): Initializing targets...
    Debug: 179 8 hla_target.c:357 adapter_init_target(): adapter_init_target
    Debug: 180 8 semihosting_common.c:97 semihosting_common_init():
    Debug: 181 8 command.c:364 register_command_handler(): registering 'ocd_target_request'...
    Debug: 182 8 command.c:364 register_command_handler(): registering 'ocd_trace'...
    Debug: 183 8 command.c:364 register_command_handler(): registering 'ocd_trace'...
    Debug: 184 8 command.c:364 register_command_handler(): registering 'ocd_fast_load_image'...
    Debug: 185 8 command.c:364 register_command_handler(): registering 'ocd_fast_load'...
    Debug: 186 8 command.c:364 register_command_handler(): registering 'ocd_profile'...
    Debug: 187 8 command.c:364 register_command_handler(): registering 'ocd_virt2phys'...
    Debug: 188 9 command.c:364 register_command_handler(): registering 'ocd_reg'...
    Debug: 189 9 command.c:364 register_command_handler(): registering 'ocd_poll'...
    Debug: 190 9 command.c:364 register_command_handler(): registering 'ocd_wait_halt'...
    Debug: 191 9 command.c:364 register_command_handler(): registering 'ocd_halt'...
    Debug: 192 9 command.c:364 register_command_handler(): registering 'ocd_resume'...
    Debug: 193 9 command.c:364 register_command_handler(): registering 'ocd_reset'...
    Debug: 194 9 command.c:364 register_command_handler(): registering 'ocd_soft_reset_halt'...
    Debug: 195 9 command.c:364 register_command_handler(): registering 'ocd_step'...
    Debug: 196 9 command.c:364 register_command_handler(): registering 'ocd_mdd'...
    Debug: 197 9 command.c:364 register_command_handler(): registering 'ocd_mdw'...
    Debug: 198 9 command.c:364 register_command_handler(): registering 'ocd_mdh'...
    Debug: 199 9 command.c:364 register_command_handler(): registering 'ocd_mdb'...
    Debug: 200 9 command.c:364 register_command_handler(): registering 'ocd_mwd'...
    Debug: 201 9 command.c:364 register_command_handler(): registering 'ocd_mww'...
    Debug: 202 9 command.c:364 register_command_handler(): registering 'ocd_mwh'...
    Debug: 203 9 command.c:364 register_command_handler(): registering 'ocd_mwb'...
    Debug: 204 9 command.c:364 register_command_handler(): registering 'ocd_bp'...
    Debug: 205 9 command.c:364 register_command_handler(): registering 'ocd_rbp'...
    Debug: 206 9 command.c:364 register_command_handler(): registering 'ocd_wp'...
    Debug: 207 9 command.c:364 register_command_handler(): registering 'ocd_rwp'...
    Debug: 208 9 command.c:364 register_command_handler(): registering 'ocd_load_image'...
    Debug: 209 9 command.c:364 register_command_handler(): registering 'ocd_dump_image'...
    Debug: 210 9 command.c:364 register_command_handler(): registering 'ocd_verify_image_checksum'...
    Debug: 211 9 command.c:364 register_command_handler(): registering 'ocd_verify_image'...
    Debug: 212 9 command.c:364 register_command_handler(): registering 'ocd_test_image'...
    Debug: 213 9 command.c:364 register_command_handler(): registering 'ocd_reset_nag'...
    Debug: 214 9 command.c:364 register_command_handler(): registering 'ocd_ps'...
    Debug: 215 9 command.c:364 register_command_handler(): registering 'ocd_test_mem_access'...
    Debug: 216 9 hla_interface.c:109 hl_interface_init(): hl_interface_init
    Debug: 217 9 hla_layout.c:83 hl_layout_init(): hl_layout_init
    Debug: 218 9 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 219 9 core.c:1615 adapter_khz_to_speed(): have interface set up
    Info : 220 9 stlink_usb.c:1941 stlink_speed(): Unable to match requested speed 1000 kHz, using 950 kHz
    Debug: 221 9 core.c:1612 adapter_khz_to_speed(): convert khz to interface specific speed value
    Debug: 222 9 core.c:1615 adapter_khz_to_speed(): have interface set up
    Info : 223 9 stlink_usb.c:1941 stlink_speed(): Unable to match requested speed 1000 kHz, using 950 kHz
    Info : 224 9 core.c:1394 adapter_init(): clock speed 950 kHz
    Debug: 225 9 openocd.c:142 handle_init_command(): Debug Adapter init complete
    Debug: 226 10 command.c:143 script_debug(): command - ocd_command ocd_command type ocd_transport init
    Debug: 227 10 command.c:143 script_debug(): command - ocd_transport ocd_transport init
    Debug: 229 10 transport.c:239 handle_transport_init(): handle_transport_init
    Debug: 230 10 hla_transport.c:152 hl_transport_init(): hl_transport_init
    Debug: 231 10 hla_transport.c:169 hl_transport_init(): current transport hla_swd
    Debug: 232 10 hla_interface.c:42 hl_interface_open(): hl_interface_open
    Debug: 233 10 hla_layout.c:40 hl_layout_open(): hl_layout_open
    Debug: 234 10 stlink_usb.c:2010 stlink_usb_open(): stlink_usb_open
    Debug: 235 10 stlink_usb.c:2024 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3744 serial:
    Debug: 236 10 stlink_usb.c:2024 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial:
    Debug: 237 10 stlink_usb.c:2024 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x374b serial:
    Info : 238 15 stlink_usb.c:641 stlink_usb_version(): STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
    Info : 239 15 stlink_usb.c:2136 stlink_usb_open(): using stlink api v2
    Debug: 240 15 stlink_usb.c:842 stlink_usb_init_mode(): MODE: 0x01
    Info : 241 15 stlink_usb.c:673 stlink_usb_check_voltage(): Target voltage: 3.545346
    Debug: 242 15 stlink_usb.c:897 stlink_usb_init_mode(): MODE: 0x01
    Debug: 243 16 stlink_usb.c:495 stlink_usb_error_check(): unknown/unexpected STLINK status code 0x9
    Error: 244 16 stlink_usb.c:2145 stlink_usb_open(): init mode failed (unable to connect to the target)
    Debug: 245 16 hla_layout.c:47 hl_layout_open(): failed
    Debug: 246 16 command.c:642 run_command(): Command failed with error code -4
    User : 247 16 command.c:705 command_run_line(): in procedure 'init'
    in procedure 'ocd_bouncer'
    Debug: 248 16 command.c:642 run_command(): Command failed with error code -4
    User : 249 16 command.c:705 command_run_line():
    Debug: 250 16 target.c:1971 target_free_all_working_areas_restore(): freeing all working areas
    Warn : 251 16 core.c:189 flash_free_all_banks(): Flash driver of nrf52.flash does not support free_driver_priv()
    Warn : 252 16 core.c:189 flash_free_all_banks(): Flash driver of nrf52.uicr does not support free_driver_priv()
    Debug: 253 16 hla_interface.c:117 hl_interface_quit(): hl_interface_quit

    => This mean the STLink connection should be the problem. 

Children
Related