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

stack problem

hi all,
I have written a complex program (CAN higher layer protocol driver ),which
has many "for" loops and lots of calls.But after ceratin number of calls
the stack reaches 37 :1F and then on the program hangs ..I tried defining as much of global variables ,passing less parameters , overlaying etc .. but when theres a "for" loop of just @4 or 5 iterations , the stack problem comes ..

what are the possible options to avoid this from happening ?
regards
sameer

Parents
  • "access only the XDATA .. through ptrs"

    Are you sure that they're accessing XDATA? - use the debugger to verify that the pointers really are pointing to XDATA.

    With C51, your pointers need to specify not only the correct address, but also the correct memory space (CODE, DATA, IDATA, PDATA, XDATA). Therefore, if you have a bad pointer it could be pointing to the wrong address, or the wrong memory space, or both!!

Reply
  • "access only the XDATA .. through ptrs"

    Are you sure that they're accessing XDATA? - use the debugger to verify that the pointers really are pointing to XDATA.

    With C51, your pointers need to specify not only the correct address, but also the correct memory space (CODE, DATA, IDATA, PDATA, XDATA). Therefore, if you have a bad pointer it could be pointing to the wrong address, or the wrong memory space, or both!!

Children