chnWriteTimeout and debug

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
lesto
Posts: 55
Joined: Thu May 22, 2014 11:27 am

chnWriteTimeout and debug

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chnWriteTimeout and debug

Post 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
lesto
Posts: 55
Joined: Thu May 22, 2014 11:27 am

Re: chnWriteTimeout and debug

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chnWriteTimeout and debug

Post by Giovanni »

The message does not look complete. Step into the function and see where it stops.

Giovanni
lesto
Posts: 55
Joined: Thu May 22, 2014 11:27 am

Re: chnWriteTimeout and debug

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chnWriteTimeout and debug

Post by Giovanni »

See, the answer is right there :)

Panics should never be ignored.

Giovanni
lesto
Posts: 55
Joined: Thu May 22, 2014 11:27 am

Re: chnWriteTimeout and debug

Post 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 :)
Post Reply