This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

FW: Problem regarding sh-hms tool.




Hi Kai,
Thanks for reply.
I want to build the compiler for the HITACHI SH2 series.
I configured the source code as: 
configure --build=i586-linux-gnu  --host=i586-cygwin32  --target=sh-hms.
then by using make and make install command i build the tool.
The version is 2.9-gnupro-98r2.
I write a simple program for testing which works fine if it is complied with HITACHIs Embedded Workshop(HEW by Hitachi)..

The code is as given >>>>

/*********************test.c***************************/
void delay(void);
void main(void);   

#define PAIOR (*(volatile unsigned short *)(0xFFFFF720))
#define PACRH (*(volatile unsigned short *)(0xFFFFF722))
#define PACRL (*(volatile unsigned short *)(0xFFFFF724))
#define PADR (*(volatile unsigned short *)(0xFFFFF726))
#define  PHIOR  (*(volatile unsigned short *)(0xFFFFF728))  

volatile unsigned long LedRate=100000;      
volatile int countledflash=0;
    
int a;
int i; 
       
void main(void)
{
	PACRL = 0x0000; 			/* Port A Control Register Low = 0x0000 */ 
 	PADR = 0xFFFF;  			/* Port A Data Register = 0xFFFF */
		           
 //	PAIOR = 0x7FFF;    			/* Sets TxD0 as an ouput and RxD0 as an input */                
 //	PACRH = 0x5000;    			/* Enables TxD0 and RxD0 */       
   	PHIOR = 0xFFFF;
	PADR = 0x3; 
	while (1)
	{
                   
		delay();        
		PADR ^= 0x0003;           	/* Toggles the LED  on port PA.0 PA.1*/ 
	}
	
		
}   


void delay(void)					/* simple delay function,*/
{
	unsigned long x;
	for(x=0;x<LedRate;x++)    		/* Wait loop for LED off */
	{
		a -= 1;
	}
} 
/**********************************************************************************************/
I tried the same program by compiling it with GCC tool as follows.
GCC -m2 -c -o test.o  test.c
-m2 for SH2 series.
-o for o/p file format followed by file name test.o.
-c for compile and assemble only(do not link).
test.c - input file.

then i linked the file with crt0.o 
ld crt0.o test.o

it generates a.out file.I convert the file to motorola format( required for downloading tool in S-Record format.) as
objcopy -O srec a.out a.mot.

but it fails when it was downloaded to the target device on EVB.
I am unable to locate the problem.  
Waiting for your suggetion.
Tanks & regards.
Nivrutti.


-----Original Message-----
From:	Kai Ruottu [SMTP:kai.ruottu@luukku.com]
Sent:	Wednesday, April 04, 2001 10:10 PM
To:	Nivrutti
Cc:	'crossgcc@sourceware.cygnus.com'
Subject:	Re: Problem regarding sh-hms tool.

Nivrutti wrote:

> I have build a tool for SH-hms series.
> But, after compiling it gives error.
>         fake: undefined reference to '_set_fpscr'
>         Collect2: ld returned 1 exit status.
> then compilation is terminated.

 Your 'libgcc.a's for sh3e and sh4 should provide this
routine. It has been a part of the GCC-helper library
for SH for some time.

 Please tell your GCC-version. Upgrading it gives the
necessary routine in the libgcc.a's or you can try to
upgrade only the 'gcc/config/sh/lib1funcs.asm' which
has the routine in newer incarnations. Also the 't-sh'
there must be fixed by adding the routine name.

 For instance the egcs-1.1.2 (2.91.66 from 990314) didn't
have it, while the ecos-1.2.1 GCC-sources (gcc-2.9-990319)
had it and the 'crt0.S' for SH3e in newlib-1.8.1/1.8.2
needed it...

 If your host is Win32 or Solaris, Hitachi provides quite
new (Oct - Nov 2000) prebuilt SH-tools via its:

 http://semiconductor.hitachi.com/repository/tools/Gnutool.html

so you can perhaps avoid the recompiling... BTW, the 'sh-elf'
tools can still produce COFF ('hms') with '-oformat', if that
is an issue...

Cheers, Kai

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]