Hard fault when exiting shell

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

Moderator: RoccoMarco

Post Reply
trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

Hard fault when exiting shell

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

Re: Hard fault when exiting shell

Post by Giovanni »

Hi,

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

Giovanni
trepidacious
Posts: 58
Joined: Mon Jan 21, 2013 3:36 pm
Been thanked: 1 time

Re: Hard fault when exiting shell

Post by trepidacious »

Hi,

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

Ben
Post Reply