This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

8051 - compile-time stack - is stack theoretically overflow possible ?

Hi,

From the following  link  I have understood the compiler analyses the program and sets the stack size for the 8051. I am seeing a stack overlow when one ISR interrupts a lower priority ISR. If the compiler  analyses the program and sets the stack, to a size it deems adequate, then how can it overflow ? I am using a 8051 and a Keil compiler.

Any help would be appreciated.

Thanks,

Rochus

Parents
  • The material you quote explains how C51 manages to keep almost all the data (function arguments, local variables) out of the actual stack, by applying static call tree analysis.  You can help it by banking registers for interrupt handlers.  But some data still end up on the stack, most notably the return addresses for CALL/RET and interrupts.  Those occupy whatever remains of your IDATA.

Reply
  • The material you quote explains how C51 manages to keep almost all the data (function arguments, local variables) out of the actual stack, by applying static call tree analysis.  You can help it by banking registers for interrupt handlers.  But some data still end up on the stack, most notably the return addresses for CALL/RET and interrupts.  Those occupy whatever remains of your IDATA.

Children
No data