gays:
I encounter strange things again on DM355 when using u-boot 1.3.4.
I use the UART boot mode ,and download uboot to ddr, finally found it ran to printf() and not respond anymore.(sometimes reboot and show BOOTME string).
To debug it ,i define a function writing string directly to UART register "u_sendstring(char *s)".
here are some code for debugging printf():
void printf(const char *fmt, ...) //console.c Line402
{
va_list args;
uint i;
char printbuffer[CONFIG_SYS_PBSIZE];
va_start(args, fmt);
/* For this to work, printbuffer must be larger than
* anything we ever want to print.
*/
u_sendstring("printf2\n");
i = vsprintf(printbuffer, fmt, args);
u_sendstring("printf3\n");
va_end(args);
/* Print the string */
puts(printbuffer);
}
here are the output:
DM3xx=>>: DONEprintf2
DM3xx=>>: printf3
DM3xx=>>: U-Boot 2009.03 ( 2010 - 23:14:17)
DM3xx=>>: I2C: ready
DM3xx=>>: DRAM: printf2
DM3xx=>>: printf3
DM3xx=>>: 128printf2
DM3xx=>>: printf3
DM3xx=>>: MB
DM3xx=>>: NAND: board_nand_init end
DM3xx=>>: nand_scan1
DM3xx=>>: nand_scan_ident1
DM3xx=>>: nand_scan_ident2
DM3xx=>>: nand_get_flash_type1
DM3xx=>>: nand_get_flash_type2
DM3xx=>>: nand_get_flash_type4
DM3xx=>>: printf2n BOOTME
DM3xx=>>: BOOTME
DM3xx=>>: BOOTME
DM3xx=>>: BOOTME
///////////////// well, the first strings may output correctly, such as "128","MB". BUT,when it run to nand_scan()->nand_get_flash_type(), it overrun.
static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd, struct nand_chip *chip, int busw, int *maf_id)
{
.......
u_sendstring("nand_get_flash_type4\n");
printk("NAND device: Manufacturer ID:"
" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, dev_id,
nand_manuf_ids[maf_idx].name, type->name);
u_sendstring("nand_get_flash_type5\n");
return type;
}