Page 1 of 1

OpenOCD confusion

Posted: Fri Nov 03, 2017 11:44 pm
by Kowalski
Hi,
This is my first question here. I am trying to learn OpenOCD. And sorry for asking a dump questions.
My Questions are:
1) OCD = On Chip Debugger => How is it OnCHIP ?? isn't Onchip is something which exists right there on Silicon?
2) Debugger = How is it a debugger. i means its job is just to interpret Interface (jtag, swi, icdi etc) signals and to connect with it? and even if it is a debugger, why then we need GDB with OpenOCD to debug code?
3) Hows is it different from let say JTAG device driver? i mean JTAG driver also enables you to communicate with external connected device chip?

Re: OpenOCD confusion

Posted: Sat Nov 04, 2017 7:07 am
by DanV
1) the capability is either available on your particular chip or it's not.

Many of your questions are answered on this site:
https://hackaday.com/2012/09/27/beginne ... debugging/

Re: OpenOCD confusion

Posted: Sun Nov 05, 2017 1:52 am
by Kowalski
Thanks for your reply. The link indeed presents pretty much good info but still i have the same confusion. Can you please answer in bulleted form one per question. I am still confused why GDB is required, can't we just send commands directly to openOCD?

Re: OpenOCD confusion

Posted: Sun Nov 05, 2017 8:20 am
by DanV
Kowalski wrote:
Fri Nov 03, 2017 11:44 pm
1) OCD = On Chip Debugger => How is it OnCHIP ?? isn't Onchip is something which exists right there on Silicon?
It's the on-chip capability that's on the silicon - On Chip Debugging.
Kowalski wrote:
Fri Nov 03, 2017 11:44 pm
2) Debugger = How is it a debugger. i means its job is just to interpret Interface (jtag, swi, icdi etc) signals and to connect with it? and even if it is a debugger, why then we need GDB with OpenOCD to debug code?
from the link:
In order to do this type of debugging you need three things: a program that controls the chip’s debugging mode (OPENOCD), a way to interface with it (GDB), and a program which has been compiled with debugging information (use -g option to include debugging information).
Kowalski wrote:
Fri Nov 03, 2017 11:44 pm
3) Hows is it different from let say JTAG device driver? i mean JTAG driver also enables you to communicate with external connected device chip?
I don't know - I believe JTAG is a hardware interface.

This whole question is like asking why you need a pre-processor, a compiler, and a linker to build a program. You kind of need this stuff to do a proper job.