rananna said:I have seen errors like that when power is incorrectly applied to the programmer.beemac said:Filippods said:beemac said:Doesn't work in what way? Can you paste the output...
c:\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.10.0 (2020-12-28) [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 <transport>'.
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 V2J35S7 (API v2) VIDID 0483:3748
Info : Target voltage: 3.208918
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000a80 msp: 0x20000400
** Programming Started **
Info : nRF52840-xxAA(build code: D0) 1024kB Flash, 256kB RAM
Info : Padding image section 0 at 0x00000b00 with 1272 bytes
Info : Flash write discontinued at 0x0002f740, next section at 0x000eb000
Warn : Adding extra erase range, 0x0002f740 .. 0x0002ffff
Error: Error waiting NVMC_READY: generic flash write/erase error (check protection etc...)
Error: Failed to enable read-only operation
Error: Failed to erase reg: 0x4001e508 val: 0x0002e000
Error: Error erasing sector 46
Error: failed erasing sectors 0 to 47
embedded:startup.tcl:509: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 574
at file "embedded:startup.tcl", line 509
c:\OpenOCD\bin>
Not an error I've seen before - and looks like you're using the same version of openocd as I do 20201228 from here https://gnutoolchains.com/arm-eabi/openocd/ Do you have another nrf to try to eliminate a hardware problem?
The 3.3 v line from the stink should ONLY be connected to vbus on the nrf52840 if there is no other 5v supply being used on vbus.
If you are powering the board with 5v from a dcdc converter or external power supply, please disconnect the stlink 3.3v line.
Then try reprogramming.
When i connect the nrf to stlink i disconnect it from psu.
NRF -> stlink
VBUS -> 3.3V
GND -> GND
SWDIO -> SWDIO
SWDCLIK -> SWCLK