// const char gdb_QStartNoAckMode[] GDBMEM = "QStartNoAckMode+";
// const char gdb_QXferExecFileRead[] GDBMEM = "qXfer:exec-file:read+";
- const char gdb_mem[] GDBMEM = "$l<memory-map><memory type=\"flash\" start=\"0\" length=\"0x10000\"><property name=\"blocksize\">0x100</property></memory><memory type=\"flash\" start=\"0x810000\" length=\"0x800\"><property name=\"blocksize\">0x01</property></memory></memory-map>#";
+ //const char gdb_mem[] GDBMEM = "$l<memory-map><memory type=\"flash\" start=\"0\" length=\"0x10000\"><property name=\"blocksize\">0x100</property></memory><memory type=\"ram\" start=\"0x800000\" length=\"0x1100\"/>'<memory type=\"flash\" start=\"0x810000\" length=\"0x800\"><property name=\"blocksize\">0x01</property></memory></memory-map>#";
+ const char gdb_mem[] GDBMEM = "$l<memory-map><memory type=\"flash\" start=\"0\" length=\"0x10000\"><property name=\"blocksize\">0x100</property></memory><memory type=\"ram\" start=\"0x800000\" length=\"0x1100\"/>'<memory type=\"ram\" start=\"0x810000\" length=\"0x800\"/></memory-map>#";
// struct Gdb gdb;
// struct Buffer buf;
"std Y+36, r27 \n"
"ldd r25, Z+7 \n" // restore original r25
- "ldd r27, Z+10 \n" // original (PCH/2) -> r27 (XH)
+ "ldd r27, Z+10 \n" // original (PCH/2) -> r27 (XH)
"ldd r26, Z+11 \n" // original (PCL/2) -> r26 (XL)
"adiw r30, 11 \n" // restore SP in stop() (4x push + 3x call)
"std Y+32, r30 \n" // save SPL
pgdb->status.isAppStarted = 0;
}
- } else if (pgdb->ctrl.notify && pgdb->buffer.state != idle) {
+ } else if (pgdb->ctrl.notify && pgdb->buffer.state == idle) {
pgdb->ctrl.notify = 0;
pgdb->timer = 20;
xputsmem(gdb_StatusStop);
}
} else {
- bootloader::putnc(0, c, 1);
- bootloader::putnc(0, ' ', 1); bootloader::putUint8Hex(0, i);
- bootloader::putnc(0, ' ',2); bootloader::putUint8Hex(0, sum);
- bootloader::putln(0);
+ // bootloader::putnc(0, c, 1);
+ // bootloader::putnc(0, ' ', 1); bootloader::putUint8Hex(0, i);
+ // bootloader::putnc(0, ' ',2); bootloader::putUint8Hex(0, sum);
+ // bootloader::putln(0);
}
}
#define GDB_PTR (gdb::Gdb *)(RAMEND - sizeof(gdb::Gdb) + 1)
-//#define GDB_BREAKPOINT_PTR (struct gdb::Breakpoint *)(RAMEND - 2 - sizeof(gdb::Control) - sizeof(gdb::Status) - sizeof(gdb::Breakpoint) + 1)
+// #define GDB_BREAKPOINT_PTR (struct gdb::Breakpoint *)(RAMEND - 2 - sizeof(gdb::Control) - sizeof(gdb::Status) - sizeof(gdb::Breakpoint))
#define GDB_BREAKPOINT_PTR (struct gdb::Breakpoint *)(RAMEND - 4 - sizeof(gdb::Breakpoint))
+// #define GDB_BREAKPOINT_PTR (struct gdb::Breakpoint *)(RAMEND - 6 - sizeof(gdb::Breakpoint))
namespace gdb {
enum BufferState { idle = 0, data, esc, chk1, chk2, chk2err, exec, execerr, send, waitack };
- struct Status { // (gdb) print *((struct gdb::Status *)0x8010fb)
- uint8_t errorFlags; // @0x18fb
- uint8_t isConnected:1; // @0x18fc.0x01, address used in bootloader::jmpTableGdbStopApplication()
- uint8_t isAppStarted:1; // @0x18fc.0x02
- uint8_t isStopped:1; // @0x18fc.0x04
- uint8_t isBreakpointValid:1; // @0x18fc.0x08
- uint8_t isSendingNotification:1; // @0x18fc.0x10
+ struct Status { // (gdb) print *((struct gdb::Status *)0x8010f9)
+ uint8_t errorFlags; // @0x10f9
+ // int16_t flashPage; // @0x10fa
+ uint8_t isConnected:1; // @0x10fc.0x01, address used in bootloader::jmpTableGdbStopApplication()
+ uint8_t isAppStarted:1; // @0x10fc.0x02
+ uint8_t isStopped:1; // @0x10fc.0x04
+ uint8_t isBreakpointValid:1; // @0x10fc.0x08
+ uint8_t isSendingNotification:1; // @0x10fc.0x10
};
struct Control { // (gdb) print *((struct gdb::Control *)0x8010fd)
- uint8_t clearErrors:1; // @0x18fd.0x01
- uint8_t interrupt:1; // @0x18fd.0x02
- uint8_t stop:1; // @0x18fd.0x04
- uint8_t proceed:1; // @0x18fd.0x08
- uint8_t kill:1; // @0x18fd.0x10
- uint8_t start:1; // @0x18fd.0x20
- uint8_t reset:1; // @0x18fd.0x40
- uint8_t notify:1; // @0x18fd.0x80
+ uint8_t clearErrors:1; // @0x10fd.0x01
+ uint8_t interrupt:1; // @0x10fd.0x02
+ uint8_t stop:1; // @0x10fd.0x04
+ uint8_t proceed:1; // @0x10fd.0x08
+ uint8_t kill:1; // @0x10fd.0x10
+ uint8_t start:1; // @0x10fd.0x20
+ uint8_t reset:1; // @0x10fd.0x40
+ uint8_t notify:1; // @0x10fd.0x80
};
struct Buffer {