Chat freely about anything...

User avatar
By sake402
#58192 So I have a fairly large application running on the RTOS SDK and that needs some serious debugging due to some exceptions.
And I started using GDBStub.
My application starts and run successfully without the call to gdbstub_init, but when calling gdbstub_init in user_init, the application crashes at startup and wont even start.

I therefore made a simple application as the one below and still the same thing happened when gdbstub_init is called in user_init. LED blinks when not called.

The UART log is this

Code: Select allload 0x40100000, len 305216
tail 8
chksum 0x4f
load 0x3ffe8000, len 2132, room 0
tail 4
chksum 0x51
load 0x3ffe8860, len 1760, room 4
tail 12
chksum 0x45
csum 0x45
~r¦¦b¦¦¦b
l¦br|
lb¦¦b|¦
?¦b
¦¦n¦nn¦
¦ln¦
¦¦
l¦¦ll¦¦l¦¦l`¦n¦¦¦¦b
l
l¦rp
¦¦¦b
l
¦b¦lrl¦¦¦room 16

l`¦rn¦¦¦$O466174616c20657863657074696f6e202833293a200a#37$O657063313d307834303235336437340a#20$O657063323d307830303030303030300a#01$O657063333d307830303030303030300a#02$O65706376616464723d307834303130306561300a#be$O646570633d307830303030303030300a#06$O72746e5f6164643d307834303235343630650a#c¦
 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 3room 16
tail 8
chksum 0x4f
load 0x3ffe8000, len 2132, room 0
tail 4
chksum 0x51
load 0x3ffe8860, len 1760, room 4
tail 12
chksum 0x45
csum 0x45
~r¦¦b¦¦¦b
l¦br|
lb¦¦b|¦
?¦b
¦¦n¦nn¦
¦ln¦
¦¦
l¦¦ll¦¦l¦¦l`¦n¦¦¦¦b
l
l¦rp
¦¦¦b
l
¦b¦lrl¦¦¦0, room 16



And the code is this
Code: Select allvoid FOO(){
   static uint8_t v;
   GPIO_OUTPUT_SET(2, (v&1));
   printf(v&1?"ON\r\n":"OFF\r\n");
   v++;
}

void user_init(void){
   static os_timer_t ledTimer;
   uart_div_modify(0, UART_CLK_FREQ / 115200);
   os_timer_disarm(&ledTimer);
   os_timer_setfn(&ledTimer, &FOO, NULL);
   os_timer_arm(&ledTimer, 1000, TRUE);
   gdbstub_init();
}