挂载DATAFLASH后写入不进的问题,求高人指点
内核启动信息:
。。。
physmap flash device: bank0, name:FLASH0, size:8388608bytes @ 0x10000000
Using command line partition definition
Creating 4 MTD partitions on "FLASH0":
0x00000000-0x00020000 : "boot"
0x00020000-0x00120000 : "kernel"
0x00120000-0x007f0000 : "fs"
0x007f0000-0x00800000 : "parameter"
init_physmap: chip probing count 1
。。。
at91_dataflash: Atmel AT45DB321B detected [spi0] (4325376 bytes)
Creating 1 MTD partitions on "Atmel AT45DB321B":
0x00000000-0x00420000 : "data"。。。
挂载文件系统后:
/]$cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00010000 "boot"
mtd1: 00100000 00010000 "kernel"
mtd2: 006d0000 00010000 "fs"
mtd3: 00010000 00010000 "parameter"
mtd4: 00420000 00001080 "data"
/]$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock2 6976 5008 1968 72% /
none 2048 0 2048 0% /tmp
挂载dataflash:
/]$mount -t jffs2 /dev/mtdblock4 /data
/]$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock2 6976 5016 1960 72% /
none 2048 0 2048 0% /tmp
/dev/mtdblock4 4224 36 4188 1% /data
/]$mount
/dev/mtdblock2 on / type jffs2 (rw)
/proc on /proc type proc (rw)
none on /tmp type tmpfs (rw)
/dev/mtdblock4 on /data type jffs2 (rw)
一些操作:
/]$cp bin/su /data/ ##往DATAFLASH中写一些数据
Node totlen on flash (0xffffffff) != totlen in node ref (0x00000044)
...
...
Node totlen on flash (0xffffffff) != totlen in node ref (0x0000000c)
Node totlen on flash (0xffffffff) != totlen in node ref (0x0000000c)
Node CRC ffffffff != calculated CRC f09e7845 for node at 0015462c
/]$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock2 6976 5016 1960 72% /
none 2048 0 2048 0% /tmp
/dev/mtdblock4 4224 1324 2900 31% /data
卸载后:
/]$umount data/
/]$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock2 6976 5016 1960 72% /
none 2048 0 2048 0% /tmp
再挂载后:
/]$df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock2 6976 5016 1960 72% /
none 2048 0 2048 0% /tmp
/dev/mtdblock4 4224 28 4196 1% /data ##未有刚才写入的那个文件。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
块大小设置对吗?
是什么的块大小,能说清楚些么?
我的:
static struct mtd_partition static_partitions[] =
{
{
name: "data",
offset: 0,
size: MTDPART_SIZ_FULL,
//mask_flags: MTD_WRITEABLE /* read-only */
}
};
我指flash可擦除的块的大小
问题已经解决了,我是在另外一个地方把SPI总线设置成IO口了。
如何解决的,我也碰到一样的问题了!wuhua0904@126.com