Linux 2.6.10, MCF5475/85EVB, Getting "Illegal instruction" message...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linux 2.6.10, MCF5475/85EVB, Getting "Illegal instruction" message...

1,426 Views
jkimble
Contributor III

I've had Linux running on this platform (MCF5484 on a custom board based on the MCF5485EVB) for several months now but though I can compile and run programs on it I always get the message "Illegal instruction" upon program completion. For example the following program:

===============================================================
#include <stdio.h>

int main ()
{
    struct S1D_REGS
    {
        unsigned char INDEX;
        unsigned long VALUE;
    } aS1d_reg;

    printf ("sizeof(aS1d_reg): %d bits\n", sizeof(aS1d_reg)*8);
    printf ("sizeof(unsigned short): %d bits\n", sizeof(unsigned short)*8);
    printf ("sizeof(unsigned int): %d bits\n", sizeof(unsigned int)*8);
    printf ("sizeof(unsigned long): %d bits\n", sizeof(unsigned long)*8);
    printf ("sizeof(unsigned char): %d bits\n", sizeof(unsigned char)*8);

    exit (0);
}
================================================================
Output:
sizeof(aS1d_reg): 48 bits
sizeof(unsigned short): 16 bits
sizeof(unsigned int): 32 bits
sizeof(unsigned long): 32 bits
sizeof(unsigned char): 8 bits
Illegal instruction
===============================================================

Real simple program, seems to run to completion without error but before the program exits it gives that message. What gives?  Every program I run does this. Any ideas....?

Labels (1)
0 Kudos
2 Replies

241 Views
JWW
Contributor V
jkimble,

This does seem strange.  The 548x and 547x platform uses an older toolchain and of course an older BSP.  We are in the process of updating both of these items.  But regardless I don't think it should do what you are seeing.  I'll ping some of the internal team and see if we get any ideas.

-JWW
0 Kudos

241 Views
jkimble
Contributor III
 
 
Never mind...  I'm guess I've been working on the same thing for too long. I'm getting punchy. I use makefiles for most tihngs but in this case (and several prototype things I'm doing) I was compiling off the command line and I forgot to include the processor specific command line arguments for gcc (-mcfv4e) so everything was screwy.  I couldn't figure out how some of the complex things I was doing were working when something so simple wouldn't....  Mystery solved.
 
Sorry for wasting peoples time.
0 Kudos