Re: Floating point calculations on 16 uC



On 28 Aug 2005 07:32:34 -0700, "db" <dbahlmann@xxxxxxxxx> 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

You've assured us that changes in stack size do not appear to impact
the behavior. My own experience in areas like this are that they
occur when there is static variables involved in the floating point
routines and that the interrupt routines are modifying them in some
way. If you pre-empt an in-progress floating point operation that
depends on some temporary static region for its work and if the code
that pre-empts it also calls some function that re-uses this static
area, that's all that is needed.

It DOES NOT have to be the case that your interrupt procedures use the
floating point, though that is certainly a common source of problems
in this case. It may only be that some other library code also shares
this temporary static region for any purpose at all -- the only
requirement is that it does mess up the in-progress static areas being
used by the particular floating point code. That could just be a
common buffer used for many other purposes, such as atof() or gcvt()
or even something you might not expect at all.

I'd be spending some time looking over the floating point source code
-- which should be provided.

Jon
.



Relevant Pages

  • Re: Assemblers are for hiding your work , not for faster code .
    ... (And failed to maintain attributions) ... is a 30 year old example of mine, for an 8080 floating point ... lfbs is load b reg from arbitrary stack level. ... First coefficient is order of polynomial ...
    (comp.arch.embedded)
  • Re: severe(163): Program Exception - floating stack check
    ... because the memory layout on a 64-bit OS may be different than the ... 64-bit contexts and the floating point stack only in 32-bit code. ... use STto return a floating point value but 64-bit Windows (and I ... there is a function named timuse, but in a subroutine program name fem ...
    (comp.lang.fortran)
  • Re: Cant find sqrt() definition! Going nuts!
    ... log10leaves the floating point control word set to 'round' and not 'chop'. ... In intel asm, ... stack for __ftol to use doublevar casts in the MS ...
    (uk.comp.os.linux)
  • Re: Floating point calculations on 16 uC
    ... >> All float calculations are done in the main loop context. ... >> using floating point calculations would be appreciated. ... There is one rather ugly variant of stack overflow that I ran across many ... These sections often have notes on interactions with interrupts ...
    (comp.arch.embedded)
  • Re: Floating point calculations on 16 uC
    ... >I'm doing floating point calculations on a Fujitsu MB90F474 16bit uC. ... It sounds like the stack is overwriting the ... I suspect that local variables for your floating point routines are what ...
    (comp.arch.embedded)