[U-Boot-Users] Testing rewrite of NAND code?

Ladislav Michl ladis at linux-mips.org
Mon Sep 26 17:39:25 CEST 2005


On Mon, Sep 26, 2005 at 04:52:13PM +0200, Mike Rapoport wrote:
> When I tried to write data to the NAND flash using the command
> => nand write.jffs2 400000 200000 400000
> 
> the system hanged right after printing:
> "NAND write: device 0 offset 2097152, size 4194304 ...  4194304 bytes
> written: OK"

This is really strange. Code reads:

i = strncmp(cmd, "read", 4) == 0;       /* 1 = read, 0 = write */
printf("\nNAND %s: device %d offset %u, size %u ... ",
       i ? "read" : "write", nand_curr_device, off, size);
if (i)
	ret = nand_read(nand, off, &size, (u_char *)addr);
else
	ret = nand_write(nand, off, &size, (u_char *)addr);
printf(" %d bytes %s: %s\n", size,
       i ? "read" : "written", ret ? "ERROR" : "OK");
return ret == 0 ? 0 : 1;

So it seems nand_write returned sucessfuly. Could you debug it a bit
more? Perhaps stack corruption?

Thanks,
	ladis




More information about the U-Boot mailing list