How to remove warning

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 I have warnings saying "Multiple  call Start/Main Interupt/ISR" what is this warning saying and how to remove this.

   

I have this function called 'Start" which I am using in main as well as one of the interrupt routine. What has to be done to remove this warning

0 Likes
8 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You have at least to declare that function as reentrant. Also take care that you are not accessing any global vars within that routine, if you do, you must disable interrupts during that acce4ss.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

These might help -

   

     www.cypress.com/?docID=38741

   

http://www.cypress.com/?id=4&rID=38637

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 I did make the function as reentrant but this function calls some other function inturn ....should I make that aswell Reentrant???

   

And what happens if I were to use global variables because the functions I call are setting some status/flag kind bit....so if I am not supposed to use these variables how can i proceed

0 Likes
Anonymous
Not applicable

this might help you in handling interrupt in PSoC

   

http://www.cypress.com/?rID=38267

0 Likes
Anonymous
Not applicable

 I missed the main part of the previous comment...... These functions can also be invoked by some of the critical interupts, i cannot let these interupt just go away or remain pending.... Please advice

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Sit down and calm, it is not as complicated.

   

Try to imagine what may happen, when you call that function and while it is working an interrupt occurs and the function is called again. Since read-modify-write instructions are not atomic all of those may (will!) lead to something unpredictable. To help you to overcome these situations there are two helpers: The definition as "reentrant" which does not much in an ARM environment as a PSoC5 but is absolutely needed in a PSoC3 environment with its 8051....

   

Secondly there are the system-APIs CyEnterCriticalSection() and CyExitCriticalSection() which are intended for preventing small(!!!) areas of code beeing accessed simultaneously from different (or the same) pieces of code.

   

As some rules of thumb:

   

Local variables may be accessed without any restriction, they are allocated on the stach at function entry, or on a heap for reentrant 8051.

   

Local static vars should not be accessed in an interupt routine when the interrupt is re-enabled.

   

Global vars that must be accessed frim within an interrupt routine should

   

1. be declared as void

   

2. should be protected by critical sections when write accessed from outside the interrupt handler.

   

 

   

And to answer your last question: Yes, the functions you call from your interrupt-routine have to be declared as reentrant as well.

   

 

   

Happy interruptings

   

Bob

0 Likes
Anonymous
Not applicable

How to write Cyentercritical section and Cyexit critical section??

   

And what happens to the high priority interrupts ..will they be stopped when I am executing critical section or will they be pending.........If they will be pending then am i not sort of chsnging the priority?????

   

With the crucial info Bob has provided I think i need to redesign my program, .....Thnks for info Bob.....

0 Likes
Anonymous
Not applicable

 Refer to Section 12 of the System Reference Guide which provides more details on CyEnterCriticalSection() & CyExitCriticalSection() APIs

0 Likes