printf("available commands:\n");
printf(" h (help)\n");
printf(" b (break), n (stepi), c (continue), s (stack), r (reset), p (power), q (quit)\n");
- if (params.board == BoardNano644) {
+ if (params.board == BoardNano644 || params.board == BoardNano1284) {
printf(" 1 (SW2 not pressed), 2 (SW2 pressed)\n");
} else if (params.board == BoardSure) {
printf(" 1 (SW1 not pressed), 2 (SW1 pressed), 3 (SW2 not pressed), 4 (SW2 pressed)\n");
case '1': {
switch (params.board) {
case BoardSure: return CommandSW1Released;
- case BoardNano644: return CommandSW2Released;
+ case BoardNano644: case BoardNano1284: return CommandSW2Released;
default: break;
}
}
case '2': {
switch (params.board) {
case BoardSure: return CommandSW1Pressed;
- case BoardNano644: return CommandSW2Pressed;
+ case BoardNano644: case BoardNano1284: return CommandSW2Pressed;
default: break;
}
}
params.avcc = 3300;
params.aref = 1100;
+ } else if (strcmp("nano-1284", argv[i]) == 0) {
+ params.board = BoardNano1284;
+ params.mmcu = "atmega1284p";
+ params.frequency = 12000000;
+ params.vcc = 3300;
+ params.avcc = 3300;
+ params.aref = 1100;
+
} else if (strcmp("sure", argv[i]) == 0) {
params.board = BoardSure;
params.mmcu = "atmega16";
std::vector<uint8_t> gdbFromUartBuffer;
std::vector<uint8_t> gdbToUartBuffer;
+unsigned long gdbUartOutByteCount = 0;
+unsigned long gdbUartInByteCount = 0;
__attribute__((unused)) static void fromGdbUart (uint8_t b) {
- printf("\n\rgdb-uart OUT -> %02X", b);
+ printf("\n\r(%lu) gdb-uart OUT -> %02X", gdbUartOutByteCount++, b);
if (b > 32 && b < 127) {
printf(" %c\n", b);
} else {
gdbFromUartBuffer.push_back(b);
if (cnt <= -3 || (cnt == 0 && b == '+')) {
- printf("\n\rgdb-uart OUT -> ");
+ printf("\n\r(%lu) gdb-uart OUT -> ", gdbUartOutByteCount);
for (uint8_t c : gdbFromUartBuffer) {
putchar(c);
}
}
__attribute__((unused)) static void toGdbUart (uint8_t b) {
- printf("\n\rgdb-uart IN <-- %02X", b);
+ printf("\n\r(%lu) gdb-uart IN <-- %02X", gdbUartInByteCount++, b);
if (b > 32 && b < 127) {
printf(" %c\n", b);
} else {
gdbToUartBuffer.push_back(b);
if (cnt <= -3 || (cnt == 0 && b == '+')) {
- printf("\n\rgdb-uart IN <-- ");
+ printf("\n\r(%lu) gdb-uart IN <-- ", gdbUartInByteCount);
for (uint8_t c : gdbToUartBuffer) {
putchar(c);
}
}
break;
}
- case BoardNano644: {
+ case BoardNano644: case BoardNano1284: {
static int8_t led[3] = { -1, -1, -1 }; // pin floating
static int8_t sw2 = -1;
static uint8_t mask[3] = { 0x04, 0x08, 0x10 }; // Bitmask for LED Red, Yellow, Green
}
case CommandSW2Pressed: {
- if (startParameters->board == BoardNano644) {
+ if (startParameters->board == BoardNano644 || startParameters->board == BoardNano1284) {
uint8_t ddrc = avr->data[0x27]; // Atmega644P
uint8_t portc = avr->data[0x28]; // Atmega644P
if ( (ddrc & 0x20) == 0 && (portc & 0x20) == 0x20) { // internal pullup needed
BoardUnknown = 0,
BoardNano,
BoardNano644,
+ BoardNano1284,
BoardSure,
BoardEWS1
} EnumStartParameterBoard;
private:
elf_firmware_t *firmware = NULL;
- avr_t *avr = NULL;;
+ avr_t *avr = NULL;
StartParameters *startParameters = NULL;;
pthread_mutex_t lock;
std::list<struct SimAvrEvent *> events;