hi,
I have a doubt regarding unhandled exception.My code works perfectly for around 13 hours.After that unhandled exception is triggered.As a fix for this I disable the unhandled exception.If exception comes code goes to nvicEnableVector() function in nvic.c and all my code gets freezed.How can i bring back the code to work.?
Disabling Unhandled exception
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Disabling Unhandled exception
Hi,
I recommend running you application with debug options enabled and see if something is caught by the assertions or the state checker.
Giovanni
I recommend running you application with debug options enabled and see if something is caught by the assertions or the state checker.
Giovanni
Re: Disabling Unhandled exception
hi,
Thanks for your reply.I enabled all debug options and I'm getting SV#4, misplaced chSysLock().I didnt find an answer why this error is happening because im using only chThdYield() function call in four threads.Im not using chSysLock() anywhere in my application.
Thanks for your reply.I enabled all debug options and I'm getting SV#4, misplaced chSysLock().I didnt find an answer why this error is happening because im using only chThdYield() function call in four threads.Im not using chSysLock() anywhere in my application.
Re: Disabling Unhandled exception
int main()
{
static WORKING_AREA(Task1, 2624);
Thread_Id = chThdCreateStatic(Task1, sizeof(Task1), NORMALPRIO, Thread, NULL);
while(1);
}
msg_t Thread(void *arg)
{
while (TRUE) {
chThdYield();
}
}
This piece of code is giving error as misplaced I-class function.
What could be the reason?
{
static WORKING_AREA(Task1, 2624);
Thread_Id = chThdCreateStatic(Task1, sizeof(Task1), NORMALPRIO, Thread, NULL);
while(1);
}
msg_t Thread(void *arg)
{
while (TRUE) {
chThdYield();
}
}
This piece of code is giving error as misplaced I-class function.
What could be the reason?
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Disabling Unhandled exception
Hi,
That code should not cause this, do you have also ISRs or callbacks in the application?
Giovanni
That code should not cause this, do you have also ISRs or callbacks in the application?
Giovanni
Re: Disabling Unhandled exception
int main(void) {
Initialize_OS(); //Initialze ChibiOS related functions
Initialize_Threads(); //Initializing thread
while (1) {
}
}
void Initialize_Threads(void) {
static WORKING_AREA(Task1, 2624);
Thread_Id = chThdCreateStatic(Task1, sizeof(Task1), NORMALPRIO, Thread, NULL);
}
msg_t AP_GCS_Thread(void *arg)
{
while (TRUE) {
chThdYield();
}
}
rest everything is commented in my code
Initialize_OS(); //Initialze ChibiOS related functions
Initialize_Threads(); //Initializing thread
while (1) {
}
}
void Initialize_Threads(void) {
static WORKING_AREA(Task1, 2624);
Thread_Id = chThdCreateStatic(Task1, sizeof(Task1), NORMALPRIO, Thread, NULL);
}
msg_t AP_GCS_Thread(void *arg)
{
while (TRUE) {
chThdYield();
}
}
rest everything is commented in my code
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Disabling Unhandled exception
Which function is giving you the #SV4? you should be able to tell from the stack trace after it stops.
Giovanni
Giovanni
Re: Disabling Unhandled exception
Actually Im getting SV#10 not SV#4
Is there any document explaining how to trace stack?
Is there any document explaining how to trace stack?
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Disabling Unhandled exception
nikhilvr wrote:Actually Im getting SV#10 not SV#4
Is there any document explaining how to trace stack?
It is a feature of the debugger not of the OS, which debugger are you using? you should have a stack trace window or something similar.
That #SV10 means "I-class function outside a critical zone", strange because your code does not contain any, this is why I asked if there are ISRs or callbacks.
Giovanni