cancel
Showing results for 
Search instead for 
Did you mean: 

Application Configuration - Preemptable ISR option

Patriks
Senior
Posted on June 08, 2015 at 16:09

Hello,

Some time ago I had an issue when activating the ''Preemptable ISR'' option in application configuration for SPC56EL. I posted it in the SPC56 forum. Now my software for SPC560P shows also a strange behavior when I activate that option.

I created a very simple software. Just the while loop in main.c which increments a variable and one interrupt triggered by an external PWM signal. When the ''Preemtable ISR'' option is deactivated everything works as expected. But if I activate the option, the software stops after a random time (around 10 seconds). The debugger shows me, that the software halts at the address 0x000000E0. I think that there is again a problem with this ''Preemtable ISR'' option in application configuration.

Best regards,

Patrik
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
3 REPLIES 3
Erwan YVIN
ST Employee
Posted on June 10, 2015 at 16:02

Hello Patrik ,

Could you send me your application or a code example ? You will submit a ticket for this. it seems to be a Watchdog Have you got the Giovanni's patch in ivor.s :

#if !defined(FALSE) || defined(__DOXYGEN__)
#define FALSE 0
#endif
#if !defined(TRUE) || defined(__DOXYGEN__)
#define TRUE 1
#endif

This patch is present in SPC5Studio 3.5 Best regards Erwan
Patriks
Senior
Posted on June 11, 2015 at 12:24

Hello Erwan,

I didn´t know that there is a patch available for that issue. My ivor.s doesn't include this code. I haven´t installed the new version of SPC5 Studio yet.

If you give me your eMail address, I can sent you my application.

Best regards,

Patrik

Posted on June 11, 2015 at 16:23

Enabling preemption means that the stack must be large enough to accommodate the WORST case of:

SS(1)+...+SS(N-1)+SA

Where:

SS1: Largest stack used by all ISRs at priority 1.

SS(N-1): Largest stack used by all ISRs at priority N-1.

SA: Largest stack used by the application.

It is possible you are experiencing an overflow. you can increase the total stack size from the platform component settings.

Another possible cause of problems is calling an I-class function, those whose name ends with an upper case ''i'', from an ISR without enclosing it between osalSysLockFromISR() and osalSysUnlockFromISR(). Without this I-functions can be preempted and that must not happen.

Giovanni