stack depth

Beta Testing discussion on mikroPascal PRO for PIC32.
Post Reply
Author
Message
jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

stack depth

#1 Post by jpc » 03 May 2011 16:14

I am having some problems with a function call from within a timer ISR.
from the help section on interrupts i read :
It is not recommended to use a function call from interrupt. In case of doing that take care of stack depth.
How can i do that ? I use a code that runs perfect on P18 and P24 , my CPU (P32MX340F256H) seems to get completely stuck if i call that function, simply skipping that call brings the ISR to live again.
Currenly the view statistics does not work for this code so i cannot easily check the stack-depth.
Au royaume des aveugles, les borgnes sont rois.

JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

Re: stack depth

#2 Post by JimKueneman » 04 Nov 2011 05:22

Hi jpc,

Did you ever figure this out? I am just about to convert my dsPIC code to the PIC32 but this is a show stopper for me. It appears that the PIC32 is just like the dsPIC and has a software stack (r29 is the stack pointer). The only thing I can think this means is you can run out of ram. I thought the dsPIC compiler walked through all possible function calls and calculated the stack size for you. If it would not fit it threw a cryptic warning.


Jim

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

Re: stack depth

#3 Post by jpc » 04 Nov 2011 09:08

Jim,

this was in fact never answered but it may well be that this was fixed in the latest update , the statistics show now the stackdepth and probably that was missing in the beginning. I am using functioncalls from within ISR so it must have been solved
Au royaume des aveugles, les borgnes sont rois.

JimKueneman
Posts: 417
Joined: 10 Jan 2009 22:03

Re: stack depth

#4 Post by JimKueneman » 04 Nov 2011 14:40

Good, I had asked for the stack depth to be reported in the dsPIC compiler. I am glad it has been implemented. I am on the list for the next dsPIC beta so I hope it is there too.

Jim

Post Reply

Return to “mikroPascal PRO for PIC32 Beta Testing”