This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UBI只能挂载一次(AM3359)

Other Parts Discussed in Thread: AM3359, AM3517, AM3505

Hi,TI 专家

我们现在自己了块AM3359的板子,现在用的FLSAH 是K9F1G08U0C,我参照TI提供的文档通过tftp烧写内核和文件系统,ECC使用的是BCH8。烧写文件系统完后,系统只能正常启动一起,随后重新上电启动, ubi系统便不能正确加载。我发现K9F1G08是1bit的ECC,因此不能用BCH8,我有两个问题:

1、AM3359-EVM主要支持的Nandflash有哪些型号。

2、如果我要用K9F1G08,该如何烧写内核和ubi文件系统,是否需要修改驱动。

请专家指导下,很急。谢谢。

  • 没人么,难道这个论坛都没人么?

  • 您好,因为这个论坛是我们FAE在做支持,平时大家会在外面客户处做支持,很少在办公室,通常下午或晚上回来再回贴。我尽量给您问一下,尽快回复。谢谢理解!

  • hi

    关于问题1:我们的AM335x芯片可以支持onfi和非onfi两种模式的nand,基本覆盖市面上大部分nand型号。你可以参考芯片spec(TRM)的Initialization那一章中的nand boot那一部分,有详细的说明。

    关于问题2:如果你的NAND只支持1bit ECC,那么你用u-boot烧写内核和文件系统的时候,就要选择1 bitECC 的烧写方式

  • 楼主问题解决了吗,我现在也遇到一样的问题,如果已经解决了那说下方法非常感谢

  • 你在UBIFS的时候用的mkfs.ubifs工具是多少版本的?mkfs.ubifs 1.5.0以下的好像不支持 -F 参数,做出来的ubi.img有问题,只能启动一次,启动后报ubi_io_read err ,ecc error之类的错,然后第二次ubifs损坏就无法启动了。

    如果是这样升级mtd-utils试试

  • 没有用到-F参数,我是用这个命令mkfs.ubifs -r rootfs  -m 2048  -e 129024  -c 812   -o ubifs.img生成镜像的,哥们你们怎么生成镜像的,移植是怎么操作的?谢谢

  • am335x  要用-F 参数,

    另注意的是烧写长度要比image 长些,而且要按block对齐。

     

     

  • 按block对齐是什么意思

  • 哥们我用了1.5.0版本的还是不行

  • http://processors.wiki.ti.com/index.php/UBIFS_Support#Creating_UBIFS_file_system

     

    Assuming

    1. NAND partition to be erased starts from "0x780000",
    2. NAND partition of size "0xF880000" and
    3. File system image size to be flashed is 0xFC0000 which is upward aligned to NAND block size
     
     u-boot# nand erase 0x780000 0xF880000
     u-boot# nand write 0x82000000 0x780000 0xFC0000
    
  • 我用的是AM3517,内核是2.6.37,我用uboot烧写文件系统,烧写好后启动没有问题,但是之后的启动就都不行了,不过重新烧写文件系统又可以了,但只能成功一次,也就是每次启动都要重新烧写文件系统才行。
    boot烧写UBI操作命令如下:
    一:mtdpart default
    二:nand erase root
    三:ubi part root
    四: ubi create rootfs-nand
    五:fatload usb 0:1 0x82000000 ubifs.img 0x2293800
    六:ubi write 0x82000000 rootfs-nand 0x2293800 帮我看看那里有问题

  • 0x2293800  是按nand flash 对齐的吗?

    改成0x2300000 再试下

  • 0x2293800是文件的大小,我把它改为0xf880000 结果还是一样,郁闷了 搞了很久了

  • 第一次启动之后是不是有报错?第二次不能启动死在哪里?可以贴这两次启动log看看。

  • 第一次启动没有报错,

    第二次就不能正常启动了

    以下是不正常的LOG

    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Linux version 2.6.37 (luheng@luheng) (gcc version 4.3.3

    (Sourcery G++ Lite 2009q1-203) ) #121 Thu Jan 3 16:40:17 CST 2013
    [    0.000000] CPU: ARMv7 Processor [411fc087] revision 7 (ARMv7),

    cr=10c53c7f
    [    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing

    instruction cache
    [    0.000000] Machine: AM3505 3I_BOARD
    [    0.000000] Reserving 4194304 bytes SDRAM for VRAM
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] AM3505 ES1.1 (l2cache iva neon isp )
    [    0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total

    pages: 64000
    [    0.000000] Kernel command line: console=ttyO2,115200n8 ubi.mtd=4

    root=ubi0:rootfs-nand rw rootfstype=ubifs
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072

    bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 252MB = 252MB total
    [    0.000000] Memory: 243292k/243292k available, 18852k reserved, 0K

    highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xf8000000   ( 632 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .init : 0xc0008000 - 0xc0093000   ( 556 kB)
    [    0.000000]       .text : 0xc0093000 - 0xc04f332c   (4481 kB)
    [    0.000000]       .data : 0xc04f4000 - 0xc069a460   (1690 kB)
    [    0.000000] NR_IRQS:375
    [    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/600 MHz
    [    0.000000] omap_hwmod: i2c1: softreset failed (waited 10000 usec)
    [    0.000000] omap_hwmod: i2c2: softreset failed (waited 10000 usec)
    [    0.000000] omap_hwmod: i2c3: softreset failed (waited 10000 usec)
    [    0.000000] Reprogramming SDRC clock to 332000000 Hz
    [    0.000000] dpll3_m2_clk rate change failed: -22
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96

    interrupts
    [    0.000000] Total of 96 interrupts on 1 active controller
    [    0.000000] GPMC revision 5.0
    [    0.000000] Trying to install interrupt handler for IRQ368
    [    0.000000] Trying to install interrupt handler for IRQ369
    [    0.000000] Trying to install interrupt handler for IRQ370
    [    0.000000] Trying to install interrupt handler for IRQ371
    [    0.000000] Trying to install interrupt handler for IRQ372
    [    0.000000] Trying to install interrupt handler for IRQ373
    [    0.000000] Trying to install interrupt handler for IRQ374
    [    0.000000] Trying to install type control for IRQ375
    [    0.000000] Trying to set irq flags for IRQ375
    [    0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz
    [    0.000000] Console: colour dummy device 80x30
    [    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc.,

    Ingo Molnar
    [    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8
    [    0.000000] ... MAX_LOCK_DEPTH:          48
    [    0.000000] ... MAX_LOCKDEP_KEYS:        8191
    [    0.000000] ... CLASSHASH_SIZE:          4096
    [    0.000000] ... MAX_LOCKDEP_ENTRIES:     16384
    [    0.000000] ... MAX_LOCKDEP_CHAINS:      32768
    [    0.000000] ... CHAINHASH_SIZE:          16384
    [    0.000000]  memory used by lock dependency info: 3951 kB
    [    0.000000]  per task-struct memory footprint: 2304 bytes
    [    0.000000] Calibrating delay loop... 601.84 BogoMIPS (lpj=2351104)
    [    0.000000] pid_max: default: 32768 minimum: 301
    [    0.000000] Security Framework initialized
    [    0.000000] Mount-cache hash table entries: 512
    [    0.000000] CPU: Testing write buffer coherency: ok
    [    0.000000] regulator: core version 0.5
    [    0.000000] regulator: dummy:
    [    0.000000] NET: Registered protocol family 16
    [    0.000000] ------------[ cut here ]------------
    [    0.000000] WARNING: at arch/arm/mach-omap2/pm.c:94

    _init_omap_device+0x84/0xa4()
    [    0.000000] _init_omap_device: could not find omap_hwmod for iva
    [    0.000000] Modules linked in:
    [    0.000000] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c00c76a4>]

    (warn_slowpath_common+0x4c/0x64)
    [    0.000000] [<c00c76a4>] (warn_slowpath_common+0x4c/0x64) from

    [<c00c773c>] (warn_slowpath_fmt+0x2c/0x3c)
    [    0.000000] [<c00c773c>] (warn_slowpath_fmt+0x2c/0x3c) from [<c00aad54>]

    (_init_omap_device+0x84/0xa4)
    [    0.000000] [<c00aad54>] (_init_omap_device+0x84/0xa4) from [<c000fda8>]

    (omap2_common_pm_init+0x2c/0x10c)
    [    0.000000] [<c000fda8>] (omap2_common_pm_init+0x2c/0x10c) from

    [<c00933b8>] (do_one_initcall+0xc8/0x1a0)
    [    0.000000] [<c00933b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>]

    (kernel_init+0x94/0x14c)
    [    0.000000] [<c0008690>] (kernel_init+0x94/0x14c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    0.000000] ---[ end trace 1b75b31a2719ed1c ]---
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] omap_mux_init: Add partition: #1: core, flags: 0
    [    0.000000] Display initialized successfully
    [    0.000000] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.000000] OMAP DMA hardware revision 4.0
    [    0.059600] bio: create slab <bio-0> at 0
    [    0.068420] SCSI subsystem initialized
    [    0.073669] usbcore: registered new interface driver usbfs
    [    0.075500] usbcore: registered new interface driver hub
    [    0.076904] usbcore: registered new device driver usb
    [    0.081848] omap_device: omap_i2c.1: new worst case activate latency 0:

    30517
    [    0.091522] omap_i2c omap_i2c.1: bus 1 rev3.12 at 400 kHz
    [    0.095275] omap_device: omap_i2c.1: new worst case deactivate latency 0:

    30517
    [    0.102325] Switching to clocksource 32k_counter
    [    0.256225] musb-hdrc: version 6.0, otg (peripheral+host), debug=0
    [    0.256805] musb-hdrc musb-hdrc.0: dma type: dma-cppi41
    [    0.258331] <6>Waiting for PHY clock good...
    [    0.276733] musb-hdrc musb-hdrc.0: USB OTG mode controller at d0810000

    using DMA, IRQ 71
    [    0.278839] NET: Registered protocol family 2
    [    0.279541] IP route cache hash table entries: 2048 (order: 1, 8192

    bytes)
    [    0.281494] TCP established hash table entries: 8192 (order: 4, 65536

    bytes)
    [    0.282012] TCP bind hash table entries: 8192 (order: 6, 360448 bytes)
    [    0.286987] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.287078] TCP reno registered
    [    0.287139] UDP hash table entries: 128 (order: 1, 12288 bytes)
    [    0.287475] UDP-Lite hash table entries: 128 (order: 1, 12288 bytes)
    [    0.288726] NET: Registered protocol family 1
    [    0.290161] NetWinder Floating Point Emulator V0.97 (double precision)
    [    0.292327] omap_init_opp_table: no hwmod or odev for iva, [9] cannot add

    OPPs.
    [    0.295379] AM3505  Linux PSP version 04.02.00.07 (AM3517EVM)
    [    0.426971] VFS: Disk quotas dquot_6.5.2
    [    0.427093] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.428649] msgmni has been set to 475
    [    0.434295] io scheduler noop registered
    [    0.434326] io scheduler deadline registered
    [    0.434539] io scheduler cfq registered (default)
    [    0.440490] Generic Backlight Driver Initialized.
    [    0.501251] OMAP DSS rev 2.0
    [    0.501373] omapdss supply vdds_dsi not found, using dummy regulator
    [    0.501892] OMAP DISPC rev 3.0
    [    0.501953] omapdss supply vdda_dac not found, using dummy regulator
    [    0.502136] OMAP VENC rev 2
    [    0.503479] OMAP DSI rev 1.0
    [    0.668060] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    [    0.678344] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP

    UART0
    [    0.680694] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP

    UART1
    [    0.682342] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP

    UART2
    [    1.415924] console [ttyO2] enabled
    [    1.472869] brd: module loaded
    [    1.502136] loop: module loaded
    [    1.506347] usbcore: registered new interface driver ub
    [    1.519470] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.527465] omap2-nand driver initializing
    [    1.532287] nand MFR:0xEC,ID:0xDA
    [    1.535888] NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung )
    [    1.543060] Creating 5 MTD partitions on "omap2-nand.0":
    [    1.548645] 0x000000000000-0x000000080000 : "xloader-nand"
    [    1.565002] 0x000000080000-0x000000240000 : "uboot-nand"
    [    1.578918] 0x000000240000-0x000000280000 : "params-nand"
    [    1.592102] 0x000000280000-0x000000780000 : "linux-nand"
    [    1.607543] 0x000000780000-0x000010000000 : "rootfs-nand"
    [    1.754913] UBI: attaching mtd4 to ubi0
    [    1.759155] UBI: physical eraseblock size:   131072 bytes (128 KiB)
    [    1.765625] UBI: logical eraseblock size:    129024 bytes
    [    1.771301] UBI: smallest flash I/O unit:    2048
    [    1.776214] UBI: sub-page size:              512
    [    1.780975] UBI: VID header offset:          512 (aligned 512)
    [    1.787078] UBI: data offset:                2048
    [    1.794128] UBI error: ubi_io_read: error -74 (ECC error) while reading

    64 bytes from PEB 2:0, read 64 bytes
    [    1.804473] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be868>]

    (ubi_io_read+0x1b4/0x248)
    [    1.813659] [<c02be868>] (ubi_io_read+0x1b4/0x248) from [<c02bee1c>]

    (ubi_io_read_ec_hdr+0x6c/0x338)
    [    1.823242] [<c02bee1c>] (ubi_io_read_ec_hdr+0x6c/0x338) from

    [<c02c24f0>] (ubi_scan+0x1b4/0xb9c)
    [    1.832489] [<c02c24f0>] (ubi_scan+0x1b4/0xb9c) from [<c02b9624>]

    (ubi_attach_mtd_dev+0x680/0xdb8)
    [    1.841888] [<c02b9624>] (ubi_attach_mtd_dev+0x680/0xdb8) from

    [<c0021454>] (ubi_init+0x1c8/0x2dc)
    [    1.851226] [<c0021454>] (ubi_init+0x1c8/0x2dc) from [<c00933b8>]

    (do_one_initcall+0xc8/0x1a0)
    [    1.860229] [<c00933b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>]

    (kernel_init+0x94/0x14c)
    [    1.869384] [<c0008690>] (kernel_init+0x94/0x14c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    1.879058] UBI error: ubi_io_read: error -74 (ECC error) while reading

    512 bytes from PEB 2:512, read 512 bytes
    [    1.889739] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be868>]

    (ubi_io_read+0x1b4/0x248)
    [    1.898895] [<c02be868>] (ubi_io_read+0x1b4/0x248) from [<c02be96c>]

    (ubi_io_read_vid_hdr+0x70/0x4b4)
    [    1.908508] [<c02be96c>] (ubi_io_read_vid_hdr+0x70/0x4b4) from

    [<c02c26dc>] (ubi_scan+0x3a0/0xb9c)
    [    1.917846] [<c02c26dc>] (ubi_scan+0x3a0/0xb9c) from [<c02b9624>]

    (ubi_attach_mtd_dev+0x680/0xdb8)
    [    1.927185] [<c02b9624>] (ubi_attach_mtd_dev+0x680/0xdb8) from

    [<c0021454>] (ubi_init+0x1c8/0x2dc)
    [    1.936523] [<c0021454>] (ubi_init+0x1c8/0x2dc) from [<c00933b8>]

    (do_one_initcall+0xc8/0x1a0)
    [    1.945556] [<c00933b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>]

    (kernel_init+0x94/0x14c)
    [    1.954742] [<c0008690>] (kernel_init+0x94/0x14c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    3.033569] UBI error: ubi_io_read: error -74 (ECC error) while reading

    64 bytes from PEB 1987:0, read 64 bytes
    [    3.044158] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be868>]

    (ubi_io_read+0x1b4/0x248)
    [    3.053344] [<c02be868>] (ubi_io_read+0x1b4/0x248) from [<c02bee1c>]

    (ubi_io_read_ec_hdr+0x6c/0x338)
    [    3.062866] [<c02bee1c>] (ubi_io_read_ec_hdr+0x6c/0x338) from

    [<c02c24f0>] (ubi_scan+0x1b4/0xb9c)
    [    3.072113] [<c02c24f0>] (ubi_scan+0x1b4/0xb9c) from [<c02b9624>]

    (ubi_attach_mtd_dev+0x680/0xdb8)
    [    3.081451] [<c02b9624>] (ubi_attach_mtd_dev+0x680/0xdb8) from

    [<c0021454>] (ubi_init+0x1c8/0x2dc)
    [    3.090789] [<c0021454>] (ubi_init+0x1c8/0x2dc) from [<c00933b8>]

    (do_one_initcall+0xc8/0x1a0)
    [    3.099792] [<c00933b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>]

    (kernel_init+0x94/0x14c)
    [    3.108947] [<c0008690>] (kernel_init+0x94/0x14c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    3.118621] UBI error: ubi_io_read: error -74 (ECC error) while reading

    512 bytes from PEB 1987:512, read 512 bytes
    [    3.129547] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be868>]

    (ubi_io_read+0x1b4/0x248)
    [    3.138763] [<c02be868>] (ubi_io_read+0x1b4/0x248) from [<c02be96c>]

    (ubi_io_read_vid_hdr+0x70/0x4b4)
    [    3.148376] [<c02be96c>] (ubi_io_read_vid_hdr+0x70/0x4b4) from

    [<c02c26dc>] (ubi_scan+0x3a0/0xb9c)
    [    3.157714] [<c02c26dc>] (ubi_scan+0x3a0/0xb9c) from [<c02b9624>]

    (ubi_attach_mtd_dev+0x680/0xdb8)
    [    3.167053] [<c02b9624>] (ubi_attach_mtd_dev+0x680/0xdb8) from

    [<c0021454>] (ubi_init+0x1c8/0x2dc)
    [    3.176391] [<c0021454>] (ubi_init+0x1c8/0x2dc) from [<c00933b8>]

    (do_one_initcall+0xc8/0x1a0)
    [    3.185394] [<c00933b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>]

    (kernel_init+0x94/0x14c)
    [    3.194549] [<c0008690>] (kernel_init+0x94/0x14c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    3.204284] UBI: max. sequence number:       248
    [    3.232635] UBI: attached mtd4 to ubi0
    [    3.236663] UBI: MTD device name:            "rootfs-nand"
    [    3.242370] UBI: MTD device size:            248 MiB
    [    3.247589] UBI: number of good PEBs:        1953
    [    3.252532] UBI: number of bad PEBs:         35
    [    3.257232] UBI: number of corrupted PEBs:   0
    [    3.261932] UBI: max. allowed volumes:       128
    [    3.266784] UBI: wear-leveling threshold:    4096
    [    3.271667] UBI: number of internal volumes: 1
    [    3.276336] UBI: number of user volumes:     1
    [    3.280944] UBI: available PEBs:             0
    [    3.285644] UBI: total number of reserved PEBs: 1953
    [    3.290863] UBI: number of PEBs reserved for bad PEB handling: 19
    [    3.297180] UBI: max/mean erase counter: 4/1
    [    3.301666] UBI: image sequence number:  0
    [    3.307586] UBI: background thread "ubi_bgt0d" started, PID 379
    [    3.317352] UBI error: ubi_io_read: error -74 (ECC error) while reading

    512 bytes from PEB 2:512, read 512 bytes
    [    3.328094] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be868>]

    (ubi_io_read+0x1b4/0x248)
    [    3.337341] [<c02be868>] (ubi_io_read+0x1b4/0x248) from [<c02be96c>]

    (ubi_io_read_vid_hdr+0x70/0x4b4)
    [    3.346954] [<c02be96c>] (ubi_io_read_vid_hdr+0x70/0x4b4) from

    [<c02c0710>] (wear_leveling_worker+0x1c8/0x650)
    [    3.357360] [<c02c0710>] (wear_leveling_worker+0x1c8/0x650) from

    [<c02c0ed8>] (do_work+0xd4/0x114)
    [    3.366729] [<c02c0ed8>] (do_work+0xd4/0x114) from [<c02c0fec>]

    (ubi_thread+0xd4/0x178)
    [    3.375091] [<c02c0fec>] (ubi_thread+0xd4/0x178) from [<c00e24e4>]

    (kthread+0x84/0x8c)
    [    3.383361] [<c00e24e4>] (kthread+0x84/0x8c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    3.430938] UBI error: ubi_io_read: error -74 (ECC error) while reading

    512 bytes from PEB 525:512, read 512 bytes
    [    3.441802] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be868>]

    (ubi_io_read+0x1b4/0x248)
    [    3.450988] [<c02be868>] (ubi_io_read+0x1b4/0x248) from [<c02be96c>]

    (ubi_io_read_vid_hdr+0x70/0x4b4)
    [    3.460601] [<c02be96c>] (ubi_io_read_vid_hdr+0x70/0x4b4) from

    [<c02bcc20>] (ubi_eba_copy_leb+0x394/0x544)
    [    3.470703] [<c02bcc20>] (ubi_eba_copy_leb+0x394/0x544) from [<c02c07b8>]

    (wear_leveling_worker+0x270/0x650)
    [    3.480957] [<c02c07b8>] (wear_leveling_worker+0x270/0x650) from

    [<c02c0ed8>] (do_work+0xd4/0x114)
    [    3.490295] [<c02c0ed8>] (do_work+0xd4/0x114) from [<c02c0fec>]

    (ubi_thread+0xd4/0x178)
    [    3.498657] [<c02c0fec>] (ubi_thread+0xd4/0x178) from [<c00e24e4>]

    (kthread+0x84/0x8c)
    [    3.506927] [<c00e24e4>] (kthread+0x84/0x8c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    3.515869] davinci_mdio davinci_mdio: davinci mdio revision 1.5
    [    3.522216] davinci_mdio davinci_mdio: detected phy mask fffffffd
    [    3.529418] UBI: run torture test for PEB 525
    [    3.595336] davinci_mdio: probed
    [    3.598724] davinci_mdio davinci_mdio: phy[1]: device ffffffff:01, driver

    unknown
    [    3.607116] UBI error: ubi_io_write: error -5 while writing 131072 bytes

    to PEB 525:0, written 88064 bytes
    [    3.617309] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be450>]

    (ubi_io_write+0x194/0x1f8)
    [    3.626586] [<c02be450>] (ubi_io_write+0x194/0x1f8) from [<c02bf4d0>]

    (ubi_io_sync_erase+0x238/0x360)
    [    3.636199] [<c02bf4d0>] (ubi_io_sync_erase+0x238/0x360) from

    [<c02c0124>] (erase_worker+0x78/0x49c)
    [    3.645721] [<c02c0124>] (erase_worker+0x78/0x49c) from [<c02c0ed8>]

    (do_work+0xd4/0x114)
    [    3.654266] [<c02c0ed8>] (do_work+0xd4/0x114) from [<c02c0fec>]

    (ubi_thread+0xd4/0x178)
    [    3.662628] [<c02c0fec>] (ubi_thread+0xd4/0x178) from [<c00e24e4>]

    (kthread+0x84/0x8c)
    [    3.670928] [<c00e24e4>] (kthread+0x84/0x8c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)
    [    3.816040] UBI error: erase_worker: failed to erase PEB 525, error -5
    [    3.822967] UBI: mark PEB 525 as bad
    [    3.827911] vcan: Virtual CAN interface driver
    [    3.832641] CAN device driver interface
    [    3.836639] TI High End CAN Controller Driver 0.7
    [    3.845306] ti_hecc ti_hecc: device registered (reg_base=d0890000,

    irq=24)
    [    3.853546] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    3.861968] usbcore: registered new interface driver uas
    [    3.867492] Initializing USB Mass Storage driver...
    [    3.873565] usbcore: registered new interface driver usb-storage
    [    3.879882] USB Mass Storage support registered.
    [    3.885650] usbcore: registered new interface driver usbtest
    [    3.891723] zero gadget: Gadget Zero, version: Cinco de Mayo 2008
    [    3.898071] zero gadget: zero ready
    [    3.901794] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [    3.909179] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus

    number 1
    [    3.917938] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    3.925109] usb usb1: New USB device strings: Mfr=3, Product=2,

    SerialNumber=1
    [    3.932678] usb usb1: Product: MUSB HDRC host driver
    [    3.937835] usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
    [    3.943511] usb usb1: SerialNumber: musb-hdrc.0
    [    3.953857] hub 1-0:1.0: USB hub found
    [    3.958160] hub 1-0:1.0: 1 port detected
    [    3.971710] input: matrix-keypad as /devices/platform/matrix-

    keypad/input/input0
    [    3.979736] !!!input.c517:input_open_device enter
    [    3.984741] !!!input.c517:input_open_device enter
    [    4.000732] UBI error: ubi_io_mark_bad: cannot mark PEB 525 bad, error -5
    [    4.007873] UBI warning: ubi_ro_mode: switch to read-only mode
    [    4.014007] UBI error: do_work: work failed with error code -5
    [    4.020202] UBI error: ubi_thread: ubi_bgt0d: work failed with error code

    -5
    [    4.028259] !!!input.c517:input_open_device enter
    [    4.034423] led: can't get major number
    [    4.038879] omap_device: omap_i2c.1: new worst case activate latency 0:

    61035
    [    4.049926] bq32k 1-0068: rtc core: registered bq32k as rtc0
    [    4.056854] i2c /dev entries driver
    [    4.066162] omap_device: omap_wdt.-1: new worst case activate latency 0:

    30517
    [    4.075958] OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
    [    4.082366] omap_device: omap_wdt.-1: new worst case deactivate latency

    0: 30517
    [    4.091033] oprofile: hardware counters not available
    [    4.096374] oprofile: using timer interrupt.
    [    4.101562] TCP cubic registered
    [    4.105041] NET: Registered protocol family 17
    [    4.110076] NET: Registered protocol family 15
    [    4.114868] can: controller area network core (rev 20090105 abi 8)
    [    4.121826] NET: Registered protocol family 29
    [    4.126647] can: raw protocol (rev 20090105)
    [    4.131164] can: broadcast manager protocol (rev 20090105 t)
    [    4.137176] Registering the dns_resolver key type
    [    4.142791] VFP support v0.3: implementor 41 architecture 3 part 30

    variant c rev 1
    [    4.153900] ThumbEE CPU extension supported.
    [    4.173919] Power Management for TI OMAP3.
    [    4.227050] clock: disabling unused clocks to save power
    [    4.270935] Console: switching to colour frame buffer device 100x30
    [    4.375213] bq32k 1-0068: setting system clock to 2013-01-07 19:53:55 UTC

    (1357588435)
    [    4.391967] UBIFS: read-only UBI device
    [    4.396423] UBIFS error (pid 1): mount_ubifs: cannot mount read-write -

    read-only media
    [    4.409790] VFS: Cannot open root device "ubi0:rootfs-nand" or unknown-

    block(0,0)
    [    4.417694] Please append a correct "root=" boot option; here are the

    available partitions:
    [    4.426574] 1f00             512 mtdblock0  (driver?)
    [    4.431945] 1f01            1792 mtdblock1  (driver?)
    [    4.437225] 1f02             256 mtdblock2  (driver?)
    [    4.442565] 1f03            5120 mtdblock3  (driver?)
    [    4.447906] 1f04          254464 mtdblock4  (driver?)
    [    4.453186] 1f05          243180 mtdblock5  (driver?)
    [    4.458892] Kernel panic - not syncing: VFS: Unable to mount root fs on

    unknown-block(0,0)
    [    4.467590] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c03914bc>]

    (panic+0x54/0x180)
    [    4.476104] [<c03914bc>] (panic+0x54/0x180) from [<c0009148>]

    (mount_block_root+0x25c/0x2ac)
    [    4.484954] [<c0009148>] (mount_block_root+0x25c/0x2ac) from [<c0009280>]

    (prepare_namespace+0x88/0x1bc)
    [    4.494842] [<c0009280>] (prepare_namespace+0x88/0x1bc) from [<c0008708>]

    (kernel_init+0x10c/0x14c)
    [    4.504302] [<c0008708>] (kernel_init+0x10c/0x14c) from [<c009e590>]

    (kernel_thread_exit+0x0/0x8)

  • Hi

    使用TI官网prebuilt 的相应ubi.img 试试。

    UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read 64 bytes。

    还是像你的ubi.img做的有问题,我用的是AM3359,当制作的ubi.img 有问题,报的错与你相同

    这是我的 sudo mkfs.ubifs -r ./ubi_rootfs/ -F -m 2048 -e 126976 -c 1580 -o ubifs.img ; sudo ubinize -o ubi.img -m 2048 -p 128KiB -s 512 -O 2048 ubinize.cfg 和官网文档说明是一样的。

  • 我是用这个命令生成镜像的 mkfs.ubifs -r target/ -F -m 2048 -e 129024 -c 1580 -o ubifs.img

    我在uboot中操作如下:

    一:mtdpart default
    二:nand erase root
    三:ubi part root

    Creating 1 MTD partitions on "nand0":
    0x000000780000-0x000010000000 : "mtd=4"
    UBI: attaching mtd1 to ubi0
    UBI: physical eraseblock size:   131072 bytes (128 KiB)
    UBI: logical eraseblock size:    129024 bytes
    UBI: smallest flash I/O unit:    2048
    UBI: sub-page size:              512
    UBI: VID header offset:          512 (aligned 512)
    UBI: data offset:                2048
    UBI: empty MTD device detected
    UBI: create volume table (copy #1)
    UBI: create volume table (copy #2)
    UBI: attached mtd1 to ubi0
    UBI: MTD device name:            "mtd=4"
    UBI: MTD device size:            248 MiB
    UBI: number of good PEBs:        1952
    UBI: number of bad PEBs:         36
    UBI: max. allowed volumes:       128
    UBI: wear-leveling threshold:    4096
    UBI: number of internal volumes: 1
    UBI: number of user volumes:     0
    UBI: available PEBs:             1929
    UBI: total number of reserved PEBs: 23
    UBI: number of PEBs reserved for bad PEB handling: 19
    UBI: max/mean erase counter: 1/0
    四: ubi create rootfs-nand
    五:fatload usb 0:1 0x82000000 ubifs.img 0x2293800
    六:ubi write 0x82000000 rootfs-nand 0x2293800
    然后重启

    uboot中configs里面的am3517_evm.h文件修改添加如下内容:
    #define CONFIG_SYS_MALLOC_LEN             (CONFIG_ENV_SIZE+  1024*1024)
    #define CONFIG_MTD_DEVICE          1
    #define CONFIG_MTD_PARTITIONS        1
    #define CONFIG_CMD_MTDPARTS        
    #define CONFIG_CMD_UBIFS          
    #define CONFIG_CMD_UBI        
    #define CONFIG_LZO                    1
    #define CONFIG_RBTREE                    1

    #define MTDIDS_DEFAULT                  "nand0=nandflash0"
     
    #define MTDPARTS_DEFAULT            "mtdparts=nandflash0:512k@0(xload)," \
      "1792k(uboot)," \
                                       "256k(params)," \
                                       "5m(kernel)," \
                                       "-(root)"
    已经搞了很久了 郁闷了,哥们帮帮忙

     

  • Hi:

    五:fatload usb 0:1 0x82000000 ubifs.img 0x2293800 你烧写的是 ubifs.img?

    http://processors.wiki.ti.com/index.php/UBIFS_Support上说先使用mkfs.ubifs生成ubifs.img,

    The output of the above command, ubifs.img is fed into the 'ubinize' program to wrap it into a UBI image.

      The images produced by mkfs.ubifs must be further fed to the ubinize tool to create a UBI image which must be put to the raw flash to be used a UBI partition. 
    再用ubinize创建ubi.img,
    The output of the above command, 'ubi.img' is the required image.

    
    


  • 我现在用ubinize -o ubi.img   -m 2048   -p 128KiB   -s 512   ubinize.cfg

    在uboot下操作如下:

    fatload usb 0:1 0x82000000 ubi.img 0x1fe0000
    nand erase 0x780000 0xf880000

    nand write 0x82000000 0x780000 0x1fe0000

    但还是不行,你在uboot下是怎么操作的

  • 内核启动log如下:

    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Linux version 2.6.37 (luheng@luheng) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #121 Thu Jan 3 16:40:17 CST 2013
    [    0.000000] CPU: ARMv7 Processor [411fc087] revision 7 (ARMv7), cr=10c53c7f
    [    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
    [    0.000000] Machine: AM3505 3I_BOARD
    [    0.000000] Reserving 4194304 bytes SDRAM for VRAM
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] AM3505 ES1.1 (l2cache iva neon isp )
    [    0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 64000
    [    0.000000] Kernel command line: console=ttyO2,115200n8 ubi.mtd=4 root=ubi0:rootfs-nand rw rootfstype=ubifs
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 252MB = 252MB total
    [    0.000000] Memory: 243292k/243292k available, 18852k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xf8000000   ( 632 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .init : 0xc0008000 - 0xc0093000   ( 556 kB)
    [    0.000000]       .text : 0xc0093000 - 0xc04f332c   (4481 kB)
    [    0.000000]       .data : 0xc04f4000 - 0xc069a460   (1690 kB)
    [    0.000000] NR_IRQS:375
    [    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/600 MHz
    [    0.000000] omap_hwmod: i2c1: softreset failed (waited 10000 usec)
    [    0.000000] omap_hwmod: i2c2: softreset failed (waited 10000 usec)
    [    0.000000] omap_hwmod: i2c3: softreset failed (waited 10000 usec)
    [    0.000000] Reprogramming SDRC clock to 332000000 Hz
    [    0.000000] dpll3_m2_clk rate change failed: -22
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts
    [    0.000000] Total of 96 interrupts on 1 active controller
    [    0.000000] GPMC revision 5.0
    [    0.000000] Trying to install interrupt handler for IRQ368
    [    0.000000] Trying to install interrupt handler for IRQ369
    [    0.000000] Trying to install interrupt handler for IRQ370
    [    0.000000] Trying to install interrupt handler for IRQ371
    [    0.000000] Trying to install interrupt handler for IRQ372
    [    0.000000] Trying to install interrupt handler for IRQ373
    [    0.000000] Trying to install interrupt handler for IRQ374
    [    0.000000] Trying to install type control for IRQ375
    [    0.000000] Trying to set irq flags for IRQ375
    [    0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz
    [    0.000000] Console: colour dummy device 80x30
    [    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
    [    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8
    [    0.000000] ... MAX_LOCK_DEPTH:          48
    [    0.000000] ... MAX_LOCKDEP_KEYS:        8191
    [    0.000000] ... CLASSHASH_SIZE:          4096
    [    0.000000] ... MAX_LOCKDEP_ENTRIES:     16384
    [    0.000000] ... MAX_LOCKDEP_CHAINS:      32768
    [    0.000000] ... CHAINHASH_SIZE:          16384
    [    0.000000]  memory used by lock dependency info: 3951 kB
    [    0.000000]  per task-struct memory footprint: 2304 bytes
    [    0.000000] Calibrating delay loop... 601.84 BogoMIPS (lpj=2351104)
    [    0.000000] pid_max: default: 32768 minimum: 301
    [    0.000000] Security Framework initialized
    [    0.000000] Mount-cache hash table entries: 512
    [    0.000000] CPU: Testing write buffer coherency: ok
    [    0.000000] regulator: core version 0.5
    [    0.000000] regulator: dummy:
    [    0.000000] NET: Registered protocol family 16
    [    0.000000] ------------[ cut here ]------------
    [    0.000000] WARNING: at arch/arm/mach-omap2/pm.c:94 _init_omap_device+0x84/0xa4()
    [    0.000000] _init_omap_device: could not find omap_hwmod for iva
    [    0.000000] Modules linked in:
    [    0.000000] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c00c76a4>] (warn_slowpath_common+0x4c/0x64)
    [    0.000000] [<c00c76a4>] (warn_slowpath_common+0x4c/0x64) from [<c00c773c>] (warn_slowpath_fmt+0x2c/0x3c)
    [    0.000000] [<c00c773c>] (warn_slowpath_fmt+0x2c/0x3c) from [<c00aad54>] (_init_omap_device+0x84/0xa4)
    [    0.000000] [<c00aad54>] (_init_omap_device+0x84/0xa4) from [<c000fda8>] (omap2_common_pm_init+0x2c/0x10c)
    [    0.000000] [<c000fda8>] (omap2_common_pm_init+0x2c/0x10c) from [<c00933b8>] (do_one_initcall+0xc8/0x1a0)
    [    0.000000] [<c00933b8>] (do_one_initcall+0xc8/0x1a0) from [<c0008690>] (kernel_init+0x94/0x14c)
    [    0.000000] [<c0008690>] (kernel_init+0x94/0x14c) from [<c009e590>] (kernel_thread_exit+0x0/0x8)
    [    0.000000] ---[ end trace 1b75b31a2719ed1c ]---
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] omap_mux_init: Add partition: #1: core, flags: 0
    [    0.000000] Display initialized successfully
    [    0.000000] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.000000] OMAP DMA hardware revision 4.0
    [    0.059509] bio: create slab <bio-0> at 0
    [    0.068267] SCSI subsystem initialized
    [    0.073516] usbcore: registered new interface driver usbfs
    [    0.075347] usbcore: registered new interface driver hub
    [    0.076721] usbcore: registered new device driver usb
    [    0.081665] omap_device: omap_i2c.1: new worst case activate latency 0: 30517
    [    0.091918] omap_i2c omap_i2c.1: bus 1 rev3.12 at 400 kHz
    [    0.095703] omap_device: omap_i2c.1: new worst case deactivate latency 0: 30517
    [    0.102691] Switching to clocksource 32k_counter
    [    0.256317] musb-hdrc: version 6.0, otg (peripheral+host), debug=0
    [    0.256896] musb-hdrc musb-hdrc.0: dma type: dma-cppi41
    [    0.258422] <6>Waiting for PHY clock good...
    [    0.269287] musb-hdrc musb-hdrc.0: USB OTG mode controller at d0810000 using DMA, IRQ 71
    [    0.271362] NET: Registered protocol family 2
    [    0.272094] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.274047] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    [    0.274536] TCP bind hash table entries: 8192 (order: 6, 360448 bytes)
    [    0.279541] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.279632] TCP reno registered
    [    0.279663] UDP hash table entries: 128 (order: 1, 12288 bytes)
    [    0.280029] UDP-Lite hash table entries: 128 (order: 1, 12288 bytes)
    [    0.281250] NET: Registered protocol family 1
    [    0.282684] NetWinder Floating Point Emulator V0.97 (double precision)
    [    0.284851] omap_init_opp_table: no hwmod or odev for iva, [9] cannot add OPPs.
    [    0.287841] AM3505  Linux PSP version 04.02.00.07 (AM3517EVM)
    [    0.419158] VFS: Disk quotas dquot_6.5.2
    [    0.419281] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.420837] msgmni has been set to 475
    [    0.426483] io scheduler noop registered
    [    0.426513] io scheduler deadline registered
    [    0.426727] io scheduler cfq registered (default)
    [    0.432647] Generic Backlight Driver Initialized.
    [    0.493835] OMAP DSS rev 2.0
    [    0.493927] omapdss supply vdds_dsi not found, using dummy regulator
    [    0.494445] OMAP DISPC rev 3.0
    [    0.494476] omapdss supply vdda_dac not found, using dummy regulator
    [    0.494689] OMAP VENC rev 2
    [    0.496032] OMAP DSI rev 1.0
    [    0.660614] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    [    0.670837] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0
    [    0.673034] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1
    [    0.674774] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2
    [    1.412078] console [ttyO2] enabled
    [    1.468750] brd: module loaded
    [    1.497894] loop: module loaded
    [    1.502197] usbcore: registered new interface driver ub
    [    1.515197] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.523223] omap2-nand driver initializing
    [    1.528045] nand MFR:0xEC,ID:0xDA
    [    1.531646] NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung )
    [    1.538818] Creating 5 MTD partitions on "omap2-nand.0":
    [    1.544403] 0x000000000000-0x000000080000 : "xloader-nand"
    [    1.560699] 0x000000080000-0x000000240000 : "uboot-nand"
    [    1.574768] 0x000000240000-0x000000280000 : "params-nand"
    [    1.587921] 0x000000280000-0x000000780000 : "linux-nand"
    [    1.603302] 0x000000780000-0x000010000000 : "rootfs-nand"
    [    1.749511] UBI: attaching mtd4 to ubi0
    [    1.753997] UBI: physical eraseblock size:   131072 bytes (128 KiB)
    [    1.760559] UBI: logical eraseblock size:    129024 bytes
    [    1.766143] UBI: smallest flash I/O unit:    2048
    [    1.771087] UBI: sub-page size:              512
    [    1.775909] UBI: VID header offset:          512 (aligned 512)
    [    1.781951] UBI: data offset:                2048
    [    2.830993] UBI: max. sequence number:       0
    [    2.882812] UBI: volume 0 ("rootfs-nand") re-sized from 813 to 1929 LEBs
    [    2.894622] UBI: attached mtd4 to ubi0
    [    2.898498] UBI: MTD device name:            "rootfs-nand"
    [    2.904266] UBI: MTD device size:            248 MiB
    [    2.909484] UBI: number of good PEBs:        1952
    [    2.914367] UBI: number of bad PEBs:         36
    [    2.919158] UBI: number of corrupted PEBs:   0
    [    2.923828] UBI: max. allowed volumes:       128
    [    2.928619] UBI: wear-leveling threshold:    4096
    [    2.933563] UBI: number of internal volumes: 1
    [    2.938171] UBI: number of user volumes:     1
    [    2.942871] UBI: available PEBs:             0
    [    2.947540] UBI: total number of reserved PEBs: 1952
    [    2.952697] UBI: number of PEBs reserved for bad PEB handling: 19
    [    2.959075] UBI: max/mean erase counter: 1/0
    [    2.963592] UBI: image sequence number:  0
    [    2.969421] UBI: background thread "ubi_bgt0d" started, PID 379
    [    3.048461] davinci_mdio davinci_mdio: davinci mdio revision 1.5
    [    3.054718] davinci_mdio davinci_mdio: detected phy mask fffffffd
    [    3.081390] davinci_mdio: probed
    [    3.084777] davinci_mdio davinci_mdio: phy[1]: device ffffffff:01, driver unknown
    [    3.103515] vcan: Virtual CAN interface driver
    [    3.108154] CAN device driver interface
    [    3.112213] TI High End CAN Controller Driver 0.7
    [    3.119812] UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB 322:0, written 0 bytes
    [    3.129364] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c02be450>] (ubi_io_write+0x194/0x1f8)
    [    3.138610] [<c02be450>] (ubi_io_write+0x194/0x1f8) from [<c02be6a8>] (ubi_io_write_ec_hdr+0x128/0x134)
    [    3.148406] [<c02be6a8>] (ubi_io_write_ec_hdr+0x128/0x134) from [<c02c01ac>] (erase_worker+0x100/0x49c)
    [    3.158233] [<c02c01ac>] (erase_worker+0x100/0x49c) from [<c02c0ed8>] (do_work+0xd4/0x114)
    [    3.166839] [<c02c0ed8>] (do_work+0xd4/0x114) from [<c02c0fec>] (ubi_thread+0xd4/0x178)
    [    3.175201] [<c02c0fec>] (ubi_thread+0xd4/0x178) from [<c00e24e4>] (kthread+0x84/0x8c)
    [    3.183502] [<c00e24e4>] (kthread+0x84/0x8c) from [<c009e590>] (kernel_thread_exit+0x0/0x8)
    [    3.193298] UBI error: erase_worker: failed to erase PEB 322, error -5
    [    3.200195] UBI: mark PEB 322 as bad
    [    3.205047] ti_hecc ti_hecc: device registered (reg_base=d0870000, irq=24)
    [    3.213287] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    3.221710] usbcore: registered new interface driver uas
    [    3.227233] Initializing USB Mass Storage driver...
    [    3.233306] usbcore: registered new interface driver usb-storage
    [    3.239624] USB Mass Storage support registered.
    [    3.245391] usbcore: registered new interface driver usbtest
    [    3.251434] zero gadget: Gadget Zero, version: Cinco de Mayo 2008
    [    3.257812] zero gadget: zero ready
    [    3.261535] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [    3.268890] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
    [    3.277709] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    3.284851] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    3.292419] usb usb1: Product: MUSB HDRC host driver
    [    3.297607] usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
    [    3.303253] usb usb1: SerialNumber: musb-hdrc.0
    [    3.310211] UBI error: ubi_io_mark_bad: cannot mark PEB 322 bad, error -5
    [    3.317382] UBI warning: ubi_ro_mode: switch to read-only mode
    [    3.323516] UBI error: do_work: work failed with error code -5
    [    3.329650] UBI error: ubi_thread: ubi_bgt0d: work failed with error code -5
    [    3.340515] hub 1-0:1.0: USB hub found
    [    3.344665] hub 1-0:1.0: 1 port detected
    [    3.358215] input: matrix-keypad as /devices/platform/matrix-keypad/input/input0
    [    3.366271] !!!input.c517:input_open_device enter
    [    3.371337] !!!input.c517:input_open_device enter
    [    3.387939] !!!input.c517:input_open_device enter
    [    3.394042] led: can't get major number
    [    3.402130] bq32k 1-0068: rtc core: registered bq32k as rtc0
    [    3.409057] i2c /dev entries driver
    [    3.417327] omap_device: omap_wdt.-1: new worst case activate latency 0: 61035
    [    3.427185] OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
    [    3.433563] omap_device: omap_wdt.-1: new worst case deactivate latency 0: 30517
    [    3.442169] oprofile: hardware counters not available
    [    3.447814] oprofile: using timer interrupt.
    [    3.452941] TCP cubic registered
    [    3.456390] NET: Registered protocol family 17
    [    3.461425] NET: Registered protocol family 15
    [    3.466217] can: controller area network core (rev 20090105 abi 8)
    [    3.473114] NET: Registered protocol family 29
    [    3.477966] can: raw protocol (rev 20090105)
    [    3.482482] can: broadcast manager protocol (rev 20090105 t)
    [    3.488494] Registering the dns_resolver key type
    [    3.494140] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
    [    3.504577] ThumbEE CPU extension supported.
    [    3.524505] Power Management for TI OMAP3.
    [    3.578186] clock: disabling unused clocks to save power
    [    3.622131] Console: switching to colour frame buffer device 100x30
    [    3.726440] omap_device: omap_i2c.1: new worst case activate latency 0: 61035
    [    3.734588] bq32k 1-0068: setting system clock to 2013-01-08 15:08:30 UTC (1357657710)
    [    3.750396] UBIFS: read-only UBI device
    [    3.755004] UBIFS error (pid 1): mount_ubifs: cannot mount read-write - read-only media
    [    3.768768] VFS: Cannot open root device "ubi0:rootfs-nand" or unknown-block(0,0)
    [    3.776641] Please append a correct "root=" boot option; here are the available partitions:
    [    3.785583] 1f00             512 mtdblock0  (driver?)
    [    3.790924] 1f01            1792 mtdblock1  (driver?)
    [    3.796203] 1f02             256 mtdblock2  (driver?)
    [    3.801940] 1f03            5120 mtdblock3  (driver?)
    [    3.807281] 1f04          254464 mtdblock4  (driver?)
    [    3.812561] 1f05          243054 mtdblock5  (driver?)
    [    3.817901] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
    [    3.826599] [<c00a3678>] (unwind_backtrace+0x0/0xec) from [<c03914bc>] (panic+0x54/0x180)
    [    3.835144] [<c03914bc>] (panic+0x54/0x180) from [<c0009148>] (mount_block_root+0x25c/0x2ac)
    [    3.843933] [<c0009148>] (mount_block_root+0x25c/0x2ac) from [<c0009280>] (prepare_namespace+0x88/0x1bc)
    [    3.853820] [<c0009280>] (prepare_namespace+0x88/0x1bc) from [<c0008708>] (kernel_init+0x10c/0x14c)
    [    3.863250] [<c0008708>] (kernel_init+0x10c/0x14c) from [<c009e590>] (kernel_thread_exit+0x0/0x8)

  • Hi:

    我uboot 做法如下

    fatload mmc 0 0x81000000 ubi.img
    nandecc hw 2
    nand erase 0x00780000 0x07460000
    nand write.i 0x81000000 0x00780000 0x07460000

    如果可以的话,你可以先做nand scrub.chip 再重新烧写uboot kernel ubi 

  • John Lee :

    请教一下  我也是用的samsung的flash --K9F1G08U0C,可是在uboot中检测不到 ,提示

    No NAND device found!!!

    0 MiB

    需要在那里做修改,怎么修改啊,谢谢

  • 试试这个

    fs/ubifs/super.c

    大概1300行

    #if 0
    if (!c->ro_mount && c->space_fixup) {
    err = ubifs_fixup_free_space(c);
    if (err)
    goto out_master;
    }
    #endif

  • Hi:

        TI这么大的国际大型公司,应该有很多牛人和专家啊!这个问题我看很多人遇到了。但是到目前为止也没有看到可行的解决方案。不知道楼主解决了没有?或哪位牛人解决了能否分享一下。TI的牛人不给力啊!

  • 已经有朋友写了文档了,你多搜搜看啊

  • 你好,我用的是dm365,sdk是4.02,能否告知一下相关文档,我搜素好久了,没搜到!

  • 文档什么地方,可否给个链接?

  • 把ubi.img放在文件系统的根目录,先从sd卡启动ubi,然后用ubiformat /dev/mtd7 -f /ubi.img这个命令烧写ubi到nand flash,第二次启动也正常起来了

  • 请问楼上的哥们儿,怎样从sd卡启动ubi?

  • 他不是从sd卡启动ubi

    是把ubi的img放在sd卡中,然后从sd启动,把ubi的img烧写到nand中