Page 2 of 2

Re: STM32L011K4 st-flash problem

Posted: Fri Dec 23, 2016 6:51 pm
by tfAteba
No problem, I understand.

I have some time to spend now , :) so I will try to create one cfg while waiting yours.

Re: STM32L011K4 st-flash problem

Posted: Fri Dec 23, 2016 8:14 pm
by tfAteba
I'm feeling stupid :D , finily I have crate a simple cfg file that allow me to connect to the board with openocd by using the following command in a terminal:
openocd -f st_nucleo_l011k4.cfg

In another terminal, I can run gdb:
arm-none-eabi-gdb
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x00000000 in ?? ()
(gdb) monitor reset halt
Unable to match requested speed 300 kHz, using 240 kHz
Unable to match requested speed 300 kHz, using 240 kHz
adapter speed: 240 kHz
stm32l0.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf0000000 pc: 00000000 msp: 00000000
(gdb) file ch.elf
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from ch.elf...done.
(gdb) load
Loading section .vectors, size 0xc0 lma 0x8000000
Loading section .text, size 0xbd6 lma 0x80000c0
Loading section .rodata, size 0xb0 lma 0x8000c98
Error finishing flash operation


I have add my openocd cfg file for nucleo L011k4

I still have an error when I try to flash the board with openocd.

The same result if I try to use telnet connection trough telnet localhost 4444

Any idea ;)

Re: STM32L011K4 st-flash problem

Posted: Fri Dec 23, 2016 8:19 pm
by tfAteba
Sorry, I forgot to attach the file in the previous message.

Re: STM32L011K4 st-flash problem

Posted: Fri Dec 23, 2016 9:18 pm
by RoccoMarco
Theo,
try this
st_nucleo_l0.zip
(437 Bytes) Downloaded 495 times


Add it in openocd\scripts\board

It sets working area size to 2k (default script set it to 8k exceeding real flash size)

Re: STM32L011K4 st-flash problem

Posted: Fri Dec 23, 2016 9:58 pm
by tfAteba
:)

Yes it was my problem, a have modify my cfg to specify the working area:
source [find interface/stlink-v2-1.cfg]
transport select hla_swd
set WORKAREASIZE 0x0800
source [find target/stm32l0.cfg]
reset_config srst_only


It work now, I can program the board trough the openocd and gdb connections.

I'm going to test with your zip just to make a comparison.

Your method is may be better because you store your file in openocd folder rather than what I'm doing for now. I store the cfg file in my project ;)

Re: STM32L011K4 st-flash problem

Posted: Fri Dec 23, 2016 11:50 pm
by tfAteba
Thanks RoccoMarco,

Now I can program the board with openocd+gdb, I finally added your cfg file to the openocd path.

What about st-flash do you have a way to resolve the problem for this tool? It is a good alternative when I don't want to debug, I can quickly program the board by adding a rules to the make file.

So I will be happy if you also have a solution for st-flash.

Thanks you a lot for your help.

Re: STM32L011K4 st-flash problem

Posted: Sat Dec 24, 2016 11:46 am
by RoccoMarco
Sorry,
never used it.

Re: STM32L011K4 st-flash problem

Posted: Sat Dec 24, 2016 2:34 pm
by tfAteba
Ok, no problem, I now have a way to flash the board :D

Thanks again for your help.