Jump to content
Sign in to follow this  
MarkL

Software Call Stack Generation Error

Recommended Posts

Hello,

We have a project that is quite heavy on the interrupt call stack (16F876A).

The linker gives the following warning:

 

-------------------

Building CASM file

Serious Warning: Call stack usage exceeds:8!

 

Call Stack Usage Report

=======================

main and Task(s): hw used:6, exceeded by:0

interrupt: hw used:6, exceeded by:0

-------------------

 

We tried to use the linker option: -swcs 6 2 to solve the stack problem.

All warnings are gone, but we can definitely see in the generated .lst file that

ONLY the first two calls in the interrupt tree are software calls, and all deeper calls are hardware CALL statements.

This must be a linker bug.

 

We also tried: -swcs 0 0

(or should this be: 0 1 because the interrupt uses one hardware call?)

 

Then the linker give the following warnings:

-------------------

Internal Warning:Duplicate Var id:0xF0000604:

Internal Warning:Duplicate Var id:0xF0000605:

Internal Warning:Duplicate Var id:0xF0000606:

Internal Warning:Duplicate Var id:0xF0000607:

Internal Warning:Duplicate Var id:0xF0000608:

Internal Warning:Duplicate Var id:0xF0000609:

Internal Warning:Duplicate Var id:0xF000060A:

Internal Warning:Duplicate Var id:0xF000060B:

Internal Warning:Duplicate Var id:0xF000060C:

Internal Warning:Duplicate Var id:0xF000060D:

Internal Warning:Duplicate Var id:0xF000060E:

-------------------

 

Please advice how we must procede.

Regards,

/Mark

Share this post


Link to post
Share on other sites
We tried to use the linker option: -swcs 6 2  to solve the stack problem.

All warnings are gone, but we can definitely see in the generated .lst file that

ONLY the first two calls in the interrupt tree are software calls, and all deeper calls are hardware CALL statements.

This must be a linker bug.

I just wrote a simple test program with -swcs 6 2, it looks like there is a error with linker V6.60 in that you get 2 + 1 hardware stack used in the ISR.

This will be (is already) fixed in the next release.

 

We also tried: -swcs 0 0

(or should this be: 0 1 because the interrupt uses one hardware call?)

The numbers are the amount hardware stack that will be used, this is in addition to that which is required to get to the interrupt routine.

 

Then the linker give the following warnings:

-------------------   

Internal Warning:Duplicate Var id:0xF0000604:

Internal Warning:Duplicate Var id:0xF0000605:

Internal Warning:Duplicate Var id:0xF0000606:

Internal Warning:Duplicate Var id:0xF0000607:

Internal Warning:Duplicate Var id:0xF0000608:

Internal Warning:Duplicate Var id:0xF0000609:

Internal Warning:Duplicate Var id:0xF000060A:

Internal Warning:Duplicate Var id:0xF000060B:

Internal Warning:Duplicate Var id:0xF000060C:

Internal Warning:Duplicate Var id:0xF000060D:

Internal Warning:Duplicate Var id:0xF000060E:

-------------------   

This problem has already been reported and fixed. This warning can be safely be ignored.

 

Regards

Dave

Share this post


Link to post
Share on other sites
We can also see that the main thread software call stack is not always generated. (external function calls?)
We also tried: -swcs 0 0

(or should this be: 0 1 because the interrupt uses one hardware call?)

The numbers are the amount hardware stack that will be used, this is in addition to that which is required to get to the interrupt routine.

Do I understand correctly that -swcs 6 2 can use 9 (6+2+1) hardware stack positions?

Than this still can cause call stack overflow!

Please make this clear in the documentation, or change the example in the documentation to -swcs 6 1 to pointout this behaviour.

 

Thanks,

/Mark

Share this post


Link to post
Share on other sites
Do I understand correctly that -swcs 6 2  can use 9 (6+2+1) hardware stack positions?

Than this still can cause call stack overflow!

Please make this clear in the documentation, or change the example in the documentation to  -swcs 6 1  to pointout this behaviour.

The functionality should be changed so that -swcs 6 2 does what you expect, as this makes the most sense.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Fixed in BoostC V6.70.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...