public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Get problem on "Hello eCos world!"
@ 2006-07-30  5:22 Frank Wu
  2006-07-30 16:07 ` Moussa Ba
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Wu @ 2006-07-30  5:22 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I want generate a bin file which can boot up AT91SAM7256 and send
"Hello eCos world!" back to hyper terminal. I am new to eCos. Please
tell me if I did it right.
1) I use AT91SAM7SEK template default package to generate libtarget.a
ROM is selected to Startup type in Atmel AT91SAM7 HAL. Take out some
packages I do not need.
2) I changed hello.c (code see bellow) in c:\ecos\examples\ and use
the make file over there
3) using objcopy convert .elf file to .bin file
4) using SAM-BA load .bin file to board

I got compile problem at step 2). Please see code and error message bellow.
I am using gcc version 4.1.0

Thanks in advance,

-frank

hello.c
=====
/* this is a simple hello world program */
#include <stdio.h>
#include <cyg/kernel/kapi.h>      // Kernel API.
#include <cyg/infra/diag.h>      // For diagnostic printing.
int main(void)
{
while(1)
  {
  diag_printf( "Hello, eCos world!\n");
// Delay for 1 second.
  cyg_thread_delay( 100 );
  }
}

Error message:
===========
c:\cygwin\workdir\at91\ecos examples>make
INSTALL_DIR=c:/cygwin/workdir/at91/ecos_install
arm-elf-gcc -c -o hello.o -Ic:/cygwin/workdir/at91/ecos_install/include -mcpu=ar
m7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-v
irtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvt
able-gc -finit-priority hello.c
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++
but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not fo
r C
cc1: warning: command line option "-fvtable-gc" is valid for C++/ObjC++ but not
for C
cc1: error: unrecognized command line option "-finit-priority"
make: *** [hello.o] Error 1

c:\cygwin\workdir\at91\ecos examples>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Get problem on "Hello eCos world!"
  2006-07-30  5:22 [ECOS] Get problem on "Hello eCos world!" Frank Wu
@ 2006-07-30 16:07 ` Moussa Ba
  0 siblings, 0 replies; 2+ messages in thread
From: Moussa Ba @ 2006-07-30 16:07 UTC (permalink / raw)
  To: Frank Wu; +Cc: ecos-discuss

You are most likely using a more recent version of gcc, try compiling 
without the -finit-priority.

Moussa

Frank Wu wrote:
> Hi,
>
> I want generate a bin file which can boot up AT91SAM7256 and send
> "Hello eCos world!" back to hyper terminal. I am new to eCos. Please
> tell me if I did it right.
> 1) I use AT91SAM7SEK template default package to generate libtarget.a
> ROM is selected to Startup type in Atmel AT91SAM7 HAL. Take out some
> packages I do not need.
> 2) I changed hello.c (code see bellow) in c:\ecos\examples\ and use
> the make file over there
> 3) using objcopy convert .elf file to .bin file
> 4) using SAM-BA load .bin file to board
>
> I got compile problem at step 2). Please see code and error message 
> bellow.
> I am using gcc version 4.1.0
>
> Thanks in advance,
>
> -frank
>
> hello.c
> =====
> /* this is a simple hello world program */
> #include <stdio.h>
> #include <cyg/kernel/kapi.h>      // Kernel API.
> #include <cyg/infra/diag.h>      // For diagnostic printing.
> int main(void)
> {
> while(1)
>  {
>  diag_printf( "Hello, eCos world!\n");
> // Delay for 1 second.
>  cyg_thread_delay( 100 );
>  }
> }
>
> Error message:
> ===========
> c:\cygwin\workdir\at91\ecos examples>make
> INSTALL_DIR=c:/cygwin/workdir/at91/ecos_install
> arm-elf-gcc -c -o hello.o 
> -Ic:/cygwin/workdir/at91/ecos_install/include -mcpu=ar
> m7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef 
> -Woverloaded-v
> irtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti 
> -fno-exceptions -fvt
> able-gc -finit-priority hello.c
> cc1: warning: command line option "-Woverloaded-virtual" is valid for 
> C++/ObjC++
> but not for C
> cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ 
> but not fo
> r C
> cc1: warning: command line option "-fvtable-gc" is valid for 
> C++/ObjC++ but not
> for C
> cc1: error: unrecognized command line option "-finit-priority"
> make: *** [hello.o] Error 1
>
> c:\cygwin\workdir\at91\ecos examples>
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-30 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-30  5:22 [ECOS] Get problem on "Hello eCos world!" Frank Wu
2006-07-30 16:07 ` Moussa Ba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).