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

LPC935 Stack curiosity

Hello,

I have code running on a LPC935 that crashes in certain situations. To find the cause I also checked the space required for stack. To do this I read back the idata memory from 0FFh to start address of SP. idata is set to 0h at boot time, so the first (from top) byte that is not 0h is the end of the stack.

The interesting thing is I found stack bytes that are already used (not equal 0h) and suddenly are cleared!

Is this an indicator of some wild running code that overwrites my stack, or is it a behavior I just don't understand.

Any input would greatly appreciated.

Gustl

  • The interesting thing is I found stack bytes that are already used (not equal 0h) and suddenly are cleared!

    Is this an indicator of some wild running code that overwrites my stack, or is it a behavior I just don't understand.

    if it an occasional byte written as 0 then it just means it has been saved by some call e.g. a properly written ISR (using not = 0) will save the Acc and the PSW wich could be 0. If you have ignored the '51 architecture/compiler and have ISRs using 0, you will have many registers saved for each interrupt.

    Erik

  • It is a HW problem. LPC935 is running with 19,2MHz at 3.3V. Clock is above the specification (18MHz), but should work with 3.3V - says the HW guy - but it doesn't.

    Switching to internal oscillator (7.373MHz) or using a LPC9351 does the trick.

  • Don't believe the hw guy - check what the specifications for the processor says.