Page 1 of 1

chnWriteTimeout and debug

Posted: Mon Jun 02, 2014 4:29 pm
by lesto
hi again,
i'm using chnWriteTimeout with all debug enabled, and problem is when it time-out it goes into kernel-panic as debug error.

I want to ignore this, as i'm using to write over USB-cdc only when it is connected, and someone can connect-disconnect the USB when it like (basically, i'm sending a stream of data as debug, and user can connet and look at that).

Obviusly if user disconnect at the right time, when theprint is going on, that timeout occurs, and subsequential kernel panic. Is tehrea way to tell chibios to consider that timeout as "normal flow" and not debug error?

Re: chnWriteTimeout and debug

Posted: Mon Jun 02, 2014 6:13 pm
by Giovanni
Hi,

A timeout should not result in a panic, there is something else going on there.

What panic message are you getting? (inspect dbg_panic_msg)

Giovanni

Re: chnWriteTimeout and debug

Posted: Mon Jun 02, 2014 7:50 pm
by lesto
msg = 0x8006b84 "\"chOQWriteTimeout\"()"
my call is chnWriteTimeout(&SDU1, data, size, timeout);
where data is "G:", size is 3, timeout is MS2ST(4) ot TIME_IMMEDIATE

chibi 2.6.x from git repo

Re: chnWriteTimeout and debug

Posted: Mon Jun 02, 2014 9:27 pm
by Giovanni
The message does not look complete. Step into the function and see where it stops.

Giovanni

Re: chnWriteTimeout and debug

Posted: Mon Jun 02, 2014 10:04 pm
by lesto
ifcame from "chDbgCheck(n > 0, "chOQWriteTimeout");" ofchqueues.c, seem like it does not like if i try to write an empty buffer :)

about the incomplete message i don't know what to expect, this is what eclipse + gdb + openocd say

Re: chnWriteTimeout and debug

Posted: Mon Jun 02, 2014 10:25 pm
by Giovanni
See, the answer is right there :)

Panics should never be ignored.

Giovanni

Re: chnWriteTimeout and debug

Posted: Tue Jun 03, 2014 9:47 am
by lesto
thank you, you are helping me very much to understand chibios (and MCU).
it was a little strange that a timeout was causing a panic :)