EmbDev.net

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


Author: Paul Agadjanov (mpefareo)
Posted on:

Rate this post
0 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?

Author: Alfredo Cabral (tequilaguru)
Posted on:

Rate this post
0 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.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.