Harold Hallikainen wrote: > What I'm doing now is writing a known pattern to the space between > the heap and the stack, running code for a while, then looking back > at that space. I can't figure out any other method on a PIC32 to > determine whether the stack and the heap have collided. The PIC24 has > a stack limit register, but apparently not the PIC32. I assume malloc > returns a null pointer when it runs out of space allocated for the > heap in the linker, but that does not keep the stack from growing > down into the heap space. I think this is what's causing my > occasional bus exceptions.=20 Isn't the PIC32 compiler GCC-based? If so, there may be other options. For example the -fstack-check option or the various -fstack-limit... options. They may or may not work on the PIC32; you'd have to check the compiler docs. Gerhard --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .