Sun Nov 9 21:18:34 EST 2014

gdbstub flash

GDB needs a memory map to handle flashing properly.  However it might
work with ordinary M packets as well.

It attempts to write 192 bytes at a time:


Refman 3.3.3:

- The Flash memory can be programmed 16 bits (half words) at a time.

- The Flash memory erase operation can be performed at page level

Page size is 
- 1kB for medium density devices (< 128kb)
- 2kB for high density

So when making the erase explicit this can be supported using ordinary
memory access.

Anyways.. its probably not too hard to support it:

- qSupported[2]
- qXfer:memory-map:read::offset,length
- vFlashErase:addr,length
- vFlashWrite:addr:XX
- vFlashDone

[1] https://sourceware.org/gdb/onlinedocs/gdb/Memory-Map-Format.html#Memory-Map-Format
[2] https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html#qSupported