uboot解决flash failed无限挂起的问题
追踪flash failed的问题在于board.c中的一段代码:
#if !defined(CONFIG_SYS_NO_FLASH) puts ("Flash: "); if ((flash_size = flash_init ()) > 0) { # ifdef CONFIG_SYS_FLASH_CHECKSUM print_size (flash_size, ""); /* * Compute and print flash CRC if flashchecksum is set to 'y' * * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX */ s = getenv ("flashchecksum"); if (s && (*s == 'y')) { printf (" CRC: %08X", crc32 (0, (const unsigned char *) CONFIG_SYS_FLASH_BASE, flash_size) ); } putc ('/n'); # else /* !CONFIG_SYS_FLASH_CHECKSUM */ print_size (flash_size, "/n"); # endif /* CONFIG_SYS_FLASH_CHECKSUM */ } else { puts (failed); hang (); //无限挂起的根源
} #endif
然后定位hang()
void hang(void) { puts("### ERROR ### Please RESET the board ###\n"); for(;;); //循环挂起的语句
}
因为本人的板子并无flash,只有ELC的2G NAND flash芯片,所以屏蔽此处的挂起函数。
即可按需执行下去:
最新版的nand驱动做得非常好了,连nand flash都正确识别了
然后问题来了:
板子所带的网卡为DM9000,下面移植DM9000的网卡驱动程序……