openhaystack
openhaystack copied to clipboard
nRF51822 error: open failed
There is this nice tutorial how to transfer the .bin to the nrf51 device, but I fail at step 7. I get the error:
openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/local/share/openocd/scripts/target/nrf51.cfg
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
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
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Error: open failed
I am unsure how to connect Bat+ and Bat- and which way to put in the battery. I tested several ways here.
I also tried in windows after installing openocd via msys64 and got the same error. What I did:
- Download and Install msys64
- Install openocd in msys64 console (pacman -S mingw-w64-x86_64-openocd)
- run set firmware=C:\Users\simon\Downloads\microbit.bin then C:\Users\simon\Downloads\msys64\mingw64\bin\openocd.exe -f C:\Users\simon\Downloads\msys64\mingw64\share\openocd\scripts\interface\stlink.cfg -f C:\Users\simon\Downloads\msys64\mingw64\share\openocd\scripts\target\nrf51.cfg -c init -c "reset halt" -c "nrf51 mass_erase" -c "program %firmware% verify" -c "program %firmware%"
We also added the tutotial to our wiki: https://github.com/seemoo-lab/openhaystack/wiki/Flashing-nRF-with-OpenOCD---ST-Link
Maybe try following the steps closely