Cortex M3 - How detect stack overflow?

Note: This was originally posted on 12th January 2011 at http://forums.arm.com

Hi everybody,

I've started developing whit ARM few weeks a go and I have this doubt:
The Cortex-M3 have some hardware detection of stack overflow?

Let me explain:
I've used PIC24 for my last projects, and using as example, the PIC24 have the register "SPLIM" (Stack Pointer Limit) where you write the address of the last byte of your software stack and if your software try to write in more than the address wrote in the SPLIM register, the processor causes a "trap" (a kind of interruption with an dedicated vector).
Using this "trap" you can know if you have any stack overflow.

The ARM Cortex-M3 have something like that?

I've searched in the ARM v7 and the Cortex-M documentation and I just found something about BusFault in stacking but I don't understand very well.

Sorry for my poor english (I'm from Brazil) and thanks in advance.
André Rairan.
Parents
  • Note: This was originally posted on 13th January 2011 at http://forums.arm.com

    Great considerations, thanks again.

    I would like to know in runtime, then I could create a kind of LOG to know the problem and solve increasing the stack size or changing the program.
    Just to protect my software from this "bug"

    How could I use the MPU for this?

    Regards.
Reply
  • Note: This was originally posted on 13th January 2011 at http://forums.arm.com

    Great considerations, thanks again.

    I would like to know in runtime, then I could create a kind of LOG to know the problem and solve increasing the stack size or changing the program.
    Just to protect my software from this "bug"

    How could I use the MPU for this?

    Regards.
Children
No data
More questions in this forum