Re: FPU problem urgent

"Julian Requejo" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
I am not 100% what the problem is, but for a first try, I see some very
strange things in your code. You initialize your FPU inside main, which
looks like a very bad thing to me, because you have some floats in the
stack, some of them even initialized! (i=0). Another side note, you should
initialize it to 0.0, or 0F. I encourage you to read in some book implicit
an explicit variable initialization. Anyway, so the compiler will initialize
a float without you even having your FP unit working yet. Looks like an
exeption fault to me. As I've mentioned in my last email, you should
initialize your FP unit earlier (I do it during processor intialization,
when you initialize your PLL, memory controllers, etc, before your static
data gets initialized)! 

I am not sure how CW works with asm functions (saves registers) and I don't
remember either if r3 is a scratch register or something important. Check
this out, otherwise your fpuaku function might corrupt your r3. (someone
else please help on this one).

Last but not least, it is very unlikely that CW generates bad code. So if
your disasembly looks bad, your are most likely either looking at it in the
wrong way, or you are experiencing memory corruption.
Regards,
-Julian


-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.