Redbear BLE Nano v2 upload failed


I am trying to upload a simple blink sample to a Redbear BLE Nano v2 board from a Windows 10 machine. The upload fails and I get an “OpenOCD init failed” error. Any ideas on how I can fix/workaround this?
I have attached the log below:

λ pio run --target upload
[01/03/18 21:18:36] Processing redbear_blenano2 (platform: nordicnrf52; board: redbear_blenano2; framework: arduino)
------------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option
Collected 2 compatible libraries
Looking for dependencies...
No dependencies
Uploading .pioenvs\redbear_blenano2\firmware.hex
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00114-g8419536 (2017-04-18-21:56)

Licensed under GNU GPL v2
For bug reports, read
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
adapter speed: 10000 kHz
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : reduce speed request: 10000kHz to 5000kHz maximum
Info : clock speed 10000 kHz
in procedure 'program'
in procedure 'init' called at file "embedded:startup.tcl", line 495
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1
============================= [ERROR] Took 2.21 seconds =============================

===================================== [SUMMARY] ===================================== Environment redbear_blenano2    [ERROR]
Environment redBearLabBLENano   [SKIP]
============================= [ERROR] Took 2.23 seconds =============================


I solved it by using nrf51.cfg from the Arduino installation.


Sorry, I have the same problem, i don’t understand how you solved. Can you explain? Thank you very much!


There is support for the Redbear BLE Nano within the Arduino IDE if you download the board support from within Arduino IDE from here :

I installed that and copied nrf51.cfg from that installation onto the platformio installation. I don’t have the exact paths on hand right now. I will post an update later.


A small correction. I copied nrf52.cfg over (not nrf51.cfg)

I copied C:\Users<username>\AppData\Local\Arduino15\packages\RedBear\tools\openocd\0.10.0-dev-nrf5\scripts\target\nrf52.cfg over to C:\Users<username>.platformio\packages\tool-openocd\scripts\target\nrf52.cfg

Hope that helps.


Thank you very much, I have solved the problem.


We updated recently openOCD to the latest version and nrf52.cfg was updated too. Could you try pio update and new version?