Re: Floating point calculations on 16 uC
- From: paul$@pcserviceselectronics.co.uk (Paul Carpenter)
- Date: Sun, 28 Aug 2005 22:22:26 +0100 (BST)
On 28 Aug, in article
<1125239554.268511.307260@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
dbahlmann@xxxxxxxxx "db" wrote:
>It's not 1 or 3. Number 2 could be possible but the float routines is
>not very big and I have about 6KB stack allocated. I have decreased
>stack size to 4KB to see if the problem gets worse but it stays the
>same. Any other possibilities? Thanks
First as other have said quote the article you are answering.
Second HOW do you know that reducing the stack size means the
problem "stays the same"?
If memory map is as a guide
Address Stack top
6KB
Space 0 to n bytes
Last variable
When reducing the stack size may just make this
Address Stack top (address same as when stack was 6KB)
4KB
Space 2K to 2k+n bytes
Last variable
If when running with 6KB stack (for whatever processor/compiler compilation
you are using), the stack actually used is 6K + m bytes, if m is larger than
the space between your stack ALLOCATION and the last variable byte, then it
WILL overwrite the variable. This will happen NO matter what allocation size
you reduce it to.
If you have space between bottom of stack allocation and the last variable
fill it with KNOWN values like hex 01,02,03..... Check this has loaded
correctly before starting. When the process gives a garbage value check
these locations again, if different your stack actually has grown larger
than predicted.
There may be other problems but without details from a MAP file showing
what there is in address ranges from the last variable to where the stack
is and proof that you have performed some test of your own, (not some
stack routine that may be flawed).
What happens if you remove some variables or a module, to leave a larger
space below the stack?
What compiler, processor and other details would be helpful. It may be other
issues to do with the interupt routine itself, but more likely stack usage
is larger than you think it is.
--
Paul Carpenter | paul@xxxxxxxxxxxxxxxxxxxxxxxxxxx
<http://www.pcserviceselectronics.co.uk/> PC Services
<http://www.gnuh8.org.uk/> GNU H8 & mailing list info
<http://www.badweb.org.uk/> For those web sites you hate
.
- Follow-Ups:
- Re: Floating point calculations on 16 uC
- From: Rich Webb
- Re: Floating point calculations on 16 uC
- References:
- Floating point calculations on 16 uC
- From: db
- Re: Floating point calculations on 16 uC
- From: Richard
- Re: Floating point calculations on 16 uC
- From: db
- Floating point calculations on 16 uC
- Prev by Date: Re: mA-hour meter
- Next by Date: Re: Floating point calculations on 16 uC
- Previous by thread: Re: Floating point calculations on 16 uC
- Next by thread: Re: Floating point calculations on 16 uC
- Index(es):
Relevant Pages
|