avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Stack size question


From: Theodore A. Roth
Subject: Re: [avr-gcc-list] Stack size question
Date: Mon, 28 Jun 2004 09:15:46 -0700 (PDT)

On Mon, 28 Jun 2004, John Yannakopoulos wrote:

> Hi Teo.
>
> Yes, this is good if you have a multitasking OS, i.e. you reserve RAM
> space for each task and you know exactly the ram space (from the
> heap...) that each task stack utilizes. I do not have a multitasking
> program. I have a monolithic kernel, where interrupts are not nested
> (interrupt depth = 1). My scheduler uses a priority queue data structure
> where functions may be scheduled from both interrupt and non-interrupt
> context. There are some points in time that my kernel crashes and I cannot
> find the reason. I'm 99% sure that I do not have race conditions.
> Using the 8535, the resources are so tight, having a RAM utilization of
> 479 bytes (in 512 bytes). That's why I guess it is a stack overflow
> problem, but I cannot find a way to determine the point in my code where
> the overflow possibly occurs.
>
> Any further suggestion?

You should be able to figure where your stack ends and the heap starts
by looking at the linker generated map file and a disassemble of your
code. If you can run your code in a simulator, you could set a watch
point at the last address of the stack. When that address gets changed,
you should be able to figure where you are getting your stack overflow.

Have you looked into John Regehr's stack tool?

  http://www.cs.utah.edu/~regehr/stacktool/

---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]