#128090 - kansado - Tue May 08, 2007 3:18 pm
Since debugging with wifi was quite slow, I bought DSerial2 and tried to use it with masscat's GDB stub, expecting to get a lower packet latency.
I've developed a replacement for serial_comms to work with DSerial2 instead of masscat's proposed circuits (mainly because I don't know too much about electronics.)
When the debug test program linked against my serial_comms reaches debugHalt(), Insight and the stub interchange debug packets for a while, after which they get stuck in nonsense dialogues.
This is the cable schematic:
Probably I've misunsderstood something (or perhaps a lot of things) in the RS-232 specification, but this way I was able to send and receive data correctly with the DSerial2's firmware test program.
I've updated masscat's code with the template for ARM7 in devKitPro r20.
This is the debug_serial.c I've made:
I hope I've not forgotten anything.
By the way, I've not noticed a lower packet latency compared to wifi, but I won't trust this result until I achieve a complete debug session. Perhaps the botteneck isn't in the wifi element as I thought.
Are people out there interested in debugging with DSerial2? Anybody knows what I'm doing wrong? Any help would be appreciated.
I've developed a replacement for serial_comms to work with DSerial2 instead of masscat's proposed circuits (mainly because I don't know too much about electronics.)
When the debug test program linked against my serial_comms reaches debugHalt(), Insight and the stub interchange debug packets for a while, after which they get stuck in nonsense dialogues.
This is the cable schematic:
Code: |
PC side (DB-25) DSerial2 side (IO2)
2 TD .______ _______. RS-232 TX \/ 3 RD .______/\_______. RS-232 RX 4 RTS .__ 5 CTS .__| 6 DSR .__|____________. Vdd 8 DCD .__| 20 DTR .__| |
Probably I've misunsderstood something (or perhaps a lot of things) in the RS-232 specification, but this way I was able to send and receive data correctly with the DSerial2's firmware test program.
I've updated masscat's code with the template for ARM7 in devKitPro r20.
This is the debug_serial.c I've made:
Code: |
#include <stdlib.h>
#include <stdint.h> #include "debug_stub.h" #include "dserial.h" #define BUFFER_SIZE 2048 char rxBuffer[BUFFER_SIZE]; int head, byteCount; static void receiveHandler(char * data, unsigned int size) { unsigned int i, pos = head + byteCount; for (i = 0; i < size; i ++) { rxBuffer[pos % BUFFER_SIZE] = data[i]; pos ++; } byteCount += size; } static int init_fn( void *data __attribute__((unused))) { while(!dseInit()); dseBoot(); swiDelay(9999); /* Wait for the FW to boot */ dseSetModes(ENABLE_RS232); dseUartSetBaudrate(9600); head = 0; byteCount = 0; dseUartSetReceiveHandler(receiveHandler); return 1; } static void writeByte_fn( uint8_t byte) { dseUartSendBuffer(&byte, 1, true); } static void writeData_fn( uint8_t *buffer, uint32_t count) { dseUartSendBuffer(buffer, count, true); } static int readByte_fn( uint8_t *read_byte) { if (byteCount > 0) { *read_byte = rxBuffer[head]; head ++; head %= BUFFER_SIZE; byteCount --; return 1; } else { return 0; } } static void poll_fn( void) { } static uint32_t irqs_fn( void) { return IRQ_CARD_LINE; } /** The instance of the comms function interface */ struct comms_fn_iface_debug serialCommsIf_debug = { .init_fn = init_fn, .readByte_fn = readByte_fn, .writeByte_fn = writeByte_fn, .writeData_fn = writeData_fn, .poll_fn = poll_fn, .get_IRQs = irqs_fn }; |
I hope I've not forgotten anything.
By the way, I've not noticed a lower packet latency compared to wifi, but I won't trust this result until I achieve a complete debug session. Perhaps the botteneck isn't in the wifi element as I thought.
Are people out there interested in debugging with DSerial2? Anybody knows what I'm doing wrong? Any help would be appreciated.