Author Topic: openOCD integration with gdb through Codeblocks  (Read 10311 times)

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 96
openOCD integration with gdb through Codeblocks
« on: February 10, 2017, 07:02:47 am »
Hi,

I am working on developing my embedded system toolchain through codeblocks.
Tools I am using:
- Codeblocks (developed after building codeblocks sdk available at SVN)
- wxwidget 2.8.12 (shared=1, monolithic=1, unicode=1, build = relaease and debug)
- Mingw compiler (5.3)
- openOCD

I have build up openOCD.exe from its libraries and source through cygwin.
Now I want to connect gdb debugger to this openOCD for JTAG/SWD Connection through codeblocks. I get to know that I can do it by setting a remote debugger connection setting available in codeblocks. Projects->properties->debugger->Remote debugger support.

I know that I need to put some gdb amd shell commands to communicate with openOCD like target remote localhost 4444 etc.
I want to ask that how can i link it with openocd.exe. I mean I want to know how the communication will setup properly.? Any help or related link will be good to kickstart.

Thanks
Anand A.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: openOCD integration with gdb through Codeblocks
« Reply #1 on: February 10, 2017, 12:52:21 pm »
Hi, i don't use OpenOCD, but i use the segger j-link with j-link gdb. I think there are more or less the same steps to create a successful environment for embedded debugging:

Project settings: Project->Properties->Debugger->Additional GDB commands->After connection:
Quote
monitor reset
load

strangely this was all i had to set...

have you any command line or tutorial to start OpenOCD?
You can use the Tool plugin to start OpenOCD with path to the project for example...

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 96
Re: openOCD integration with gdb through Codeblocks
« Reply #2 on: March 27, 2017, 03:19:01 pm »
Thanks Blue Hazzard,

I go through some online openocd + codeblocks tutorials and succeeded to set up remote connection to openocd.

I have recently started working with it. Whenever I call the commands like "load ./bin/Debug/ledtest.elf", my program gets written into flash. I want to know what are the commands sequence it is calling at backend like flash erase, flash write etc. I f you have any idea, please let me know.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: openOCD integration with gdb through Codeblocks
« Reply #3 on: March 27, 2017, 03:51:38 pm »
look at the makefile of this post:
http://stackoverflow.com/questions/38033130/how-to-use-the-gdb-gnu-debugger-and-openocd-for-microcontroller-debugging-fr

You can make tool entries from the tools+ menu with this commands...
At the moment you can't integrate them in the debugger...
I think since a long time how to integrate this, but i have no clean idea...