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文件系统启动异常

Other Parts Discussed in Thread: AM3352

一、单板硬件配置

1.处理器型号:使用的AM335x处理器平台的微处理器型号为AM3352_ZCZ;

2.nandflash型号:使用的AM335x处理器平台的nandflash型号为MT29F2G08AB;

二、软件配置

1.sdk版本

TI公司提供的SDK开发包:ti-sdk-am335x-evm-06.00.00.00(uboot版本u-boot-2013.01.01-psp06.00.00.00,linux kernel版本为linux-3.2.0-psp04.06.00.11);

2.rootfs版本和配置

采用buildroot-2015.05工具进行的rootfs系统定制,其配置如下图所示,

3.nandflash分区情况

128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1m(u-boot),128k(hardware-test-res),12

8k(u-boot-env),5m(kernel),-(rootfs)

三、问题现象

单板正常烧录软件,运行几次后就会出现问题,挂载失败的打印信息见附录;

使用了uboot下的挂载命令,ubi part rootfs 2048, ubifsmount rootfs, ubifsls /命令,发现挂载是正常的,但是reset后仍未正常启动。

对比了在uboot下和kernel下nandflash工作电压是否有差异,使用示波器监测发现工作电压都为3.3v。

对其他单板进行掉电测试,57次掉电的时候就不正常了,,该问题出现频率较高。

请各位高人指点一下,到底是什么原因导致的,跪谢

  • 已有同事使用该版本超过两年并未出现该问题,因为我们对这个版本的文件系统进行写日志和写数据库操作较多,才会导致系统掉电时文件系统挂掉,并不是版本的问题。

  • 不知道是否和这个问题有关

    http://www.linux-mtd.infradead.org/doc/ubifs.html#L_unstable_bits

  • 不太确定是否是该原因。这期间又对单板进行了掉电测试,在系统启动不到30次时,文件系统崩溃,打印日志如下:

    SPL LOADING ...
    (Ver100, Sep 12 2017, 11:44:11)

    Booting from NAND...


    U-Boot LOADING ...
    (Ver100, Sep 12 2017, 11:44:11)

    I2C: ready
    DRAM: 64 MiB
    WARNING: Caches not enabled
    NAND: 128 MiB
    Net: NatSemi_DP83848

    Press Ctrl+b to enter BOOTROM... 1 0
    Booting from nand ...

    NAND read: device 0 offset 0x1c0000, size 0x300000
    3145728 bytes read: OK
    ## Booting kernel from Legacy Image at 80200000 ...
    Image Name: Linux-3.2.0
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 2403712 Bytes = 2.3 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    [ 0.000000] Linux version 3.2.0 (zongkai@am335x-compiler) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Wed Aug 30 16:03:54 CST 2017
    [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] Machine: kn_mkq161
    [ 0.000000] Memory policy: ECC disabled, Data cache writeback
    [ 0.000000] AM335X ES2.1 (neon )
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 quit root=ubi0:rootfs rw ubi.mtd=8,2048 rootfstype=ubifs rootwait=1
    [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
    [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
    [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.000000] Memory: 64MB = 64MB total
    [ 0.000000] Memory: 60016k/60016k available, 5520k 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] vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
    [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
    [ 0.000000] .text : 0xc0008000 - 0xc0424000 (4208 kB)
    [ 0.000000] .init : 0xc0424000 - 0xc0456000 ( 200 kB)
    [ 0.000000] .data : 0xc0456000 - 0xc04a9528 ( 334 kB)
    [ 0.000000] .bss : 0xc04a954c - 0xc04cc048 ( 139 kB)
    [ 0.000000] NR_IRQS:396
    [ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [ 0.000000] Total of 128 interrupts on 1 active controller
    [ 0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
    [ 0.000000] omap_dm_timer_switch_src: Switching to HW default clocksource(sys_clkin_ck) for timer1, this may impact timekeeping in low power state
    [ 0.000000] OMAP clocksource: GPTIMER1 at 24000000 Hz
    [ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
    [ 0.000000] Console: colour dummy device 80x30
    [ 0.000295] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464)
    [ 0.116345] pid_max: default: 32768 minimum: 301
    [ 0.116521] Security Framework initialized
    [ 0.116663] Mount-cache hash table entries: 512
    [ 0.117237] CPU: Testing write buffer coherency: ok
    [ 0.118350] devtmpfs: initialized
    [ 0.140076] omap_hwmod: gfx: failed to hardreset
    [ 0.156947] omap_hwmod: pruss: failed to hardreset
    [ 0.158605] print_constraints: dummy:
    [ 0.159136] NET: Registered protocol family 16
    [ 0.162227] OMAP GPIO hardware version 0.1
    [ 0.165503] omap_mux_init: Add partition: #1: core, flags: 0
    [ 0.169112] omap_i2c.1: alias fck already exists
    [ 0.170839] d_can.1: alias fck already exists
    [ 0.171828] _regulator_get: l3_main.0 supply vdd_core not found, using dummy regulator
    [ 0.171970] am335x_opp_update: physical regulator not present for core(-22)
    [ 0.172579] omap2_mcspi.1: alias fck already exists
    [ 0.172907] omap2_mcspi.2: alias fck already exists
    [ 0.174264] edma.0: alias fck already exists
    [ 0.174295] edma.0: alias fck already exists
    [ 0.174321] edma.0: alias fck already exists
    [ 0.198622] bio: create slab <bio-0> at 0
    [ 0.202906] usbcore: registered new interface driver usbfs
    [ 0.203316] usbcore: registered new interface driver hub
    [ 0.203615] usbcore: registered new device driver usb
    [ 0.203811] musb-ti81xx musb-ti81xx: musb0, board_mode=0x2, plat_mode=0x2
    [ 0.204187] musb-ti81xx musb-ti81xx: musb1, board_mode=0x2, plat_mode=0x0
    [ 0.205426] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
    [ 0.208080] Switching to clocksource gp timer
    [ 0.234490] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
    [ 0.234755] musb-hdrc musb-hdrc.0: dma type: pio
    [ 0.235230] MUSB0 controller's USBSS revision = 4ea20800
    [ 0.235267] musb0: Enabled SW babble control
    [ 0.236180] musb-hdrc musb-hdrc.0: USB Peripheral mode controller at c483c000 using PIO, IRQ 18
    [ 0.236330] musb-hdrc musb-hdrc.1: dma type: pio
    [ 0.236752] MUSB1 controller's USBSS revision = 4ea20800
    [ 0.236781] musb1: Enabled SW babble control
    [ 0.237011] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [ 0.237040] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
    [ 0.238566] hub 1-0:1.0: USB hub found
    [ 0.238610] hub 1-0:1.0: 1 port detected
    [ 0.239490] musb-hdrc musb-hdrc.1: USB OTG mode controller at c483e800 using PIO, IRQ 19
    [ 0.240110] NET: Registered protocol family 2
    [ 0.240395] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.240837] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
    [ 0.240913] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.240961] TCP: Hash tables configured (established 2048 bind 2048)
    [ 0.240979] TCP reno registered
    [ 0.240996] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.241032] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.241318] NET: Registered protocol family 1
    [ 0.241694] RPC: Registered named UNIX socket transport module.
    [ 0.241712] RPC: Registered udp transport module.
    [ 0.241723] RPC: Registered tcp transport module.
    [ 0.241736] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.242055] NetWinder Floating Point Emulator V0.97 (double precision)
    [ 0.242370] omap-gpmc omap-gpmc: GPMC revision 6.0
    [ 0.242398] Registering NAND on CS0
    [ 0.250448] VFS: Disk quotas dquot_6.5.2
    [ 0.250542] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [ 0.251313] msgmni has been set to 117
    [ 0.256070] alg: No test for stdrng (krng)
    [ 0.257204] io scheduler noop registered
    [ 0.257226] io scheduler deadline registered
    [ 0.257327] io scheduler cfq registered (default)
    [ 0.259096] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
    [ 0.829321] console [ttyO0] enabled
    [ 0.834033] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    [ 0.842279] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    [ 0.850441] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
    [ 0.858550] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
    [ 0.866639] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
    [ 0.875518] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00
    [ 0.897052] brd: module loaded
    [ 0.908070] loop: module loaded
    [ 0.912769] mtdoops: mtd device (mtddev=name/number) must be supplied
    [ 0.920477] omap2-nand driver initializing
    [ 0.925184] ONFI flash detected
    [ 0.928683] ONFI param page 0 valid
    [ 0.932374] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xf1 (Micron MT29F1G08ABADAH4)
    [ 0.941158] Creating 9 MTD partitions on "omap2-nand.0":
    [ 0.946775] 0x000000000000-0x000000020000 : "SPL"
    [ 0.954198] 0x000000020000-0x000000040000 : "SPL.backup1"
    [ 0.961932] 0x000000040000-0x000000060000 : "SPL.backup2"
    [ 0.969600] 0x000000060000-0x000000080000 : "SPL.backup3"
    [ 0.977239] 0x000000080000-0x000000180000 : "U-Boot"
    [ 0.984914] 0x000000180000-0x0000001a0000 : "Hardware-Test Res"
    [ 0.993194] 0x0000001a0000-0x0000001c0000 : "U-Boot Env"
    [ 1.000810] 0x0000001c0000-0x0000006c0000 : "Kernel"
    [ 1.010168] 0x0000006c0000-0x000008000000 : "Rootfs"
    [ 1.069625] UBI: attaching mtd8 to ubi0
    [ 1.073687] UBI: physical eraseblock size: 131072 bytes (128 KiB)
    [ 1.080334] UBI: logical eraseblock size: 126976 bytes
    [ 1.086020] UBI: smallest flash I/O unit: 2048
    [ 1.090990] UBI: VID header offset: 2048 (aligned 2048)
    [ 1.097319] UBI: data offset: 4096
    [ 2.145235] UBI: max. sequence number: 1045
    [ 2.165487] UBI: attached mtd8 to ubi0
    [ 2.169487] UBI: MTD device name: "Rootfs"
    [ 2.174765] UBI: MTD device size: 121 MiB
    [ 2.179964] UBI: number of good PEBs: 970
    [ 2.184785] UBI: number of bad PEBs: 0
    [ 2.189435] UBI: number of corrupted PEBs: 0
    [ 2.194075] UBI: max. allowed volumes: 128
    [ 2.198907] UBI: wear-leveling threshold: 4096
    [ 2.203818] UBI: number of internal volumes: 1
    [ 2.208467] UBI: number of user volumes: 1
    [ 2.213106] UBI: available PEBs: 0
    [ 2.217745] UBI: total number of reserved PEBs: 970
    [ 2.222849] UBI: number of PEBs reserved for bad PEB handling: 9
    [ 2.229134] UBI: max/mean erase counter: 4/1
    [ 2.233591] UBI: image sequence number: 0
    [ 2.237979] UBI: background thread "ubi_bgt0d" started, PID 459
    [ 2.244615] CAN device driver interface
    [ 2.248687] CAN bus driver for Bosch D_CAN controller 1.0
    [ 2.255580] d_can d_can.1: device registered (irq=55, irq_obj=56)
    [ 2.308197] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    [ 2.314721] davinci_mdio davinci_mdio.0: detected phy mask fffffff5
    [ 2.322862] davinci_mdio.0: probed
    [ 2.326454] davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown
    [ 2.333922] davinci_mdio davinci_mdio.0: phy[3]: device 0:03, driver unknown
    [ 2.341752] gadget: using random self ethernet address
    [ 2.347280] gadget: using random host ethernet address
    [ 2.353604] usb0: MAC de:fe:dc:e6:c6:01
    [ 2.357649] usb0: HOST MAC b6:22:ef:24:ad:ef
    [ 2.362294] gadget: Ethernet Gadget, version: Memorial Day 2008
    [ 2.368656] gadget: g_ether ready
    [ 2.373121] mousedev: PS/2 mouse device common for all mice
    [ 2.379038] i2c /dev entries driver
    [ 2.385894] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [ 2.392637] _regulator_get: deviceless supply vdd_mpu not found, using dummy regulator
    [ 2.401624] cpuidle: using governor ladder
    [ 2.406639] cpuidle: using governor menu
    [ 2.411572] omap4_aes_mod_init: loading AM33X AES driver
    [ 2.417337] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
    [ 2.424192] omap4_aes_probe: probe() done
    [ 2.428772] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
    [ 2.435023] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
    [ 2.448819] omap4_sham_probe: probe() done
    [ 2.453481] oprofile: hardware counters not available
    [ 2.458835] oprofile: using timer interrupt.
    [ 2.463379] nf_conntrack version 0.5.0 (937 buckets, 3748 max)
    [ 2.470163] ip_tables: (C) 2000-2006 Netfilter Core Team
    [ 2.475948] TCP cubic registered
    [ 2.479419] NET: Registered protocol family 17
    [ 2.484116] can: controller area network core (rev 20090105 abi 8)
    [ 2.490763] NET: Registered protocol family 29
    [ 2.495487] can: raw protocol (rev 20090105)
    [ 2.500006] can: broadcast manager protocol (rev 20090105 t)
    [ 2.505981] 8021q: 802.1Q VLAN Support v1.8
    [ 2.510443] Registering the dns_resolver key type
    [ 2.515492] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [ 2.523597] ThumbEE CPU extension supported.
    [ 2.528194] mux: Failed to setup hwmod io irq -22
    [ 2.534167] Power Management for AM33XX family
    [ 2.539184] Trying to load am335x-pm-firmware.bin (60 secs timeout)
    [ 2.545921] Copied the M3 firmware to UMEM
    [ 2.550360] Cortex M3 Firmware Version = 0x181
    [ 2.555863] sr_init: platform driver register failed
    [ 2.566241] clock: disabling unused clocks to save power
    [ 2.589779] Detected MACID=60:64:5:2e:e9:5f
    [ 2.595828] cpsw: Detected MACID = 60:64:05:2e:e9:61
    [ 2.669678] UBIFS: recovery needed

    与上一次系统崩溃时遇到的问题不一样,但是重新换过文件系统后就正常了,现在还无法定位该问题。