CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Stack Resize in PIC24
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Max



Joined: 15 Dec 2003
Posts: 51
Location: Italy

View user's profile Send private message

Stack Resize in PIC24
PostPosted: Wed Jun 10, 2015 11:51 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 10, 2015 2:24 pm     Reply with quote

look at the #build directive in the manual
Max



Joined: 15 Dec 2003
Posts: 51
Location: Italy

View user's profile Send private message

PostPosted: Thu Jun 11, 2015 4:34 am     Reply with quote

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
Code:
#build(stack=512)
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

View user's profile Send private message

Stack Size like this
PostPosted: Thu Jun 11, 2015 6:22 am     Reply with quote

#stack (256)

This works with V5.046
Max



Joined: 15 Dec 2003
Posts: 51
Location: Italy

View user's profile Send private message

Re: Stack Size like this
PostPosted: Thu Jun 11, 2015 6:55 am     Reply with quote

soonc wrote:
#stack (256)

This works with V5.046

But.... where did you find the 'information that says to use

Code:
#stack (xxx)
?


because in both 'help online and in pdf manual is not the' I found
soonc



Joined: 03 Dec 2013
Posts: 215

View user's profile Send private message

Re: Stack Size like this
PostPosted: Fri Jun 12, 2015 6:03 am     Reply with quote

Max wrote:
soonc wrote:
#stack (256)

This works with V5.046

But.... where did you find the 'information that says to use

Code:
#stack (xxx)
?


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

View user's profile Send private message

PostPosted: Mon Jun 15, 2015 1:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Oct 14, 2015 9:11 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Oct 15, 2015 12:33 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 04, 2016 5:42 am     Reply with quote

PCD 5.046 appears to not work for

Code:
#build(stack=0x300)


because in the symbol file after compile I have

Code:
7F80-7FFF Stack
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Mon Jan 04, 2016 9:51 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jan 04, 2016 9:56 am     Reply with quote

DSPIC33EP256MU806

I should be updated to 5.053 in the morning, and will try again...
oxo



Joined: 13 Nov 2012
Posts: 219
Location: France

View user's profile Send private message

PostPosted: Tue Jan 05, 2016 4:21 am     Reply with quote

It's the same with 5.053.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Tue Jan 05, 2016 4:50 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 05, 2016 4:54 am     Reply with quote

Ttelmah wrote:
You are putting it right after the include file?.


I am now. Thanks for your help Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group