other things to check too
- stack is aligned, all the bytes added in the function have been removed before the RTS
- nothing in the function overwrites the return address
- the caller is using a JSR/BSR (and not CALL, for example)
- the stack is in RAM (as kef noted)
- the stack is allocated large enough.
Daniel