[U-Boot-Users] printf with u-boot-1.1.2
Andrew Wozniak
awozniak at mc.com
Tue Oct 11 20:56:40 CEST 2005
Andrew Wozniak | Mercury Computer Systems
978.967.1895 | System SW, ICS Group
Shakthi Kannan wrote:
> Greetings!
>
> I am using u-boot-1.1.2 with CodeSourcery's 3.4.3
> cross-toolchain for ARM on the Versatile PB-ARM926EJ-S
> board.
>
> u-boot compiles fine. The hello_world.c in examples/
> compiles fine. From the given example, I have removed
> all statements except the printf statement. It
> compiles fine.
>
> I load it address 04000000 (SDRAM on board, top bank).
> I execute it using "go 04000000", it runs and exits
> with rc=0x0. But, I don't see the printf string being
> printed. Only one character gets printed. I am
> wondering if printf uses \r after every character gets
> printed, so it basically overwrites.
>
> I am able to display a character, using putc(). getc()
> also works fine. These work if I load it a SDRAM
> address, say, 0x05000000, and give the entry point as
> 05000000 itself (go 05000000). But, the documentation
> mentions offset 0x4 as entry point.
Why not try running with the offset - works for me.
> I'd appreciate any feedback on what I am doing wrong
> and how I can get the printf working.
Assuming you compiled with -g, take a look at hello_world.o for the
generated assembly code. See anything obvious?
$ ppc_405-objdump -S hello_world.o
hello_world.o: file format elf32-powerpc
Disassembly of section .text:
00000000 <hello_world-0x4>:
0: 00 00 7f e8 .long 0x7fe8
00000004 <hello_world>:
int hello_world(int argc, char *argv[])
{
4: 94 21 fe 48 stwu r1,-440(r1)
8: 7c 08 02 a6 mflr r0
c: be c1 01 90 stmw r22,400(r1)
10: 90 01 01 bc stw r0,444(r1)
14: 48 00 00 05 bl 18 <hello_world.c+0x14>
18: 7f c8 02 a6 mflr r30
1c: 80 1e ff e8 lwz r0,-24(r30)
20: 7f c0 f2 14 add r30,r0,r30
DECLARE_GLOBAL_DATA_PTR;
bd_t *bd = gd->bd;
24: 83 9d 00 00 lwz r28,0(r29)
<snip>
> Thanks,
>
> SK
>
> --
> Shakthi Kannan, MS
> Software Engineer, Specsoft (Hexaware Technologies)
> [E]: shakthimaan at yahoo.com [M]: (91) 98407-87007
> [W]: http://www.shakthimaan.com [L]: Chennai, India
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
More information about the U-Boot
mailing list