Page 1 of 1

Hard fault when exiting shell

Posted: Thu May 30, 2013 5:30 pm
by trepidacious
I just added a fairly standard shell to my application, based on the STM32F4 Discovery MEMS example, unfortunately when I "exit" the shell it causes a hardfault when calling:

Code: Select all

  chEvtBroadcastI(&shell_terminated);


The PC for the hardfault is in chevents.c, chEvtSignalI(), in the first condition of the "if" (or possibly the previous line - I'm still getting used to interpreting hard faults!).

As far as I know I'm not listening for the event, I just used the same shell handling that polls for the shell being terminated, then respawns.

Any ideas what might be going wrong?

Re: Hard fault when exiting shell

Posted: Thu May 30, 2013 5:42 pm
by Giovanni
Hi,

Do you call shellInit() before using the shell? the only thing it does is to initialize that even source.

Giovanni

Re: Hard fault when exiting shell

Posted: Fri May 31, 2013 10:46 am
by trepidacious
Hi,

Thanks, that fixed it! Sorry, I really should have read the demo code more thoroughly ;)

Ben