handler of something like general kernel fault

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

handler of something like general kernel fault

Post by alex31 »

Hello.

Sometime something goes wrong, and program stop. Before launching gdb server is it possible to know
what goes wrong via serial console ?, is it possible to do thing like

* register something like a panic handler which is called, with an api to know what has caused the problem

or

* associate a BaseSequentialStream object to a debug function, and leave chibios print a diagnostic before hanging.

Thanks
Alexandre
Brrzzt
Posts: 5
Joined: Wed Apr 25, 2012 11:54 am

Re: handler of something like general kernel fault

Post by Brrzzt »

Search the code for chDbgPanic() -- and don't forget to enable the corresponding debug flags.

BR,

Gerhard
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: handler of something like general kernel fault

Post by Giovanni »

Correct, the OS always hangs in the panic handler and then the stack trace allows to understand where in halted. The global variable dbg_panic_msg will point to the error message.

If you install the ChibiOS debug plugin the message is automatically fetched and shown to you.

Giovanni
Post Reply