2013年10月10日星期四

yaffs2 transplant, using write.yaffs2 command alone can not write 77a000 address

Transplant Environment : u-boot-2010.09 linux 3.0 FL2440 development board

yaffs2 kernel partition 1a00000 here

tftp 30800000 rootfs.bin
nand erase 30800000 a100000 800000

transplant yaffs2 file system using the u-boot command can not write write.yaffs2
write.yaffs2 30800000 a100000 77a000 (77a000 the actual size of the file , nandflash is 256M tools mkyaffs2image-256M) this address. ( Note : no error message but there NAND write: device ; 0 offset 0x1a00000, size 0x77a000) the next stop in there

I tried other address , it is possible, but there will be ttempt to write error length data! / n errors.
My nand_write_skip_bad function modified as follows

# if defined (CONFIG_MTD_NAND_YAFFS2)
if (nand-> rw_oob == 1)
{
size_t oobsize = nand-> oobsize;
size_t datasize = nand-> writesize;
int datapages = 0;

if (((* length)% (nand-> oobsize + nand-> writesize))! = 0 )
{
printf ("Attempt to write error length data! / n");
return-EINVAL;
}
datapages = * length / (datasize + oobsize);
* length = datapages * datasize;
left_to_write = * length;
}
# endif

This is the part of the code

tried two tools , one is to provide users of mkyaffs2image-128M
write result Load address: 0x30800000
Loading: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # #
done
Bytes transferred = 7710912 (75a8c0 hex)
nand erase a100000 800000
nand write.yaffs2 30800000 1a00000 75a8c0
NAND write: device 0 offset 0x1a00000, size 0x75b000
Attempt to write error length data! / n 7712768 bytes written: ERROR

Another is FL2440 businesses to provide mkyaffs2image-256M
write result:

Load address: 0x30800000
Loading: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # #
Bytes transferred = 78939744 (77a000 hex)
nand erase a100000 800000
nand write.yaffs2 30800000 1a00000 77a000
NAND write: device 0 offset 0x1a00000, size 0x77a000
( Note: stopped in here, no error message )

hope experienced users who can mind you, pointing maze, then this thanks !

------ Solution ------------------------------------ --------
1, Attempt to write error length data! /
This is because you transfer the file size is Bytes transferred = 7710912 (75a8c0 hex)
And you burning size is NAND write: device 0 offset 0x1a00000, size 0x75b000
page + oob not an integer multiple of , the given
2, will be one of the error corrected , write.yaffs2 30800000 a100000 77a000 phrase if it is an error , it is programmed to try another position , if not being given another location , it is not recognized under the programming size exceeds the size of the flash , or did not handle bad blocks
------ For reference only ------------------------- --------------


Thank you my dear friend , the problem is even being given two case report - this is not the place that bothers me the amount burned the other addresses the same problem
------ For reference only ---------------------------------------

  
Thank you my dear friend , the problem is even being given two case report - this is not the place that bothers me the amount burned the other addresses the same problem  

2 What is the situation , a situation do not have the programming process , there will be
Loading: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
nand erase 30800000 a100000 800000 prompt success is right , flash is indeed more than 128M?
------ For reference only -------------------------------------- -

    
Thank you my dear friend , the problem is even being given two case report - this is not the place that bothers me the amount burned the other addresses the same problem          
  
2 What is the situation , a situation do not have the programming process , there will be   
Loading: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #   
nand erase 30800000 a100000 800000 prompt success is right , flash is indeed more than 128M?  

I am sorry I was not clear . a situation is that I use the 128M programming tool is that the process of two tools I use 256M programming process.
when using 128M uboot will automatically write the byte to fill
(nand write.yaffs2 30800000 1a00000 75a8c0
NAND write: device 0 offset 0x1a00000, size 0x75b000) to see what I wrote is not 75a8c0 size, but uboot will automatically match the byte to the 75b000. This 128M tool is written , but with a 258M file system is created so uboot does not match 77a000

nand erase 30800000 a100000 800000 My tips are successful is 258M of nandflash is K9F2G08

Now, after I put some debugging error location in the nand_write functions provided under this users modify the code
# if defined (CONFIG_MTD_NAND_YAFFS2)
int oldopsmode = 0;

printf ("run to nand_write ..");
printf ("mtd-> rw_oob =% d", mtd-> rw_oob); / / add by yanshifu
if (mtd-> rw_oob == 1)
{
int i = 0;
int datapages = 0;
size_t oobsize = mtd-> oobsize;
size_t datasize = mtd-> writesize;
uint8_t oobtemp [oobsize];
datapages = len / (datasize);

printf ("datapages =% d", datapages); / / add by yanshifu
printf ("oobsize =% d", mtd-> oobsize); / / add by yanshifu

for (i = 0; i <(datapages); i + +)
{
memcpy ((void *) oobtemp, (void *) (buf + datasize * (i + 1)), oobsize);
memmove ((void *) (buf + datasize * (i +1)), (void *) (buf + datasize * (i +1) + oobsize), (datapages-(i +1)) * (datasize) + (datapages-1) * oobsize);
memcpy ((void *) (buf + (datapages) * (datasize + ; oobsize) - oobsize), (void *) (oobtemp), oobsize);
}
}
# endif / * end of add * /

which I added printf print out the message that mtd-> rw_oob = 1 datapages = 3712 oobsize = 64
Now I can do something to tell you , now go look datasheet and this part of the code. hope you have time to glance at , gets advice, after all, this problem has been bothering me for a week hope to learn something and quickly resolved. thank Kazakhstan
------ For reference only ------------------------ ---------------
you mean there are two uboot? A normal , a problem ?
------ For reference only -------------------------------------- -


not be two different tools to create a file system , but the problem I have now found it
------ For reference only ----------- ----------------------------
oob size inconsistency ? ecc different ?

  
  
not be two different tools to create a file system , but I found the problem now friends  
------ For reference only ---------------------------------- -----

    
not be two different tools to create a file system , but I found the problem now friends         

256M tools I use the time to write , but can actually be written in the file system as I do you look at me too much given datapages, which is equal to more than 3000 to loop 3000 times to finish so for a long time so I thought it stopped where no output. put a small dot on the file system can solve this problem, right thank you ha ~

没有评论:

发表评论