Skip to contentSkip to conversation

Problem about "printf"!

U-Boot-Users junping feng 2 participants 2 messages Jul 20, 2005

lore
Share & tools
lore
#0 lore raw

My uboot can run now! Through serial,prompt"=>"can be printed,but after input"help",it don't display commands of uboot.
It seems as if uboot can't find the standard input and output devices.
It display below:

......
DRAM: 16 MB
FLASH: 16 MB
*** Warning - bad CRC, using default environment
=>

I find that function "printf" (in the /common/console.c) can't execute. WHY? Please give me a hand! Thanks!
As below:

#ifndef CFG_CONSOLE_INFO_QUIET
/* Print informations */
printf ("In: ");
if (stdio_devices[stdin] == NULL) {
printf ("No input devices available!\n");
} else {
printf ("%s\n", stdio_devices[stdin]->name);
}

printf ("Out: ");
if (stdio_devices[stdout] == NULL) {
printf ("No output devices available!\n");
} else {
printf ("%s\n", stdio_devices[stdout]->name);
}

printf ("Err: ");
if (stdio_devices[stderr] == NULL) {
printf ("No error devices available!\n");
} else {
printf ("%s\n", stdio_devices[stderr]->name);
}
#endif /* CFG_CONSOLE_INFO_QUIET */

___________________________________________________________
????G???????????????????
http://cn.mail.yahoo.com/?id=77071

#1 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

My uboot can run now! Through serial,prompt"=>"can be printed,but after input"help",it don't display commands of uboot.

Does it work ith any command at all? For example, does the board reset when you ype "reset" ?

Quoted 2 lines

It seems as if uboot can't find the standard input and output devices.

What makes you think so?

Quoted 11 lines

It display below:

......
DRAM: 16 MB
FLASH: 16 MB
*** Warning - bad CRC, using default environment
=>

I find that function "printf" (in the /common/console.c) can't execute. WHY? Please give me

What makes you think so?

Quoted 18 lines

As below:

#ifndef CFG_CONSOLE_INFO_QUIET
/* Print informations */
printf ("In: ");
if (stdio_devices[stdin] == NULL) {
printf ("No input devices available!\n");
} else {
printf ("%s\n", stdio_devices[stdin]->name);
}

printf ("Out: ");
if (stdio_devices[stdout] == NULL) {
printf ("No output devices available!\n");
} else {
printf ("%s\n", stdio_devices[stdout]->name);
}

Quoted 7 lines

printf ("Err: ");
if (stdio_devices[stderr] == NULL) {
printf ("No error devices available!\n");
} else {
printf ("%s\n", stdio_devices[stderr]->name);
}
#endif /* CFG_CONSOLE_INFO_QUIET */

I don't see any of the "No ??? devices available!" error messages in your display, so I don't understand why you think this should be a problem?

Which board is this on? And which version of U-Boot?

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Madness has no purpose.  Or reason.  But it may have a goal.
	-- Spock, "The Alternative Factor", stardate 3088.7