Dear all,
I did below steps to connect to the BluFruit Feather board via STLink V2:
1) Install OpenOcd and STLink USB driver as: https://pcbreflux.blogspot.com/2016/09/nrf52832-first-steps-with-st-link-v2.html
+ OpenOcd has been configured as below option:
After that without connecting to the board, I can see below message:
~$ lsusb | grep STM
Bus 003 Device 007: ID 0483:3748 STMicroelectronics ST-LINK/V2
# Checking kernel log by dmesg
[ 2612.490404] usb 3-10: new full-speed USB device number 7 using xhci_hcd
[ 2612.632256] usb 3-10: New USB device found, idVendor=0483, idProduct=3748
[ 2612.632263] usb 3-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2612.632267] usb 3-10: Product: STM32 STLink
[ 2612.632271] usb 3-10: Manufacturer: STMicroelectronics
[ 2612.632275] usb 3-10: SerialNumber: RÿkH\xffffffc2\xffffff83RHF9\xffffffc2\xffffff87
=> That means the STLink is properly detected.
2) Connecting the board --> ST Link V2, based o the nRF52832 schematic, BlueFruit pinout and ST Link V2 pinout and connect as:
SWDIO (pin name: 11/25) --> SWDIO (pin 6)
SWCLK (pin name: SCK/26)--> SWCLK(pin 4)
GND (pin name: G) --> GND (pin 7)
3v (pin name: 3V) --> 3V3 (pin 2)
Ref:
https://www.aliexpress.com/item/Best-Quality-ST-Link-stlink-V2-for-STM8S-STM8L-STM32-Cortex-M0-Cortex-M3-SWIM-JTAG/32676015777.html?spm=2114.search0104.3.1.42197c39KJSD82&ws_ab_test=searchweb0_0,searchweb201602_3_10152_10151_10065_10344_10068_5722815_10342_10343_10340_5722915_10341_5722615_10696_10084_10083_10618_10304_10307_10820_10821_10302_5722715_10843_10059_306_100031_10103_10624_10623_10622_5722515_10621_10620,searchweb201603_50,ppcSwitch_5&algo_expid=9a4fdee5-7ee5-420e-8e14-47c2d26f95ba-0&algo_pvid=9a4fdee5-7ee5-420e-8e14-47c2d26f95ba&transAbTest=ae803_2&priceBeautifyAB=0
https://learn.adafruit.com/adafruit-nrf52-pro-feather/device-pinout
But I can't make the OpenOcd to connect to the board:
$ ./src/openocd -d2 -f openocd_nrf52.cfg -s ../tcl/
Open On-Chip Debugger 0.10.0+dev-00430-g0612315 (2018-06-15-10:18)
Licensed under GNU GPL v2
For bug reports, read
openocd.org/.../bugs.html
debug_level: 2
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v21 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.222134
Error: init mode failed (unable to connect to the target)
in procedure 'init'
in procedure 'ocd_bouncer'
Warn : Flash driver of nrf52.flash does not support free_driver_priv()
Warn : Flash driver of nrf52.uicr does not support free_driver_priv()
My openocd_nrf52.cfg file is:
#nRF52832 Target
source [find interface/stlink-v2.cfg]
transport select hla_swd
source [find target/nrf52.cfg]
Could you please help to correct my steps?
Best Regards,
James, Dinh