I'm maintaining some code on a BL2600 board and recently saw an unhandled RST38 error while in debug mode. From what I found on the internet this normally means writing outside an array boundary or a stack overflow. I made a few changes to the code and the error went away but I wanted to check further to make sure there wasn't a problem.
I found that if I start my program from DynamicC 9.62 in debug mode and put a breakpoint somewhere, I can view the Debug Windows -> Stack Trace and see a few bytes written to the stack and everything looks OK. I can put the breakpoint somewhere else and see a different stack trace as expected.
If I just start the program and check the Debug Windows -> Stack Trace without using a breakpoint, I see 9008 bytes traced and Overflow - 4096 bytes allocated. The program does seem to work without any runtime errors. I would expect if the stack were overflowed by that amount I would be having major problems. I also implemented a Stack Limit Violation ISR to trap any overflow, it never fires.
Is the stack really overflowed by that amount, or does it show an overflow because I didn't put a breakpoint in to halt the program before checking the stack trace?
--------------------------------------- Posted through