Is there a stack overflow indicator in PSoC 3/5

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

cross mob
Anonymous
Not applicable

 Is there any idicator bit of Stack overflow in PSoC3. Seems like the program execution is random on attach to running target.

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

This might tangentially be of some help -

   

 

   

      http://www.cypress.com/?docID=34362

   

 

   

Regards, Dana.

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

Busting the stack on a 8051 core as in a PSoC3 is an easy thing because it is so small. You can pre-load the stack with some defined values at start of main() and check after some time of running with the debugger if the stack is approaching to its limit.

   

Have a look at any warnings and take care when using pointers to functions which may lead to errors in PSoC3 environment when not explicitely cared for, they may produce random errors.

   

Keep an eye on heap usage as well.

   

 

   

Bob

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

In Creator you can set a watchpoint at the top of stack which will interrupt your program when that location is accessed.

   

 

   

Bob

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

A couple of interesting references -

   

 

   

http://www.keil.com/support/docs/192.htm

   

 

   

http://www.keil.com/forum/7226/

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

But where this small stack is?

   

Is it here:

   

?STACK          SEGMENT   IDATA

                RSEG    ?STACK

   

or here:

   

XBPSTACK        EQU     1
XBPSTACKTOP     EQU     CYDEV_SRAM_SIZE - 3 ;Keep in mind additional variables declared above

   

all is taken from KeilStart.a51

0 Likes