Page 1 of 1

Problem programming NUCLEO-L031K6

Posted: Tue Oct 18, 2016 4:25 pm
by lucapuglia
Hi,
I'm trying to use the project STM32L0xx-ADC in the chibistudio directory on a NUCLEO-L031K6, when i start openOCD using

Code: Select all

openocd\scripts\target\stm32l0.cfg


i get:

Code: Select all

Open On-Chip Debugger 0.10.0-dev-00107-ge4848fe (2015-11-13-11:49)
Licensed under GNU GPL v2
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>'.
adapter speed: 300 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : clock speed 240 kHz
Info : STLINK v2 JTAG v24 API v2 SWIM v12 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.269703
Info : stm32l0.cpu: hardware has 4 breakpoints, 2 watchpoints


everything seems fine, after that i compile the project and the .elf and .hex files are correctly generated, then when i launch the debug the process stops with error and on the openOCD console the following messages appear:

Code: Select all

Info : accepting 'gdb' connection on tcp/3333
Warn : Cannot identify target as a STM32L family.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected


what's the problem going on? Am I using the correct .cfg file?

Re: Problem programming NUCLEO-L031K6

Posted: Tue Oct 18, 2016 4:51 pm
by Giovanni
Hi,

Probably it is OpenOCD included in p17 that is not yet compatible with that device, see if this helps: viewtopic.php?f=13&t=3457

RoccoMarco could give more details.

Giovanni

Re: Problem programming NUCLEO-L031K6

Posted: Tue Oct 18, 2016 5:10 pm
by RoccoMarco
I will perform some test this evening.
Thanks for reporting.

Re: Problem programming NUCLEO-L031K6

Posted: Tue Oct 18, 2016 5:30 pm
by lucapuglia
I tried this version of openOCD you uploaded on playembedded:

http://www.playembedded.org/blog/wp-content/uploads/2016/07/openocd.zip

and it works, now i'm trying to obtain the same result on linux, i just compiled the last version on sourceforce of openOCD:

https://sourceforge.net/projects/openocd/files/openocd/0.9.0/

unfortunately i get the same error:

Code: Select all

> flash write_image erase main.hex
auto erase enabled
Cannot identify target as a STM32L family.
auto_probe failed


where did you get the updated source?

Re: Problem programming NUCLEO-L031K6

Posted: Tue Oct 18, 2016 6:48 pm
by RoccoMarco
Hi,
this is the procedure I am following
Building OpenOCD under Windows using MSYS2

Re: Problem programming NUCLEO-L031K6

Posted: Wed Oct 19, 2016 12:48 pm
by lucapuglia
[SOLUTION]

Apparently both repositories have already implemented the L03K6 support:

https://github.com/gnuarmeclipse/openocd
http://www.playembedded.org/blog/en/2015/10/11/building-openocd-under-windows-using-msys2/

compiling these versions of OpenOCD is the solution to the problem.