Problems with the m32c target and M16C6N cpu

fvzeppelin@mail.com fvzeppelin@mail.com
Sat Sep 3 09:33:00 GMT 2005


I have built a cross-gcc (gcc Aug 19th, binutils Aug. 21st, newlib Aug.
27th) on cygwin for the m32c target. The small test program that I use is:

struct bit_def {
        char    b0:1;
        char    b1:1;
        char    b2:1;
        char    b3:1;
        char    b4:1;
        char    b5:1;
        char    b6:1;
        char    b7:1;
};

union byte_def{
    struct bit_def bit;
    char    byte;
};

#define pd5_addr (*(volatile union byte_def *) 0x03eb)       /* Port P5
direction register */
#define p5_addr (*(volatile union byte_def *) 0x03e9)       /* Port P5
register */
#define pd5 pd5_addr.byte
#define p5_0 p5_addr.bit.b0

int main ()
{
    int i=0;

    pd5 = 1; // set p5_0 output
    while (1)
    {
       while (i++<1000)
          p5_0=1;
       while (i++<2000)
          p5_0=0;
       i=0;
    }
    return 0;
}

The purpose of the program is to just toggle the output of Port 5_0
between 0 and 1. Actually, after building an object file with gcc
-mcpu=m16c, objcopy -Osrec, and flashing, there happens just nothing on
my M16C6N testboard. And when I try the file with the kd30 debugger, it
just hangs up.

Does anyone have a clue on what I'm doing wrong?

So long

Frank





	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de



More information about the Gcc mailing list