* Writing JFFS2 image to Nand flash
@ 2002-04-12 10:02 John Hall
2002-04-12 12:47 ` Elizabeth Clarke
0 siblings, 1 reply; 12+ messages in thread
From: John Hall @ 2002-04-12 10:02 UTC (permalink / raw)
To: Linux MTD list (E-mail)
Hi,
I'm having problems writing a JFFS2 image to a Nand flash device whose
first block is bad. cp and dd fail in this case. Do I need to write a
utility that checks for bad blocks and skips them, or am I missing
something?
Regards,
John Hall
--
OptionExist Limited.
The Irwin Centre, Scotland Road, Dry Drayton, Cambridge.
Tel: +44 (0)1954 211244, Fax: +44 (0)1954 211565
http://www.optionexist.co.uk/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
2002-04-12 10:02 John Hall
@ 2002-04-12 12:47 ` Elizabeth Clarke
0 siblings, 0 replies; 12+ messages in thread
From: Elizabeth Clarke @ 2002-04-12 12:47 UTC (permalink / raw)
To: Linux MTD list (E-mail)
John Hall wrote:
> I'm having problems writing a JFFS2 image to a Nand flash device whose
> first block is bad. cp and dd fail in this case. Do I need to write a
> utility that checks for bad blocks and skips them, or am I missing
> something?
What messages is it giving? debug enabled? are you using the JFFS2 code
from the jffs2_nand_branch code from cvs?
Beth
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
@ 2002-04-12 13:09 John Hall
2002-04-12 13:20 ` Elizabeth Clarke
0 siblings, 1 reply; 12+ messages in thread
From: John Hall @ 2002-04-12 13:09 UTC (permalink / raw)
To: Linux MTD list (E-mail); +Cc: eclarke
Elizabeth Clarke <eclarke@aminocom.com> wrote:
> > I'm having problems writing a JFFS2 image to a Nand flash device
> > whose first block is bad. cp and dd fail in this case. Do I need to
> > write a utility that checks for bad blocks and skips them, or am I
> > missing something?
>
> What messages is it giving? debug enabled? are you using the JFFS2
> code from the jffs2_nand_branch code from cvs?
>From my understanding, mkfs.jffs2 creates a JFFS2 image without any
reference to the device that is being targeted (with the possible
exception of specifying an erase size if the erase size is bigger than
64K). This image should then be written to the device with cp or dd.
However, if I have bad blocks on the device then dd fails.
This is an example of the erase finding that the first block is bad:
root@board:/tmp# eraseall /dev/mtd/0
Erasing nand_erase: attempt to erase a bad block at page
0x00000000
8 Kibyte @ 0 -- 0 % complete.
eraseall: /dev/mtd/0: MTD Erase failure: Input/output error
Erased 8192 Kibyte @ 0 -- 100% complete.
Then create a jffs2 image:
root@board:/tmp# mkfs.jffs2 -d /tmp/files -o /tmp/img
Then write it:
root@board:/tmp# dd if=/tmp/img of=/dev/mtd/0
dd: writing `/dev/mtd/0': Input/output error
0+1 records in
0+0 records out
I'm not using the jffs2_nand_branch - I had not realised there was one.
I have the latest CVS code from the trunk. What changes are there to
support nand flash - is it just limiting the number of writes to a page,
or are there other things?
I will switch to the nand branch and try that.
Regards,
John Hall
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
2002-04-12 13:09 John Hall
@ 2002-04-12 13:20 ` Elizabeth Clarke
0 siblings, 0 replies; 12+ messages in thread
From: Elizabeth Clarke @ 2002-04-12 13:20 UTC (permalink / raw)
To: Linux MTD list (E-mail)
John Hall wrote:
> This image should then be written to the device with cp or dd.
> However, if I have bad blocks on the device then dd fails.
Not sure about dd, I've just been using cp. But the main issue...
> I'm not using the jffs2_nand_branch - I had not realised there was one.
...is that. Get that branch and it should work. At least, it works here
:)
> I have the latest CVS code from the trunk. What changes are there to
> support nand flash - is it just limiting the number of writes to a page,
> or are there other things?
Lots of things!
Beth
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
@ 2002-04-15 13:42 John Hall
2002-04-15 14:06 ` Elizabeth Clarke
2002-04-15 14:18 ` Tino Keitel
0 siblings, 2 replies; 12+ messages in thread
From: John Hall @ 2002-04-15 13:42 UTC (permalink / raw)
To: Linux MTD list (E-mail)
> > This image should then be written to the device with cp or dd.
> > However, if I have bad blocks on the device then dd fails.
>
> Not sure about dd, I've just been using cp. But the main issue...
Even with the correct branch of JFFS2, I think this problem will still
exist. Using cp or dd to write the initial filesystem image takes no
account of bad blocks near the beginning of the NAND flash.
> > I'm not using the jffs2_nand_branch - I had not realised there was
> > one.
>
> ...is that. Get that branch and it should work. At least, it works
> here :)
OK, I've got the jffs2-nand-branch of fs/jffs2/* and
include/linux/jffs2*. I found that this branch doesn't use the shared
zlib, so I've worked around that. However, I still get these errors
when compiling the kernel:
fs/fs.o: In function `jffs2_check_nand_cleanmarker':
fs/fs.o(.text+0x6040c): undefined reference to `jffs2_flash_read_oob'
fs/fs.o: In function `jffs2_write_nand_cleanmarker':
fs/fs.o(.text+0x60520): undefined reference to `jffs2_flash_write_oob'
Where are these two functions defined?
Regards,
John Hall
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
2002-04-15 13:42 Writing JFFS2 image to Nand flash John Hall
@ 2002-04-15 14:06 ` Elizabeth Clarke
2002-04-15 14:18 ` Tino Keitel
1 sibling, 0 replies; 12+ messages in thread
From: Elizabeth Clarke @ 2002-04-15 14:06 UTC (permalink / raw)
To: John Hall; +Cc: Linux MTD list (E-mail)
John Hall wrote:
> fs/fs.o: In function `jffs2_check_nand_cleanmarker':
> fs/fs.o(.text+0x6040c): undefined reference to `jffs2_flash_read_oob'
> fs/fs.o: In function `jffs2_write_nand_cleanmarker':
> fs/fs.o(.text+0x60520): undefined reference to `jffs2_flash_write_oob'
> Where are these two functions defined?
You should find a grep has them in wbuf.c. Are you setting
CONFIG_JFFS2_FS_NAND?
Beth
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
2002-04-15 13:42 Writing JFFS2 image to Nand flash John Hall
2002-04-15 14:06 ` Elizabeth Clarke
@ 2002-04-15 14:18 ` Tino Keitel
1 sibling, 0 replies; 12+ messages in thread
From: Tino Keitel @ 2002-04-15 14:18 UTC (permalink / raw)
To: linux-mtd
On Mon, Apr 15, 2002 at 14:42:39 +0100, John Hall wrote:
> > > This image should then be written to the device with cp or dd.
> > > However, if I have bad blocks on the device then dd fails.
> >
> > Not sure about dd, I've just been using cp. But the main issue...
>
> Even with the correct branch of JFFS2, I think this problem will still
> exist. Using cp or dd to write the initial filesystem image takes no
> account of bad blocks near the beginning of the NAND flash.
What about the seek option of dd?
Regards,
Tino
--
tino.keitel@innominate.com
dipl.-inf. Innominate Security Technologies AG
software engineer networking people
tel: +49.30.6392-3308 http://www.innominate.com/
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: Writing JFFS2 image to Nand flash
@ 2002-04-15 14:23 John Hall
0 siblings, 0 replies; 12+ messages in thread
From: John Hall @ 2002-04-15 14:23 UTC (permalink / raw)
To: Tino Keitel; +Cc: Linux MTD list (E-mail)
On 15 April 2002 14:51 Tino Keitel <tino.keitel@innominate.com> wrote:
> > > > This image should then be written to the device with cp or dd.
> > > > However, if I have bad blocks on the device then dd fails.
> > >
> > > Not sure about dd, I've just been using cp. But the main issue...
> >
> > Even with the correct branch of JFFS2, I think this problem will
> > still exist. Using cp or dd to write the initial filesystem image
> > takes no account of bad blocks near the beginning of the NAND flash.
>
> What about the seek option of dd?
That's is how I have got around it, but it involves knowing where the
bad blocks are. What if the first and third blocks are bad? I think a
utility is needed that recognises bad blocks and skips them when writing
a filesystem image to a blank device.
Regards,
John Hall
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: Writing JFFS2 image to Nand flash
@ 2002-04-15 14:37 John Hall
2002-04-15 15:18 ` Elizabeth Clarke
0 siblings, 1 reply; 12+ messages in thread
From: John Hall @ 2002-04-15 14:37 UTC (permalink / raw)
To: Elizabeth Clarke; +Cc: Linux MTD list (E-mail)
On 15 April 2002 15:06 Elizabeth Clarke <eclarke@aminocom.com> wrote:
> > fs/fs.o: In function `jffs2_check_nand_cleanmarker':
> > fs/fs.o(.text+0x6040c): undefined reference to
> > `jffs2_flash_read_oob'
> > fs/fs.o: In function `jffs2_write_nand_cleanmarker':
> > fs/fs.o(.text+0x60520): undefined reference to
> > `jffs2_flash_write_oob'
> > Where are these two functions defined?
>
> You should find a grep has them in wbuf.c. Are you setting
> CONFIG_JFFS2_FS_NAND?
Yes, CONFIG_JFFS2_FS_NAND is set. wbuf.c doesn't contain these
functions. I had grepped fs/jffs2/*.[ch] for them.
This is the version of wbuf.c that I have:
[john@morgan jffs2]$ cvs stat wbuf.c
===================================================================
File: wbuf.c Status: Up-to-date
Working revision: 1.1.2.2
Repository revision: 1.1.2.2 /home/cvs/mtd/fs/jffs2/wbuf.c,v
Sticky Tag: jffs2-nand-branch (branch: 1.1.2)
Sticky Date: (none)
Sticky Options: (none)
Regards,
John Hall
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
2002-04-15 14:37 John Hall
@ 2002-04-15 15:18 ` Elizabeth Clarke
2002-04-15 16:02 ` David Woodhouse
0 siblings, 1 reply; 12+ messages in thread
From: Elizabeth Clarke @ 2002-04-15 15:18 UTC (permalink / raw)
To: John Hall; +Cc: Linux MTD list (E-mail)
John Hall wrote:
> > You should find a grep has them in wbuf.c. Are you setting
> > CONFIG_JFFS2_FS_NAND?
> Yes, CONFIG_JFFS2_FS_NAND is set. wbuf.c doesn't contain these
> functions. I had grepped fs/jffs2/*.[ch] for them.
Doh, helps if I read whats actually there. jffs2_flash_read_oob is a
define in
os-linux.h.
> This is the version of wbuf.c that I have:
> [john@morgan jffs2]$ cvs stat wbuf.c
> ===================================================================
> File: wbuf.c Status: Up-to-date
>
> Working revision: 1.1.2.2
> Repository revision: 1.1.2.2 /home/cvs/mtd/fs/jffs2/wbuf.c,v
> Sticky Tag: jffs2-nand-branch (branch: 1.1.2)
Interesting. Mine says revision 1.10. hmmm puzzled.
I think I'd prompt dwmw2 for some words of wisdom....
Beth
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
2002-04-15 15:18 ` Elizabeth Clarke
@ 2002-04-15 16:02 ` David Woodhouse
2002-04-15 16:05 ` Elizabeth Clarke
0 siblings, 1 reply; 12+ messages in thread
From: David Woodhouse @ 2002-04-15 16:02 UTC (permalink / raw)
To: Elizabeth Clarke; +Cc: John Hall, Linux MTD list (E-mail)
eclarke@aminocom.com said:
> Interesting. Mine says revision 1.10. hmmm puzzled. I think I'd
> prompt dwmw2 for some words of wisdom.... Beth
Er, didn't we abolish the jffs2_nand_branch and pull the latest code onto
the trunk?
--
dwmw2
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Writing JFFS2 image to Nand flash
2002-04-15 16:02 ` David Woodhouse
@ 2002-04-15 16:05 ` Elizabeth Clarke
0 siblings, 0 replies; 12+ messages in thread
From: Elizabeth Clarke @ 2002-04-15 16:05 UTC (permalink / raw)
To: David Woodhouse; +Cc: John Hall, Linux MTD list (E-mail)
David Woodhouse wrote:
>
> eclarke@aminocom.com said:
> > Interesting. Mine says revision 1.10. hmmm puzzled. I think I'd
> > prompt dwmw2 for some words of wisdom.... Beth
>
> Er, didn't we abolish the jffs2_nand_branch and pull the latest code onto
> the trunk?
That might explain why I'm puzzled! Did you do this when I was otherwise
engaged? If we did, then you did it :)
Beth
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2002-04-15 16:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-15 13:42 Writing JFFS2 image to Nand flash John Hall
2002-04-15 14:06 ` Elizabeth Clarke
2002-04-15 14:18 ` Tino Keitel
-- strict thread matches above, loose matches on Subject: below --
2002-04-15 14:37 John Hall
2002-04-15 15:18 ` Elizabeth Clarke
2002-04-15 16:02 ` David Woodhouse
2002-04-15 16:05 ` Elizabeth Clarke
2002-04-15 14:23 John Hall
2002-04-12 13:09 John Hall
2002-04-12 13:20 ` Elizabeth Clarke
2002-04-12 10:02 John Hall
2002-04-12 12:47 ` Elizabeth Clarke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox