Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Peter Barada <peter@the-baradas.com>
To: sjohnson@sakuraindustries.com
Cc: gdb@sourceware.org
Subject: Re: GDB support for Flash memory programming
Date: Thu, 25 May 2006 01:11:00 -0000	[thread overview]
Message-ID: <20060525003858.024D298B97@baradas.org> (raw)
In-Reply-To: <4474F8D3.3000708@sakuraindustries.com> (message from Steven 	Johnson on Thu, 25 May 2006 11:22:43 +1100)


>>If the flash memory controller has a JTAG interface (most do) then the
>>flash memory can typically be programmed using the same ICE/BDM unit
>>that is used for debugging.
>>  
>>
>Yes, but my experience is this is horribly slow,  due to the polling
>that has to occur of each byte (or programming word for 16bit and 32bit
>wide flashes) as it is programmed.  I think directly programming over
>JTAG/BDM should be avoided, unless there is no alternative.  Even on
>systems where ram is limited, flash could be programmed in chunks, eg:

Another possibility is to have GDB could download/execute a small PIC
function that does the flash programming with its inherent polling
which should speed things up *immensely*.  Also this function can be
tailored to the specifics of the layout (or use global variables for
it). I think the necessary "programming stub" would be small enough to
download, and it would leverage the code that GDB uses to call a
procedure on the target, captures the return, aka:

(gdb) p burn_to_flash(flash_addr, buf_addr, sector_size)

Of course presented to the user to appear as a command as in:

(gdb) burn-flash <src> <sector_size>

where the buf_addr could be on the stack, and capture the result from
the download/call as a command result, that can then generate an error
as in "flash block locked".

This result is extremely extensible to do far more flexible things
that require target manipulation at speeds *far* faster than the
remote protocol can do.

It also allows for manipulating a target that uses a stub that doesn't
even have a JTAG/BDM interface...

-- 
Peter Barada
peter@the-baradas.com


  reply	other threads:[~2006-05-25  0:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24  1:44 Jim Blandy
2006-05-24  2:03 ` Steven Johnson
2006-05-24 22:07   ` Jim Blandy
2006-05-25  2:35     ` Steven Johnson
2006-05-24  4:43 ` Nathan J. Williams
2006-05-24 22:17   ` Jim Blandy
2006-05-24  8:03 ` Russell Shaw
2006-05-25  0:22   ` Jim Blandy
2006-05-25  3:05     ` Russell Shaw
2006-05-25  0:39   ` GDB and remote protocols Daniel Jacobowitz
2006-05-25  3:04     ` Russell Shaw
2006-05-25  0:52 ` GDB support for Flash memory programming Steven Johnson
2006-05-25  1:11   ` Peter Barada [this message]
2006-05-25  2:18   ` Jim Blandy
2006-05-25  3:29     ` Steven Johnson
2006-05-26 18:42       ` Jim Blandy
2006-05-27  0:02         ` Steven Johnson
2006-06-17 20:07 ` Mark Kettenis
2006-06-18  9:55   ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060525003858.024D298B97@baradas.org \
    --to=peter@the-baradas.com \
    --cc=gdb@sourceware.org \
    --cc=sjohnson@sakuraindustries.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox