[ECOS] simple question regarding hello.c world and Redboot

Stephen Polkowski stephen@centtech.com
Mon Jan 16 23:17:00 GMT 2012


Hello,

	I'm having difficulty in getting a simple application like hello.c to 
run with Redboot on the pc.  When I run hello from GDB I don't see any 
printfs on the screen.  I'm stumped as to my mistake.

	My simple question is should I compile my hello.c application against 
the Redboot build tree or the generic pc build tree?  I assume
that I should be building it against the generic pc tree.

	When I try to build the hello.c app against the redboot tree
it fails because printf function isn't in the library.

hello.c:6: warning: implicit declaration of function 'printf'
hello.c:6: warning: incompatible implicit declaration of built-in 
function 'printf'
i386-elf-gcc -L/home/users/stephen/ecos/redboot_i82559/install/lib 
-nostartfiles -Wl,--gc-sections -Wl,--Map -Wl,hello.map -o hello hello.o 
-Ttarget.ld -nostdlib
/home/users/stephen/ecos/redboot_i82559/install/lib/libtarget.a(redboot_main.o): 
In function `cyg_start':
/opt/ecos/ecos/packages/redboot/current/src/main.c:264: undefined 
reference to `RedBoot_version'
collect2: ld returned 1 exit status

	Therefore, I've been building hello.c with the pc_i82559 tree.
Everything compiles just fine, except I don't see any printfs on the screen.

ecosconfig new pc_i82559
ecosconfig check
ecosconfig tree
make

cd app
make
i386-elf-gcc -c -o hello.o -g 
-I/home/users/stephen/ecos/pc_i82559/install/include -Wall 
-ffunction-sections -fdata-sections hello.c
i386-elf-gcc -L/home/users/stephen/ecos/pc_i82559/install/lib 
-nostartfiles -Wl,--gc-sections -Wl,--Map -Wl,hello.map -o hello hello.o 
-Ttarget.ld -nostdlib

gdb hello
(gdb) target remote 10.40.200.22:9000
Remote debugging using 10.40.200.22:9000
0x00114398 in ?? ()
(gdb) load hello
Loading section .text, size 0x8cf6 lma 0x208000
Loading section .rodata, size 0x8e8 lma 0x210cf8
Loading section .data, size 0x240 lma 0x2115e0
Start address 0x208000, load size 38942
Transfer rate: 381784 bits/sec, 499 bytes/write.
(gdb) continue
Continuing.


	I realize that the default pc_i82559 build disables rom monitor support 
and I've been fiddling with different settings but I haven't got it 
figured out.

	Could someone share the obvious configuration for enabling Redboot gdb 
support to a basic hello.c app for the pc_i82559 build?  I'm shocked 
that I can't figure this one out.

Thanks for your help,

Stephen

	



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



More information about the Ecos-discuss mailing list