Nucleo, OpenOCD 0.8, STLink oh my!

Ok folks I’m a bit at a loss here. Basic environment:

Ubuntu 14.04LTS

OpenOCD 0.8.0 built and installed from source (removed the debian openocd package)

Nucleo STM32L03

STM32L0-Discovery (e-paper discovery board)

I’ve flashed the Nucleo to the latest firmware using a windows machine and the STMicro tool.

I’ve used openocd before on my ST discovery boards it was fine, these boards use ‘STLink V2.1’ which changes two things, one is that they support ‘mBed’ (which means they are now composite USB devices exporting a storage device, a CDC (serial port), and their debugging port), the other is that the STLink protocol has been updated to 2.1-1 (sort of a 2.1.1 I guess).

Anyway, my openocd.cfg file has simply this in it:

source [find board/st_nucleo_f030r8.cfg]

My /etc/udev has the appropriate rule set (for the updated VID/PID of these new boards) :

# STlink
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="666", GROUP="plugdev"

When I start OpenOCD it responds thusly:

Open On-Chip Debugger 0.8.0 (2014-11-16-21:54)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.sourceforge.net/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v21 API v2 SWIM v5 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.218935
Error: hl_interface_init_target: target not found: idcode: 0x0bc11477
in procedure 'transport'
in procedure 'init'

It seems like it is trying to use the JTAG api but these chips only offer the SWD api. (one of the conceits for the low power ness of the L0 version according to the FE at a recent seminar)

I’m trying to figure out how to get this thing going, does anyone else have this board combo running?

–Chuck

Well while waiting for this posting to be approved I continued my research and the short answer is, the STM32L0 processors are not supported by 0.8 and are supported (mostly) by 0.9. On the advice of KarlP I pulled and built OpenOCD from the repo and that version could correctly connect to the STLINK V2.1-1 that was on the Nucleo board (and the STM32L0-Discovery board). I built Karl’s miniblink implementation with a patch libopencm3 and sure enough the LED started blinking as expected. Onward to bigger and better things like UARTs :slight_smile: