output was
PS C:\Users\joerg\github\openocd\bin> ./openocd.exe -f ../share/openocd/scripts/interface/stlink.cfg -f ../share/openocd/scripts/target/nrf52.cfg -c "program TSDZ2_wireless-bootloader_with_sd-v0.9.0.hex verify" -c "exit"
Open On-Chip Debugger 0.12.0 (2023-10-02) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
nRF52 device has a CTRL-AP dedicated to recover the device from AP lock.
A high level adapter (like a ST-Link) you are currently using cannot access
the CTRL-AP so 'nrf52_recover' command will not work.
Do not enable UICR APPROTECT.
Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.256685
Warn : target nrf52.cpu examination failed
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
embedded:startup.tcl:1467: Error: Unable to reset target
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1504
at file "embedded:startup.tcl", line 1467
PS C:\Users\joerg\github\openocd\bin>
after researching I tried
PS C:\Users\joerg\github\openocd\bin> ./openocd.exe -f ../share/openocd/scripts/interface/stlink.cfg -f ../share/openocd/scripts/target/nrf52.cfg -c "adapter speed 950" -c "init" -c "halt" -c "nrf52.dap apreg 1 0x04 0x01" -c "nrf5 mass_erase" -c "program TSDZ2_wireless-bootloader_with_sd-v0.9.0.hex verify" -c "exit"
Open On-Chip Debugger 0.12.0 (2023-10-02) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
nRF52 device has a CTRL-AP dedicated to recover the device from AP lock.
A high level adapter (like a ST-Link) you are currently using cannot access
the CTRL-AP so 'nrf52_recover' command will not work.
Do not enable UICR APPROTECT.
adapter speed: 950 kHz
Info : clock speed 950 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.255080
Warn : target nrf52.cpu examination failed
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
Error: Target not examined yet
openocd on linux: same issue
I was able to telnet connect via putty localhost 4444.
Open On-Chip Debugger
init
halt
Target not examined yet
nrf52.dap apreg 1 0x04 0x01
nrf52.dap
Norsic Tool nrfutil
nrfutil pkg generate --hw-version 52 --debug-mode --sd-req=0x00 --application TSDZ2_wireless-bootloader_with_sd-v0.9.0.hex --application-version 1 app.zip
nrfutil dfu usb-serial -pkg app.zip -p COM6
PS C:\Users\joerg\github\work> nrfutil dfu usb-serial -pkg app.zip -p COM6
[------------------------------------] 0%
Traceback (most recent call last):
File "nordicsemi__main.py", line 1555, in
File "click\core.py", line 1137, in call
File "click\core.py", line 1062, in main
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1404, in invoke
File "click\core.py", line 763, in invoke
File "nordicsemi__main__.py", line 1032, in usb_serial
File "nordicsemi\main.py", line 988, in do_serial
File "nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_serial.py", line 250, in send_init_packet
File "nordicsemi\dfu\dfu_transport_serial.py", line 244, in try_to_recover
File "nordicsemi\dfu\dfu_transport_serial.py", line 421, in execute
File "nordicsemi\dfu\dfu_transport_serial.py", line 504, in get_response
pc_ble_driver_py.exceptions.NordicSemiException: Response Code InsufficientResources
[15196] Failed to execute script 'main__' due to unhandled exception!
PS C:\Users\joerg\github\work>
I have a tsdz2 motor and found this project for a wireless solution. I bought a nRF52840 Nordic USB Dongle cabeled it as discribed in https://opensourceebike.github.io/easy_diy_display_ebike_display/tsdz2_wireless/getting_started.html to a stlink-v2 and followed the instruction https://opensourceebike.github.io/easy_diy_display_ebike_display/tsdz2_wireless/windows.html
flashing failed
output was PS C:\Users\joerg\github\openocd\bin> ./openocd.exe -f ../share/openocd/scripts/interface/stlink.cfg -f ../share/openocd/scripts/target/nrf52.cfg -c "program TSDZ2_wireless-bootloader_with_sd-v0.9.0.hex verify" -c "exit" Open On-Chip Debugger 0.12.0 (2023-10-02) [https://github.com/sysprogs/openocd] Licensed under GNU GPL v2 libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "hla_swd". To override use 'transport select'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
nRF52 device has a CTRL-AP dedicated to recover the device from AP lock. A high level adapter (like a ST-Link) you are currently using cannot access the CTRL-AP so 'nrf52_recover' command will not work. Do not enable UICR APPROTECT.
Info : clock speed 1000 kHz Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.256685 Warn : target nrf52.cpu examination failed Info : starting gdb server for nrf52.cpu on 3333 Info : Listening on port 3333 for gdb connections embedded:startup.tcl:1467: Error: Unable to reset target in procedure 'program' in procedure 'program_error' called at file "embedded:startup.tcl", line 1504 at file "embedded:startup.tcl", line 1467 PS C:\Users\joerg\github\openocd\bin>
after researching I tried
PS C:\Users\joerg\github\openocd\bin> ./openocd.exe -f ../share/openocd/scripts/interface/stlink.cfg -f ../share/openocd/scripts/target/nrf52.cfg -c "adapter speed 950" -c "init" -c "halt" -c "nrf52.dap apreg 1 0x04 0x01" -c "nrf5 mass_erase" -c "program TSDZ2_wireless-bootloader_with_sd-v0.9.0.hex verify" -c "exit" Open On-Chip Debugger 0.12.0 (2023-10-02) [https://github.com/sysprogs/openocd] Licensed under GNU GPL v2 libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "hla_swd". To override use 'transport select'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
nRF52 device has a CTRL-AP dedicated to recover the device from AP lock. A high level adapter (like a ST-Link) you are currently using cannot access the CTRL-AP so 'nrf52_recover' command will not work. Do not enable UICR APPROTECT.
adapter speed: 950 kHz Info : clock speed 950 kHz Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748 Info : Target voltage: 3.255080 Warn : target nrf52.cpu examination failed Info : starting gdb server for nrf52.cpu on 3333 Info : Listening on port 3333 for gdb connections Error: Target not examined yet
openocd on linux: same issue I was able to telnet connect via putty localhost 4444. Open On-Chip Debugger
Norsic Tool nrfutil nrfutil pkg generate --hw-version 52 --debug-mode --sd-req=0x00 --application TSDZ2_wireless-bootloader_with_sd-v0.9.0.hex --application-version 1 app.zip nrfutil dfu usb-serial -pkg app.zip -p COM6 PS C:\Users\joerg\github\work> nrfutil dfu usb-serial -pkg app.zip -p COM6 [------------------------------------] 0% Traceback (most recent call last): File "nordicsemi__main.py", line 1555, in
File "click\core.py", line 1137, in call
File "click\core.py", line 1062, in main
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1668, in invoke
File "click\core.py", line 1404, in invoke
File "click\core.py", line 763, in invoke
File "nordicsemi__main__.py", line 1032, in usb_serial
File "nordicsemi\main.py", line 988, in do_serial
File "nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
File "nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image
File "nordicsemi\dfu\dfu_transport_serial.py", line 250, in send_init_packet
File "nordicsemi\dfu\dfu_transport_serial.py", line 244, in try_to_recover
File "nordicsemi\dfu\dfu_transport_serial.py", line 421, in execute
File "nordicsemi\dfu\dfu_transport_serial.py", line 504, in get_response
pc_ble_driver_py.exceptions.NordicSemiException: Response Code InsufficientResources
[15196] Failed to execute script 'main__' due to unhandled exception!
PS C:\Users\joerg\github\work>
Can anyone help?