View previous topic :: View next topic |
Author |
Message |
Max
Joined: 15 Dec 2003 Posts: 51 Location: Italy
|
Stack Resize in PIC24 |
Posted: Wed Jun 10, 2015 11:51 am |
|
|
Hello,
The compute of stack size by linker it's not enough for
our application, sometime the device go to reset state.
How to set manually or increase size the deep of stack size to
24ep512xxx controller ?
Thank |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1354
|
|
Posted: Wed Jun 10, 2015 2:24 pm |
|
|
look at the #build directive in the manual |
|
|
Max
Joined: 15 Dec 2003 Posts: 51 Location: Italy
|
|
Posted: Thu Jun 11, 2015 4:34 am |
|
|
Thank,
in the ... \ PICC had a manual in pdf, outdated, I thought that upgrading the compiler was updated also the pdf but it is not so '
He said to use but did not work, I had to write, as specified in the manual updated, Code: | #build(stack=0xDE00:0xDFF0) | and now it seems to work
also not work if write Code: | #build(stack=0xDE00) |
|
|
|
soonc
Joined: 03 Dec 2013 Posts: 215
|
Stack Size like this |
Posted: Thu Jun 11, 2015 6:22 am |
|
|
#stack (256)
This works with V5.046 |
|
|
Max
Joined: 15 Dec 2003 Posts: 51 Location: Italy
|
Re: Stack Size like this |
Posted: Thu Jun 11, 2015 6:55 am |
|
|
soonc wrote: | #stack (256)
This works with V5.046 |
But.... where did you find the 'information that says to use
?
because in both 'help online and in pdf manual is not the' I found |
|
|
soonc
Joined: 03 Dec 2013 Posts: 215
|
Re: Stack Size like this |
Posted: Fri Jun 12, 2015 6:03 am |
|
|
Max wrote: | soonc wrote: | #stack (256)
This works with V5.046 |
But.... where did you find the 'information that says to use
?
because in both 'help online and in pdf manual is not the' I found |
I called CCS Tech Support with a float issue (see elsewhere on the forum), and it was really a stack issue.
They told me to use that syntax.
The Stack sizing will be fixed in next release I was told. |
|
|
Max
Joined: 15 Dec 2003 Posts: 51 Location: Italy
|
|
Posted: Mon Jun 15, 2015 1:38 am |
|
|
Thank response,
I think CCS, should enter in the online Help or the PDF manual, ALL syntax provided.
Or, when you download the 'update, which should automatically release also the' last updated manual.
I lost two days for this!
Thanks anyway to the forum community ... |
|
|
benoitstjean
Joined: 30 Oct 2007 Posts: 566 Location: Ottawa, Ontario, Canada
|
|
Posted: Wed Oct 14, 2015 9:11 am |
|
|
Don't worry, I've been using CCS since 1999 and that has always been their major problem: documentation. It's just plain horrible. It has always been that way and from what I have seen over the years, I doubt they'll ever update it. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu Oct 15, 2015 12:33 am |
|
|
There are actually two manuals with CCS.
The .chm manual that comes 'with' the compiler, and the .pdf, which is always a separate download.
The .chm, is easier to use, but is always older than the .pdf.
When you update the compiler, it includes the .chm manual, but does not include the .pdf. You must download this separately.
Then there is also a 'readme.txt' with the compiler, that contains small changes, that have happened since the last pdf manual. Beware though, that since the manual with the compiler, is the older .chm manual, there will be gaps between this and the readme, unless you download the .pdf.....
#stack appeared in the readme, about twenty versions ago, for a couple of releases. It was then removed. The syntax for #build is in the pdf manual, and does work correctly on the current releases. #stack worked for a few more versions, but has now been removed.
What appears happened, was that there was a problem with the #build syntax, and #stack was implemented, and documented only in the readme. They then got #build working, and have got rid of #stack, but now properly documented the #build syntax.
With the current compiler versions
#BUILD (STACK=512)
Correctly allocates a 512 byte stack.
#stack now gives an 'invalid pre-processor directive' error. |
|
|
oxo
Joined: 13 Nov 2012 Posts: 219 Location: France
|
|
Posted: Mon Jan 04, 2016 5:42 am |
|
|
PCD 5.046 appears to not work for
Code: | #build(stack=0x300) |
because in the symbol file after compile I have
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Mon Jan 04, 2016 9:51 am |
|
|
What chip?.
Have just tried 5.046, and it merrily resized the stack OK for me on half a dozen chip. |
|
|
oxo
Joined: 13 Nov 2012 Posts: 219 Location: France
|
|
Posted: Mon Jan 04, 2016 9:56 am |
|
|
DSPIC33EP256MU806
I should be updated to 5.053 in the morning, and will try again... |
|
|
oxo
Joined: 13 Nov 2012 Posts: 219 Location: France
|
|
Posted: Tue Jan 05, 2016 4:21 am |
|
|
It's the same with 5.053. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Tue Jan 05, 2016 4:50 am |
|
|
You are putting it right after the include file?.
So:
Code: |
#include <33EP256MU806.h>
#build(stack=0x300)
#device ICSP=1
//etc..
|
Have just tried, and it merrily sets the stack for me on this chip.
But it must be done before anything uses the stack.
Have tried with 5.046, and 5.053. |
|
|
oxo
Joined: 13 Nov 2012 Posts: 219 Location: France
|
|
Posted: Tue Jan 05, 2016 4:54 am |
|
|
Ttelmah wrote: | You are putting it right after the include file?. |
I am now. Thanks for your help |
|
|
|