Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT + OpenOCD + GDB = not working (Working on ARM Stm32 Processor with ST-Link V2 but the debugger is not working correctly)
CDT + OpenOCD + GDB = not working [message #1743753] Mon, 19 September 2016 12:59 Go to next message
Foo Bar is currently offline Foo BarFriend
Messages: 6
Registered: September 2016
Junior Member
Hi everyone,
sorry if this is offtopic at this place, didnt find anywhere else to post this.

My System:
-Windows 7
-Eclipse Neon Release (4.6.0) CDT + the OpenOCD plugin
- OpenOCD 0.10.0-dev-00287-g85cec24-dirty (2016-01-10-10:13)
The hardware is a ST-Link V2 for STM32 micros.

I created a new project and setup the debug config according to tutorials. Now it is basically working, but I can not see any source code, just disassemby. I added all the config to the debugconfiguration (stlink-v2.cfg and stm32f1x.cfg). It shows me an error "No source available for "0x0" ". Googling this gave me a few solutions from which none worked.
One thing that may be a point is that I am not actually using the ELF file, which is not generated. Instead I use the OUT file. Could that have anything to do with it or is the OUT file identical to a generated ELF file?

Am thankfull for any tips.

Regards
Re: CDT + OpenOCD + GDB = not working [message #1743756 is a reply to message #1743753] Mon, 19 September 2016 13:07 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Did you build your binary with debug symbols (using -g)?

Marc
Re: CDT + OpenOCD + GDB = not working [message #1743757 is a reply to message #1743756] Mon, 19 September 2016 13:10 Go to previous messageGo to next message
Foo Bar is currently offline Foo BarFriend
Messages: 6
Registered: September 2016
Junior Member
Thanks for the reply.
Yes, I added the -O0 and -g. Here is a part of the makefile:

# Flags
#CFLAGS = -I./ -c -Wall -fno-common -mcpu=cortex-m3 -mthumb -DTRACE_LEVEL=$(TRACE_LEVEL) -g -O0
CFLAGS = -I./ -c -Wall -fno-common -mcpu=cortex-m3 -mthumb -DDEBUG_BUILD -g -O0
AFLAGS = -mcpu=cortex-m3 -mthumb -g -mapcs-32
PFLAGS = -E -P -x assembler-with-cpp -D ASM_CODE -D $(TARGET)
LFLAGS = -v -T$(LINKER_SKRIPT) -S -nostartfiles
CPFLAGS = -Obinary --gap-fill=0xff
ODFLAGS = -S
Re: CDT + OpenOCD + GDB = not working [message #1743758 is a reply to message #1743757] Mon, 19 September 2016 13:16 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
So you need to have the binary on the target to run it, obviously. That one need not have -g.
But you also need to have the binary on the host where eclipse and gdb are running, so they can read
the symbols. That one needs -g.

Do you properly specify the binary on the host in your launch?
Re: CDT + OpenOCD + GDB = not working [message #1743760 is a reply to message #1743758] Mon, 19 September 2016 13:27 Go to previous messageGo to next message
Foo Bar is currently offline Foo BarFriend
Messages: 6
Registered: September 2016
Junior Member
Not quite sure.
How do I specify the host to not have the -g but the target to have?

My debug Configuration looks like this:
In the Main Tab I entered the OUT file under C/C++ Application.
In the Debugger Tab I entered the openocd.exe path and -f interface\stlink-v2.cfg and -f target\stm32f1x.cfg in config options
In the Startup Tab I checked the "use project binary" for Load Symbols and Load executable, both show the OUT file path
In the Source Tab I got two entries with the Projectpath, one Folder Icon is yellow, the other blue
In the Common Tab I didnt do anything
Re: CDT + OpenOCD + GDB = not working [message #1743765 is a reply to message #1743760] Mon, 19 September 2016 13:56 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
Sorry for being unclear. You can use -g on both host and target. I just wanted to point out if you need to save
space on the target, you can actually have a binary compile without -g.

But for now, let's use -g on both target and host.

I'm not familiar with the details of this particular launch. You will need to troubleshoot on your side.
What you can do is google for eclipse source lookup and see if you get some pointers.
You can also look at any errors in the 'gdb traces':
https://wiki.eclipse.org/CDT/User/FAQ#I.27ve_been_asked_for_.27gdb_traces.27.2C_where_can_I_find_them.3F

Sorry that I can't help more myself.

Marc
Re: CDT + OpenOCD + GDB = not working [message #1743823 is a reply to message #1743765] Tue, 20 September 2016 05:57 Go to previous messageGo to next message
Foo Bar is currently offline Foo BarFriend
Messages: 6
Registered: September 2016
Junior Member
Ok, thank you for the help!
Re: CDT + OpenOCD + GDB = not working [message #1749829 is a reply to message #1743823] Mon, 12 December 2016 23:01 Go to previous messageGo to next message
Colin daly is currently offline Colin dalyFriend
Messages: 7
Registered: December 2016
Junior Member
Hi there,

Having a difficult time getting the openOCD debugger to launch in a new setup. I am setting up openOCD and Eclipse on a new operating system, using a Nucleo F030R8 board that debugs fine on another system. When I launch the debugger in Eclipse I get the "error in final launch sequence":

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No such file or directory.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No such file or directory.
localhost:3333: No such file or directory.


For what it's worth, I can run the debugger in terminal with ./openocd -f board/st_nucleo_f0.cfg and get:

GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.9.0-00073-gdd34716 (2015-05-19-12:55)
Licensed under GNU GPL v2
For bug reports, read
openocd. org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
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 v25 API v2 SWIM v13 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.257369
Info : stm32f0x.cpu: hardware has 4 breakpoints, 2 watchpoints''


and the LED LD1 blinks alternatively green and red. Similarly, I can run External Tools in Eclipse just fine, but this doesn't open the debugger. So it seems like I'm close, but something isn't quite right. Let me know if you need any other details of my system.

Using:
Eclipse Mars.2 (4.5.2)
Mac 10.12.1
OpenOCD 0.10.0-201601101000-dev
GNU Tools gcc-arm-none-eabi-5_4-2016q3
Re: CDT + OpenOCD + GDB = not working [message #1749918 is a reply to message #1749829] Tue, 13 December 2016 19:49 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
The message tells that GDB is not happy as it does not find a running copy of OpenOCD on the target. Start openOCD on the target and try again.


--

Tauno Voipio
Re: CDT + OpenOCD + GDB = not working [message #1749923 is a reply to message #1749918] Tue, 13 December 2016 21:50 Go to previous messageGo to next message
Colin daly is currently offline Colin dalyFriend
Messages: 7
Registered: December 2016
Junior Member
[edit: mistaken double post]

[Updated on: Tue, 13 December 2016 21:51]

Report message to a moderator

Re: CDT + OpenOCD + GDB = not working [message #1749924 is a reply to message #1749918] Tue, 13 December 2016 21:50 Go to previous messageGo to next message
Colin daly is currently offline Colin dalyFriend
Messages: 7
Registered: December 2016
Junior Member
Sorry, not sure if I totally understand you. To take a guess at what you meant, I launched openOCD in terminal then tried to run debug mode in Eclipse. This was the error:

OpenOCD failed with code (-1).
For more details, see the openocd console.


GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-dev-00287-g85cec24 (2016-01-10-12:03)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Started by GNU ARM Eclipse
Error: couldn't bind to socket: Address already in use


Did you mean something else?

(sorry about the separate thread, i'm new here and my post didn't show up for some time so I wasn't sure that it worked)
Re: CDT + OpenOCD + GDB = not working [message #1749952 is a reply to message #1749924] Wed, 14 December 2016 10:22 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Without knowing the details of your setup, it starts to be difficult to pinpoint the failure.

The last report seems to show an attempt to start another OpenOCD from Eclipse after the separate one is running.

The complaints about localhost:3333 report that the GDB in started from Eclipse attempted to reach OpenOCD running on local host and with standard setup, where the TCP port 3333 listens for GDB commands.


--

Tauno Voipio
Re: CDT + OpenOCD + GDB = not working [message #1749983 is a reply to message #1749952] Wed, 14 December 2016 18:05 Go to previous message
Colin daly is currently offline Colin dalyFriend
Messages: 7
Registered: December 2016
Junior Member
do any of these help?

https://www.element14.com/community/servlet/JiveServlet/downloadImage/2-210974-352919/975-722/Screen+Shot+2016-12-12+at+10.34.31+AM.png

https://www.element14.com/community/servlet/JiveServlet/downloadImage/2-210974-352921/Screen+Shot+2016-12-12+at+10.36.22+AM.png

https://www.element14.com/community/servlet/JiveServlet/downloadImage/2-210976-352922/Screen+Shot+2016-12-12+at+11.00.27+AM.png

https://www.element14.com/community/servlet/JiveServlet/downloadImage/2-210976-352923/941-396/Screen+Shot+2016-12-12+at+10.59.24+AM.png

Is there anything I can show? I'm pretty desperate to get this to work...
Previous Topic:CDT and Oracle Pro*C Issue
Next Topic:Duplicate project renamed - why and where ?
Goto Forum:
  


Current Time: Sat Apr 20 01:55:14 GMT 2024

Powered by FUDForum. Page generated in 0.09869 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top