Interrupt Service Routine not reached
7 views (last 30 days)
Show older comments
I have a Interrupt Service Routine (ISR) named ABC whose declaration is interrupt void ABC(void);. I have also added "interrupt=" in the Macro option in Configration. And I also added "ABC" in the Interrupts option in the Multitasking configuration. Inspite of this, this ISR "ABC" is shown as NOT REACHABLE. Am I missing something?
I also face a similar issue while executing tasks from a scheduler. Did the same as above in the Cyclic Tasks option but the tasks are shown as not reachable.
0 Comments
Answers (1)
Sonam Gupta
on 19 Apr 2017
In Polyspace, the source code has to be adapted to allow asynchronous tasks and interruptions to be taken into account. Without such adaptations, interrupt service routines will appear as grey (dead code) in the Viewer. The standard execution model is such that the main is executed initially. Only if the main terminates and returns control (i.e. if it is not an infinite loop and has no red errors) will the entry points be started, with all potential starting sequences being modeled automatically. There are several different approaches which may be adopted to implement the required adaptations.
As an example you can modify your main from:
void main (void)
{
int J = 0;
Init_globals(J);
while (1)
management();
}
to
void main (void)
{
int J = 0;
Init_globals(J);
}
void main_task (void)
{
while (1)
management();
}
So the main() function will terminate. Additionally you need to specify the new entry point like -entry-points "main_task"
0 Comments
See Also
Categories
Find more on Options at Command Line Only in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!