QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7673|回复: 18

jffs2不能写的问题

[复制链接]
发表于 2005-6-24 10:40:56 | 显示全部楼层 |阅读模式
我是先在主机上建立映像文件
mkfs.jffs2 -e 0x20000 --pad=0x1e0000 -l -d b -o jffs2.bin
然后直接把映像文件写入到flash中,启动后现在还不能进行写入,难道非要在开发板引导以后再檫除mtd分区写入映像才可以吗?没有网卡所以这样做很麻烦!
提示如下:

*****************************************************
* ARM Monitor v1.2 by Hynix
* CPU = HMS30C7202
* Programmed by Jungjun Kim
* Modify by Byunghwan Jun
* email: [email protected]
*****************************************************
DMA Memory base=0x40700000, end=0x40780000
BUFFER Memory base=0x40780000, end=0x40800000
Linux version 2.6.9-linux-2.6.9-hnx3 ([email protected]) (gcc version
3.4.2) #39 Thu Jun 23 17:30:56 CST 2005
CPU: ARM720T [41807202] revision 2 (ARMv4T)
Machine: Hynix HMS30C7202
Warning: bad configuration page, trying to continue
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists
Kernel command line: console=ttyS2,57600 mem=8M rootfstype=jffs2
root=/dev/mtdblock2 rw
Trying to install chained handler for IRQ16
PID hash table entries: 64 (order: 6, 1024 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 8MB = 8MB total
Memory: 6784KB available (971K code, 240K data, 52K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Linux NoNET1.0 for Linux 2.6
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
Initializing Cryptographic API
h720x Framebuffer driver
h720xfb_init_fbinfo
h720xfb_set_par
RGBT length = 8:8:8:0
RGBT offset = 0:0:0:0
h7202 PS/2 port driver
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at MMIO 0x0 (irq = is a 16550A
ttyS1 at MMIO 0x0 (irq = 9) is a 16550A
ttyS2 at MMIO 0x0 (irq = 10) is a 16550A
ttyS3 at MMIO 0x0 (irq = 11) is a 16550A
Using anticipatory io scheduler
H720x remap virt=c1080000
H720x-MTD probing 16bit FLASH
cmdlinepart partition parsing not available
Using builtin partition table
Creating 3 MTD partitions on "H720X":
0x00000000-0x00040000 : "ARMo"
0x00040000-0x00220000 : "Kernel"
0x00220000-0x00400000 : "Jffs2"
h7202_udc: Hynix HMS30C7202 USB Device Controller (2004-05-21)
mice: PS/2 mouse device common for all mice
atkbd.c: keyboard reset failed on h7202ps2
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 52K
Write of 70 bytes at 0x000dd040 failed. returned -30, retlen 3223895968
Write of 70 bytes at 0x000dd088 failed. returned -30, retlen 3221828160
Write of 70 bytes at 0x000dd0d0 failed. returned -30, retlen 4294967266
Write of 70 bytes at 0x000dd118 failed. returned -30, retlen 3221828160

Welcome to the Erik's uClibc development environment.

(none) login: root
Write of 70 bytes at 0x000dd160 failed. returned -30, retlen 70
Write of 70 bytes at 0x000dd1a8 failed. returned -30, retlen 3221828160
Write of 70 bytes at 0x000dd1f0 failed. returned -30, retlen 4294967266
Write of 70 bytes at 0x000dd238 failed. returned -30, retlen 3221828160
Dec 31 17:00:10 login[19]: root login on `ttyS2'

BusyBox v1.00 (2005.06.15-02:17+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

# ls
# cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "ARMo"
mtd1: 001e0000 00020000 "Kernel"
mtd2: 001e0000 00020000 "Jffs2"
# ls
# mkdir a
Write of 68 bytes at 0x000dd280 failed. returned -30, retlen 3222743552
Write of 68 bytes at 0x000dd2c4 failed. returned -30, retlen 3221828160
mkdir: Cannot create directory `a': Read-only file system
#
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / jffs2 rw,noatime 0 0
proc /proc proc rw,nodiratime 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /tmp tmpfs rw 0 0
#
# cat /etc/fstab
# <file system> <mount pt>     <type>   <options>         <dump> <pass>
/dev/root       /              ext2     rw,noauto         0      1
proc            /proc          proc     defaults          0      0
devpts          /dev/pts       devpts   defaults,gid=5,mode=620   0      0
tmpfs           /tmp           tmpfs    defaults          0      0
 楼主| 发表于 2005-6-29 09:46:35 | 显示全部楼层
没人碰到这种情况吗???
回复

使用道具 举报

 楼主| 发表于 2005-7-5 11:50:04 | 显示全部楼层
已经解决了;))
回复

使用道具 举报

发表于 2005-7-11 14:24:19 | 显示全部楼层
請問能否告訴你是怎樣解決這問題的?

謝謝
回复

使用道具 举报

 楼主| 发表于 2005-7-12 17:42:07 | 显示全部楼层
把提示信息发来,我可以帮你看看;)
回复

使用道具 举报

发表于 2005-7-13 10:43:05 | 显示全部楼层
謝謝你

我是可以讀的

不過讀的時候,「len」第次都是不一樣的,而且會是一些不整齊的數 (非 256/512/1024),而是4096, 44, 8 ,總之就不是整齊的 (間中也會出現1024)


但是寫的時候

nand_write_ecc: to = 0x00028000, len = 68
nand_write_ecc: Attempt to write not page aligned data
Write of 68 bytes at 0x00000280 failed. returned -22, retlen 221828160

不知為何「len」會是68的
我的pagesize是512,blocksize 是 16K

另外也不知為甚麼 retlen 會這麼大的,看來是overflow的問題

謝謝
回复

使用道具 举报

发表于 2005-7-13 16:56:56 | 显示全部楼层
OK!
回复

使用道具 举报

 楼主| 发表于 2005-7-13 18:00:36 | 显示全部楼层
把整个的启动信息贴出来看看!
回复

使用道具 举报

发表于 2005-7-15 14:58:24 | 显示全部楼层
我的是SamSung FS44B0X ,nand flash 是 16M 的 K9F2808
nand flash 的 pagesize 應是512,blocksize 應是 16K


我都nand flash分了四份︰
Block 1 是 192K
Block 2 是 2M-192K
Block 3 是 8M-(2M) = 6M
Block 4 是 16M-(8M) = 8M

我是可以用yaffs來mount的,可以讀寫的,所以我想我的nand flash driver應沒問題的(不過不知對不對)

不過以jffs2來mount,問題就出來了,只能讀,不能寫

jffs2 的 image我是用
「mkfs.jffs2 -l --pagesize=0x200 --eraseblock=0x4000 --pad=0x30000 -d jffs2 -o jffs2.img」來製的

我把那image mount到block 1 (192K) 那裡


以下是error message:



**************************************
*                                       *
*   BIOS for FS44B0 CORE Board V3.30    *
*       Http://www.uCdragon.com         *
*                                       *
***************************************
Nor Flash ID is : 234B00BF
SST39VF1601 Found
Nand Flash ID is 0xEC73, Size = 16M, Status = 0xC0
Build  date : Oct 23 2004--13:57:11
Machine Number is 0
IP address : 192.168.3.100
IP MASK    : 255.255.255.0
IP GATE    : 192.168.3.1
Serial baud : 115,200
Program save in nor flash
Program save address 0x10000
Program run address 0xC300000
Program boot params : root=/dev/rom0 console=ttyS0,115200
CPU clock is 61,000,000Hz
Current date is 2005-7-15 [FRI]
Current time is 14:44:19
\>mrun
Run program from 0xC300000
Set boot params = root=/dev/rom0 console=ttyS0,115200
Uncompressing Linux............................................................... done, booting the kernel.
Linux version 2.4.24-uc0 (root@localhost) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #4 Fri Jul 15 14:46:20 HKT 2005
Processor: Samsung S3C44B0X revision 0
Architecture: S3C44B0X
On node 0 totalpages: 2048
zone(0): 0 pages.
zone(1): 2048 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0 console=ttyS0,115200
Console: colour dummy device 80x30
Calibrating delay loop... 30.31 BogoMIPS
Memory: 8MB = 8MB total
Memory: 5916KB available (1750K code, 309K data, 76K init)
Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 2048 (order: 1, 8192 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (2002081 Richard Gooch ([email protected])
devfs: boot_options: 0x0
NTFS driver v1.1.22 [Flags: R/O]
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
LCD buffer : 0c3c0000
fbcon_setup: No support for fontwidth 8
fbcon_setup: type 0 (aux 0, depth 0) not supported
Console: switching to colour frame buffer device 80x30
err=0
pty: 256 Unix98 ptys configured
ads7843_ts initialized
ttyS%d0 at I/O 0x1d00000 (irq = 3) is a S3C44B0
ttyS%d1 at I/O 0x1d04000 (irq = 2) is a S3C44B0
ne.c:v1.10 9/23/94 Donald Becker ([email protected])
Last modified Nov 1, 2000 by Paul Gortmaker
NE*000 ethercard probe at 0x6000000:NE2000 driver modified by antisle, Http://www.uCdragon.com
00 49 34 00 00 00
eth0: NE2000 found at 0x6000000, using IRQ 24
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 100000-1D8BFF [VIRTUAL 100000-1D8BFF] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
SCSI subsystem driver Revision: 1.00
NAND device: Manufacturer ID: 0xec, Chip ID: 0x73 (Samsung NAND 16MiB 3,3V)
Using static partition definition
Creating 4 MTD partitions on "NAND 16MiB 3,3V":
0x00000000-0x00030000 : "Block1"
mtd: Giving out device 0 to Block1
0x00030000-0x00200000 : "Block2"
mtd: Giving out device 1 to Block2
0x00200000-0x00800000 : "Block3"
mtd: Giving out device 2 to Block3
0x00800000-0x01000000 : "Block4"
mtd: Giving out device 3 to Block4

No NAND device found!!!
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
sl811.c: v0.30 : Sl811 USB Host Controller Alternate Driver
usb.c: new USB bus registered, assigned bus number 1
sl811.c: USB SL811 at a000000,a000001, IRQ 21
hub.c: USB hub found
hub.c: 1 port detected
usb.c: registered new driver hid
hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <[email protected]>
hid-core.c: USB HID support drivers
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
cramfs: wrong magic
FAT: bogus logical sector size 19216
FAT: bogus logical sector size 19216
yaffs: dev is 7936 name is "1f:00"
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 76K
Welcome to
          ____ _  _
         /  __| ||_|                 
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

For further information check:
http://www.uclinux.org/



BusyBox v0.60.5 (2005.07.15-06:52+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

# mount -t jffs2 /dev/mtdblock0 /mnt
mtdblock_open
ok
nand_read_ecc: from = 0x00000000, len = 1024
Reading data from NAND FLASH without ECC is not recommended
nand_read_ecc: from = 0x00000400, len = 4096
nand_read_ecc: from = 0x00001400, len = 4096
nand_read_ecc: from = 0x00002400, len = 4096
nand_read_ecc: from = 0x00003400, len = 3072
nand_read_ecc: from = 0x00004000, len = 1024
nand_read_ecc: from = 0x00008000, len = 1024
nand_read_ecc: from = 0x0000c000, len = 1024
nand_read_ecc: from = 0x00010000, len = 1024
nand_read_ecc: from = 0x00014000, len = 1024
nand_read_ecc: from = 0x00018000, len = 1024
nand_read_ecc: from = 0x0001c000, len = 1024
nand_read_ecc: from = 0x00020000, len = 1024
nand_read_ecc: from = 0x00024000, len = 1024
nand_read_ecc: from = 0x00028000, len = 1024
nand_read_ecc: from = 0x0002c000, len = 1024
nand_read_ecc: from = 0x00000170, len = 44
nand_read_ecc: from = 0x00000100, len = 44
nand_read_ecc: from = 0x00000088, len = 44
nand_read_ecc: from = 0x0000000c, len = 44
nand_read_ecc: from = 0x00000038, len = 68
nand_read_ecc: from = 0x0000007c, len = 12
nand_read_ecc: from = 0x00000038, len = 68
# nand_read_ecc: from = 0x000000b4, len = 68
nand_read_ecc: from = 0x000000f8, len = 8
nand_read_ecc: from = 0x000000b4, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68

#
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / romfs ro 0 0
/proc /proc proc rw 0 0
none /var ramfs rw 0 0
dev/mtdblock0 /mnt jffs2 rw 0 0

#
# cd mnt
# ls
nand_read_ecc: from = 0x000000b4, len = 68
Reading data from NAND FLASH without ECC is not recommended
nand_read_ecc: from = 0x000000b4, len = 68
nand_read_ecc: from = 0x00000038, len = 68
nand_read_ecc: from = 0x00000038, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000012c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68
nand_read_ecc: from = 0x0000019c, len = 68
aa  b   f1  f2    <--------可以讀檔案
#
# ls > c           <--------卻不能寫
nand_writev: to = 0x000001e0, len = 68, count = 1
nand_write_ecc: Attempt to write not page aligned data
Write of 68 bytes at 0x000001e0 failed. returned -22, retlen 201991292
nand_writev: to = 0x00000224, len = 68, count = 1
nand_write_ecc: Attempt to write not page aligned data
Write of 68 bytes at 0x00000224 failed. returned -22, retlen 201991292
c: cannot create (Invalid argument)



BusyBox v0.60.5 (2005.07.15-06:52+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

#


請各大俠幫幫忙,謝謝
回复

使用道具 举报

 楼主| 发表于 2005-7-16 08:13:59 | 显示全部楼层
你可以在启动后,檫除jffs2分区试试!
另外nand好像要ecc的支持,具体的我不太清楚!
同时启动时有 No NAND device found!!!  提示,可能问题在这里,你可以在内核里找到这信息提示的位置,再进行分析!
回复

使用道具 举报

 楼主| 发表于 2005-7-16 08:30:25 | 显示全部楼层
Attempt to write not page aligned data
这个错误信息也要去查查看在nand驱动的什么地方,再来分析!
回复

使用道具 举报

 楼主| 发表于 2005-7-16 08:59:31 | 显示全部楼层
我看了一下K9F2808 的手册,你的檫除尺寸也不对啊,你再去看看!
回复

使用道具 举报

发表于 2005-7-16 11:26:55 | 显示全部楼层
謝謝回覆

這句「No NAND device found!!! 」應是指沒有插Smart Media Card的,因為我那個板有那個插槽。所以這句應沒關係的

我試過用eraseall,是真的可以檫除整個block

另外,我就是不明白那裡可以設定檫除尺寸的(應該說除了製造image的時候,不知道是否該在uClinux那裡設定 pagesize and earsesize的)

謝謝
回复

使用道具 举报

 楼主| 发表于 2005-7-16 17:20:28 | 显示全部楼层
檫除尺寸是由flash的特性所决定的;
看看手册先;
回复

使用道具 举报

发表于 2005-7-17 17:05:23 | 显示全部楼层
謝謝

看過 http://www.samsung.com/Products/Semiconductor/Flash/NAND/128Mbit/K9F2808U0B/K9F2808U0B.htm

試過把pagesize改為 528,blocksize改為 16K+512,可是還是同一樣的錯誤訊息

mkfs.jffs2 -l --pagesize=0x200 --eraseblock=0x4000 --pad=0x30000 -d jffs2 -o jffs2.img



我不明白為何會有「Reading data from NAND FLASH without ECC is not recommended」這個錯誤訊息的
請問如來才可以啟動ECC的?

其實除了製jffs2 image的時候要設置pagesize, blocksize,要不要在uClinux 的source那裡也設置的?

謝謝
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-23 15:45 , Processed in 0.065999 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表