Hi all,
I got the following errors whenever I try to write to my flash which is
jffs2 (my root is initramfs):
[ 39.220000] physmap-flash.0: Chip not ready for buffer write. Xstatus =
0, status = 0
[ 39.240000] Write of 68 bytes at 0x0076000c failed. returned -62,
retlen 0
[ 39.240000] Not marking the space at 0x0076000c as dirty because the
flash driver returned retlen zero
[ 40.260000] physmap-flash.0: Waiting for chip to be ready timed out.
Status 0
[ 40.260000] Write of 68 bytes at 0x0076000c failed. returned -5, retlen
0
[ 40.280000] Not marking the space at 0x0076000c as dirty because the
flash driver returned retlen zero
At the start of my system, I mounted my flash using:
mount -t jffs2 -o sync -o exec -o noatime /dev/mtdblock3 /mnt/flash
Then, I start my own application in which the write will happen. And,
here is the part of my code that does such:
int fd = open("/mnt/flash/savedData",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
int writeSize = write(fd, &MyData, data_size);
close(fd);
and that is where the error shows up.
And, I have also try to call "cp" instead of open a file directly:
fd = open("tmpFile",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
if(fork()==0){
/* In child proc..*/
if( 0 > execlp("cp","cp","-f","tmpFile","/mnt/flash/savedData",NULL) )
perror(execlp);
}
and the same errors occurred.
The following is part of what the kernel print out when the system was
starting up:
[ 3.470000] RedBoot partition parsing not available
[ 3.470000] Using physmap partition information
[ 3.480000] Creating 4 MTD partitions on "physmap-flash.0":
[ 3.480000] 0x00000000-0x00040000 : "bootloader"
[ 3.490000] mtd: Giving out device 0 to bootloader
[ 3.490000] rfd_ftl: no RFD magic found in 'bootloader'
[ 3.500000] 0x00040000-0x00060000 : "params"
[ 3.500000] mtd: Giving out device 1 to params
[ 3.510000] 0x00060000-0x00860000 : "kernel"
[ 3.520000] mtd: Giving out device 2 to kernel
[ 3.550000] rfd_ftl: no RFD magic found in 'kernel'
[ 3.560000] 0x00860000-0x01000000 : "filesystem"
[ 3.570000] mtd: Giving out device 3 to filesystem
[ 3.600000] rfd_ftl: no RFD magic found in 'filesystem'
[ 3.610000] kobject_add failed for physmap-flash.0 with -EEXIST, don't
try to register things with the same name in the same directory.
[ 3.620000] Generic platform RAM MTD, (c) 2004 Simtec Electronics
At first I thourgh my flash block was not format correctly. so, I did:
flash_eraseall -j /dev/mtd3
and, that did not help at all.
Here are my questions:
1. What are those errors mean? and how do I go about solving them?
2. Can the kernel work with multiple file system at the same time, like
initramfs and jffs2 in my case?
3. It works when I using "cp" on the command prompt to copy file from
/opt to /mnt/flash. But, why not in execlp();? Are there something I
missed on this? Something wrong with the way I use fork() maybe?
4. What are those "no RFD magic found in xxx" about? I tried to fix it
with "flash_eraseall -j", it didn't help.
5. What is the "kobject_add failed" about? if I have my "CFI Flash
device in physical memory map" disabled in my "make menuconfig", my
flash will not able to mount on my system. What should I do about that?
Thanks in advance.
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source