stm32f4 st-link +openocd

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

pacoblackxx
Posts: 10
Joined: Sat Mar 10, 2012 6:49 pm

stm32f4 st-link +openocd

Post by pacoblackxx »

Hi giovanni,


Can you give more info about your saying "In order to start a debugging session first make sure that OpenOCD is running" in the eclipse tutorial?

how can i startup the openocd under windows? what commands should i issue in cygwin?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32f4 st-link +openocd

Post by Giovanni »

just "openocd.exe", there must be an "openocd.cfg" in the same directory with your initialization script, for the STM32 I use:

Code: Select all

#daemon configuration
telnet_port 4444
gdb_port 3333

set WORKAREASIZE 0x5000

source [find interface/olimex-arm-usb-ocd.cfg]
source [find target/stm32f1x.cfg]


It can change depending the target and the used JTAG dongle.

Note that guides are not a replacement for documentation, OpenOCD is very complex.

Giovanni
pacoblackxx
Posts: 10
Joined: Sat Mar 10, 2012 6:49 pm

Re: stm32f4 st-link +openocd

Post by pacoblackxx »

i am working withe the stm32f4 discovery and st-link, so the olimex in the .cfg is not correct i guess.

could you give me the right one please?

it gives an error:" unable to open ftdi device:device not found
in procedure init"

thanx
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32f4 st-link +openocd

Post by Giovanni »

I never used the ST-Link with OpenOCD.

Giovanni
pacoblackxx
Posts: 10
Joined: Sat Mar 10, 2012 6:49 pm

Re: stm32f4 st-link +openocd

Post by pacoblackxx »

I followed the "Using ST-Link into an Eclipse environment" and after starting in crt0.c the "_unhandled_exception"
is called..

any idea about the error?
Last edited by pacoblackxx on Wed Apr 25, 2012 7:41 am, edited 1 time in total.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32f4 st-link +openocd

Post by Giovanni »

Probably you didn't read the article, it does not use OpenOCD but another GDB server.

Giovanni
pacoblackxx
Posts: 10
Joined: Sat Mar 10, 2012 6:49 pm

Re: stm32f4 st-link +openocd

Post by pacoblackxx »

yeah i noticed and changed the post!

after starting in crt0.c the "_unhandled_exception" is called.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32f4 st-link +openocd

Post by Giovanni »

If you are going to follow that article then there is no need for OpenOCD :-)

Now OpenOCD supports ST-Link but not yet in the officially released versions, I haven't tried it yet, probably I will give it a try when version 0.6.0 will be released, at that point there will be no more need to the Atollic GCB server.

Giovanni
pacoblackxx
Posts: 10
Joined: Sat Mar 10, 2012 6:49 pm

Re: stm32f4 st-link +openocd

Post by pacoblackxx »

yes giovani i understand that i must not work with openocd.

i am using the gbd server, program goes to psp = SYMVAL(__process_stack_end__);

then i press step, and it goes to void _unhandled_exception(void)..

am i missing something?

in debug conmfigurations, the startup tab has not any "start command" textbox
in order to jump call resetHandler()
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: stm32f4 st-link +openocd

Post by Giovanni »

Probably you created the wrong debug configuration.

Giovanni
Post Reply