EmbDev.net

Forum: ARM programming with GCC/GNU tools Question about GDB remote debuging


von Paul A. (mpefareo)


Rate this post
useful
not useful
Hello,
I'm new to gnu arm toolchain. I'm trying to learn how to debug with gdb.
I have got STM3210E Eval board, Amontec Jtag, OpenOCD.
I start gdb session, connect to the target with: target remote
localhost:2000.
A I can even reset the Eval board with monitor reset.
The question is: If I have got a ready compiler and linker programm say
it is called hello.elf, what is the sequence of the command to upload it
to the remote target RAM(linker script has been set up to keep data and
code in ram) and start debuging.
I have got Insight that come with Anglia IDealist. In Insight Run menu
There are commands "Connect to the target", "Download", "Run",
"Disconnet".  I have tryed to find what do they actually mean in terms
of GDB commands by openin console window but it does not show what it
sends.
The problem is: If I'm trying to use Insight that comes with cygnus for
example menu Run does not have "Connect to target", "Donwload" items. I
can connect to the target with "target remote localhost:2000", but what
command shal I send next to download the program and start debugging it?

von Alfredo C. (tequilaguru)


Rate this post
useful
not useful
Paul Agadjanov wrote:
> Hello,
> I'm new to gnu arm toolchain. I'm trying to learn how to debug with gdb.
> I have got STM3210E Eval board, Amontec Jtag, OpenOCD.
> I start gdb session, connect to the target with: target remote
> localhost:2000.
> A I can even reset the Eval board with monitor reset.
> The question is: If I have got a ready compiler and linker programm say
> it is called hello.elf, what is the sequence of the command to upload it
> to the remote target RAM(linker script has been set up to keep data and
> code in ram) and start debuging.
> I have got Insight that come with Anglia IDealist. In Insight Run menu
> There are commands "Connect to the target", "Download", "Run",
> "Disconnet".  I have tryed to find what do they actually mean in terms
> of GDB commands by openin console window but it does not show what it
> sends.
> The problem is: If I'm trying to use Insight that comes with cygnus for
> example menu Run does not have "Connect to target", "Donwload" items. I
> can connect to the target with "target remote localhost:2000", but what
> command shal I send next to download the program and start debugging it?

The command sequence depends on the version of OpenOCD you are using, if
you are using a fairly recent version, the command sequence should be
something like this:
#halt target
monitor halt
#identify flash type on target 0
monitor flash probe 0
#erase sectors 0 thru 26, target 0
monitor flash erase_sector 0 0 26
#upload lpc2387.elf image, no offset, format:elf.
monitor flash write_image lpc2387.elf 0 elf

this is a command sequence for the lpc2387...

Hope this helps.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.