Command 'dap init' failed. CDBGPWRUPACK=0

I bought three ebyte E104-BT5040U USB dongle but it doesn't work.

I was program a ebyte E104-BT5040U USB dongle using openocd。I use daplink(2023-8-24) and openocd 0.12.0 (2023-07-12).

The chip locked after reset.

Then I try recover this chip. 

openocd.exe -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c init -c nrf52_recover -d4
Open On-Chip Debugger 0.12.0 (2023-07-12) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 4 8 options.c:53 configuration_output_handler(): debug_level: 4User : 5 15 options.c:53 configuration_output_handler():
Debug: 6 17 options.c:234 add_default_dirs(): bindir=../../bin
Debug: 7 19 options.c:235 add_default_dirs(): pkgdatadir=../../share/openocd
Debug: 8 21 options.c:236 add_default_dirs(): exepath=Z:/Downloads/OpenOCD-20230712-0.12.0/bin
Debug: 9 25 options.c:237 add_default_dirs(): bin2data=../share/openocd
Debug: 10 28 configuration.c:33 add_script_search_dir(): adding C:/Users/Administrator/AppData/Roaming/OpenOCD
Debug: 11 39 configuration.c:33 add_script_search_dir(): adding Z:/Downloads/OpenOCD-20230712-0.12.0/bin/../share/openocd/site
Debug: 12 45 configuration.c:33 add_script_search_dir(): adding Z:/Downloads/OpenOCD-20230712-0.12.0/bin/../share/openocd/scripts
Debug: 13 57 command.c:152 script_debug(): command - ocd_find interface/cmsis-dap.cfg
Debug: 14 62 configuration.c:88 find_file(): found Z:/Downloads/OpenOCD-20230712-0.12.0/bin/../share/openocd/scripts/interface/cmsis-dap.cfg
Debug: 15 67 command.c:152 script_debug(): command - adapter driver cmsis-dap
Debug: 16 74 command.c:152 script_debug(): command - ocd_find target/nrf52.cfg
Debug: 17 77 configuration.c:88 find_file(): found Z:/Downloads/OpenOCD-20230712-0.12.0/bin/../share/openocd/scripts/target/nrf52.cfg
Debug: 18 91 command.c:152 script_debug(): command - ocd_find target/swj-dp.tcl
Debug: 19 93 configuration.c:88 find_file(): found Z:/Downloads/OpenOCD-20230712-0.12.0/bin/../share/openocd/scripts/target/swj-dp.tcl
Debug: 20 106 command.c:152 script_debug(): command - transport select
Info : 21 107 transport.c:267 handle_transport_select(): auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Debug: 22 118 command.c:152 script_debug(): command - transport select
Debug: 23 123 command.c:152 script_debug(): command - transport select
Debug: 24 125 command.c:152 script_debug(): command - swd newdap nrf52 cpu -expected-id 0x2ba01477
Debug: 25 134 tcl.c:418 handle_jtag_newtap_args(): Creating New Tap, Chip: nrf52, Tap: cpu, Dotted: nrf52.cpu, 2 params
Debug: 26 138 core.c:1474 jtag_tap_init(): Created Tap: nrf52.cpu @ abs position 0, irlen 0, capture: 0x1 mask: 0x3
Debug: 27 141 command.c:152 script_debug(): command - dap create nrf52.dap -chain-position nrf52.cpu
Debug: 28 148 command.c:152 script_debug(): command - target create nrf52.cpu cortex_m -dap nrf52.dap
Debug: 29 153 command.c:286 register_command(): command 'tpiu' is already registered
Debug: 30 157 command.c:286 register_command(): command 'rtt' is already registered
Debug: 31 164 command.c:152 script_debug(): command - adapter speed 1000
Debug: 32 166 adapter.c:249 adapter_config_khz(): handle adapter khz
Debug: 33 170 adapter.c:213 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 34 173 adapter.c:213 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 35 181 command.c:152 script_debug(): command - nrf52.cpu configure -work-area-phys 0x20000000 -work-area-size 0x4000 -work-area-backup 0
Debug: 36 187 target.c:2171 target_free_all_working_areas_restore(): freeing all working areas
Debug: 37 190 target.c:2171 target_free_all_working_areas_restore(): freeing all working areas
Debug: 38 198 target.c:2171 target_free_all_working_areas_restore(): freeing all working areas
Debug: 39 202 command.c:152 script_debug(): command - transport select
Debug: 40 204 command.c:152 script_debug(): command - cortex_m reset_config sysresetreq
Debug: 41 212 command.c:152 script_debug(): command - nrf52.cpu configure -event examine-fail nrf52_check_ap_lock
Debug: 42 217 command.c:152 script_debug(): command - flash bank nrf52.flash nrf5 0x00000000 0 1 1 nrf52.cpu
Debug: 43 221 tcl.c:1306 handle_flash_bank_command(): 'nrf5' driver usage field missing
Debug: 44 227 command.c:152 script_debug(): command - flash bank nrf52.uicr nrf5 0x10001000 0 1 1 nrf52.cpu
Debug: 45 233 command.c:286 register_command(): command 'nrf5' is already registered
Debug: 46 237 command.c:286 register_command(): command 'nrf5 mass_erase' is already registered
Debug: 47 243 command.c:286 register_command(): command 'nrf5 info' is already registered
Debug: 48 249 command.c:286 register_command(): command 'nrf51' is already registered
Debug: 49 257 command.c:286 register_command(): command 'nrf51 mass_erase' is already registered
Debug: 50 260 command.c:286 register_command(): command 'nrf51 info' is already registered
Debug: 51 264 tcl.c:1306 handle_flash_bank_command(): 'nrf5' driver usage field missing
Debug: 52 272 command.c:152 script_debug(): command - add_help_text nrf52_recover Mass erase and unlock nRF52 device
Debug: 53 276 command.c:152 script_debug(): command - init
Debug: 54 279 command.c:152 script_debug(): command - target init
Debug: 55 288 command.c:152 script_debug(): command - target names
Debug: 56 290 command.c:152 script_debug(): command - nrf52.cpu cget -event gdb-flash-erase-start
Debug: 57 294 command.c:152 script_debug(): command - nrf52.cpu configure -event gdb-flash-erase-start reset init
Debug: 58 299 command.c:152 script_debug(): command - nrf52.cpu cget -event gdb-flash-write-end
Debug: 59 309 command.c:152 script_debug(): command - nrf52.cpu configure -event gdb-flash-write-end reset halt
Debug: 60 313 command.c:152 script_debug(): command - nrf52.cpu cget -event gdb-attach
Debug: 61 321 command.c:152 script_debug(): command - nrf52.cpu configure -event gdb-attach halt 1000
Debug: 62 325 target.c:1629 handle_target_init_command(): Initializing targets...
Debug: 63 329 semihosting_common.c:107 semihosting_common_init():
Debug: 64 362 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x17ef:0x6099: No such device (it may have been disconnected)
Debug: 65 369 cmsis_dap_usb_bulk.c:150 cmsis_dap_usb_open(): found product string of 0x0d28:0x0204 'CMSIS-DAP v1'
Debug: 66 372 cmsis_dap_usb_bulk.c:170 cmsis_dap_usb_open(): enumerating interfaces of 0x0d28:0x0204
Debug: 67 376 cmsis_dap_usb_bulk.c:211 cmsis_dap_usb_open(): could not read interface string 8 for device 0x0d28:0x0204: Invalid parameter
Debug: 68 380 cmsis_dap_usb_bulk.c:237 cmsis_dap_usb_open(): skipping interface 0, endpoint[0] is not bulk out
Debug: 69 384 cmsis_dap_usb_bulk.c:211 cmsis_dap_usb_open(): could not read interface string 4 for device 0x0d28:0x0204: Invalid parameter
Debug: 70 390 cmsis_dap_usb_bulk.c:230 cmsis_dap_usb_open(): skipping interface 1, has only 1 endpoints
Debug: 71 393 cmsis_dap_usb_bulk.c:211 cmsis_dap_usb_open(): could not read interface string 5 for device 0x0d28:0x0204: Invalid parameter
Debug: 72 402 cmsis_dap_usb_bulk.c:276 cmsis_dap_usb_open(): skipping interface 2, class 10 subclass 0 protocol 0
Debug: 73 407 cmsis_dap_usb_bulk.c:211 cmsis_dap_usb_open(): could not read interface string 6 for device 0x0d28:0x0204: Invalid parameter
Debug: 74 415 cmsis_dap_usb_bulk.c:237 cmsis_dap_usb_open(): skipping interface 3, endpoint[0] is not bulk out
Debug: 75 420 cmsis_dap_usb_bulk.c:211 cmsis_dap_usb_open(): could not read interface string 7 for device 0x0d28:0x0204: Invalid parameter
Debug: 76 424 cmsis_dap_usb_bulk.c:230 cmsis_dap_usb_open(): skipping interface 4, has only 0 endpoints
Debug: 77 430 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x0bda:0x9210: Operation not supported or unimplemented on this platform
Debug: 78 436 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x8086:0xa36d: Operation not supported or unimplemented on this platform
Debug: 79 441 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x0bda:0xc811: Operation not supported or unimplemented on this platform
Debug: 80 452 cmsis_dap_usb_bulk.c:170 cmsis_dap_usb_open(): enumerating interfaces of 0x17ef:0x608d
Info : 81 482 cmsis_dap.c:1112 cmsis_dap_get_caps_info(): CMSIS-DAP: SWD supported
Info : 82 485 cmsis_dap.c:1112 cmsis_dap_get_caps_info(): CMSIS-DAP: Atomic commands supported
Info : 83 491 cmsis_dap.c:1112 cmsis_dap_get_caps_info(): CMSIS-DAP: Test domain timer supported
Info : 84 499 cmsis_dap.c:1089 cmsis_dap_get_version_info(): CMSIS-DAP: FW Version = 2.1.0
Info : 85 510 cmsis_dap.c:1074 cmsis_dap_get_serial_info(): CMSIS-DAP: Serial# = 070000011a5a5bb6000000000001e1fea5a5a5a597969908
Info : 86 518 cmsis_dap.c:1243 cmsis_dap_swd_open(): CMSIS-DAP: Interface Initialised (SWD)
Debug: 87 528 cmsis_dap.c:1328 cmsis_dap_init(): CMSIS-DAP: Packet Count = 100
Debug: 88 531 cmsis_dap.c:1331 cmsis_dap_init(): Allocating FIFO for 4 pending packets
Info : 89 541 cmsis_dap.c:1145 cmsis_dap_get_status(): SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : 90 556 cmsis_dap.c:1383 cmsis_dap_init(): CMSIS-DAP: Interface ready
Debug: 91 559 adapter.c:213 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 92 564 adapter.c:217 adapter_khz_to_speed(): have adapter set up
Debug: 93 573 adapter.c:213 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 94 576 adapter.c:217 adapter_khz_to_speed(): have adapter set up
Info : 95 578 adapter.c:177 adapter_init(): clock speed 1000 kHz
Debug: 96 587 openocd.c:133 handle_init_command(): Debug Adapter init complete
Debug: 97 592 command.c:152 script_debug(): command - transport init
Debug: 98 594 transport.c:219 handle_transport_init(): handle_transport_init
Debug: 99 605 command.c:152 script_debug(): command - dap init
Debug: 100 607 arm_dap.c:95 dap_init_all(): Initializing all DAPs ...
Debug: 101 616 arm_dap.c:119 dap_init_all(): DAP nrf52.cpu configured by default to use ADIv5 protocol
Debug: 102 626 cmsis_dap.c:1187 cmsis_dap_swd_switch_seq(): JTAG-to-SWD
Debug: 103 633 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 104 638 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 0 0
Debug: 105 644 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 106 650 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: 2ba01477
Info : 107 654 adi_v5_swd.c:370 swd_connect_single(): SWD DPIDR 0x2ba01477
Debug: 108 656 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 109 666 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP write reg 0 1e
Debug: 110 672 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 111 676 arm_adi_v5.c:679 dap_dp_init(): nrf52.dap
Debug: 112 678 arm_adi_v5.c:711 dap_dp_init(): DAP: wait CDBGPWRUPACK
Debug: 113 681 arm_adi_v5.h:641 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000
Debug: 114 686 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 5 queued transactions from FIFO index 0
Debug: 115 690 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP write reg 8 0
Debug: 116 696 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP write reg 4 50000020
Debug: 117 701 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 118 703 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP write reg 4 50000000
Debug: 119 711 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 120 719 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 5 queued transactions FIFO index 0 timeout 6000
Debug: 121 724 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 122 727 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 123 744 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 124 749 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 125 758 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 126 765 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 127 791 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 128 795 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 129 801 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 130 807 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 131 822 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 132 827 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 133 832 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 134 842 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 135 868 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 136 873 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 137 877 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 138 881 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 139 899 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 140 904 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 141 909 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 142 918 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 143 946 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 144 950 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 145 958 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 146 965 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 147 993 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 148 998 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 149 1002 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 150 1006 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 151 1024 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 152 1029 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 153 1034 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 154 1044 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 155 1070 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 1 queued transactions from FIFO index 0, same swd ops
Debug: 156 1074 cmsis_dap.c:797 cmsis_dap_swd_write_from_queue(): DP read reg 4 0
Debug: 157 1079 cmsis_dap.c:902 cmsis_dap_swd_read_process(): Received results of 1 queued transactions FIFO index 0 timeout 6000
Debug: 158 1084 cmsis_dap.c:913 cmsis_dap_swd_read_process(): Read result: d0000040
Debug: 159 1101 arm_adi_v5.h:655 dap_dp_poll_register(): DAP: poll 4 timeout
Debug: 160 1106 command.c:541 run_command(): Command 'dap init' failed with error code -5
User : 161 1108 command.c:613 command_run_line():
Debug: 162 1115 command.c:541 run_command(): Command 'init' failed with error code -4
User : 163 1120 command.c:613 command_run_line():
Debug: 164 1122 target.c:2171 target_free_all_working_areas_restore(): freeing all working areas
Debug: 165 1137 cmsis_dap.c:1197 cmsis_dap_swd_switch_seq(): SWD-to-JTAG
Debug: 166 1144 cmsis_dap.c:764 cmsis_dap_swd_write_from_queue(): Executing 0 queued transactions from FIFO index 0, same swd ops

It wait CDBGPWRUPACK unitl timeout.

It seems damaged after several times Insert the USB port.

I read this comment on nrf52.cfg on openocd script folder.

# Mass erase and unlock the device using proprietary nRF CTRL-AP (AP #1)
# http://www.ebyte.com produces modules with nRF52 locked by default,
# use nrf52_recover to enable flashing and debug.
I need help to fix this error. 
Parents Reply Children
  • Thanks. The supported one is on its way, it will be here in two weeks. However, I'm still wondering why this one is not working. Meanwhile, I have tested another non-official debugger, the black magic probe, and I have the same result. I cannot connect to the thing. I really hope that the official works.

  • The official SEGGER J-LINK just has arrived. Now I can use "nrfjprog --recover -f NRF52 --log". But the results is similar: I have no access to the device. Disappointed

    Recovering device. This operation might take 30s.
    [error] [ Client] - Encountered error -21: Command recover executed for 10012 milliseconds with result -21
    [error] [ Worker] - 10 second timeout elapsed, no time left to wait for debug port to power up.
    ERROR: Recover failed. Please make sure that the correct device family is given
    ERROR: and try again.

    There is no more messages. What is this -21 ? And how could I fix it?

  • Hi,

    Please create a new ticket for this issue, a new engineer will be help you out once the ticket has been made,

    regards

    Jared 

Related