From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Wozniak Date: Tue, 11 Oct 2005 14:56:40 -0400 Subject: [U-Boot-Users] printf with u-boot-1.1.2 In-Reply-To: <20051011163824.25257.qmail@web30714.mail.mud.yahoo.com> References: <20051011163824.25257.qmail@web30714.mail.mud.yahoo.com> Message-ID: <434C0AE8.2010202@mc.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 : 0: 00 00 7f e8 .long 0x7fe8 00000004 : 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 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) > 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 >