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.

fail to put file system on Nand

Other Parts Discussed in Thread: ADS7846

Hi Experts,

I have been strugging a few days to put file system on Nand of AM37x EVM board. My Linux kernel uImage can be boot successfully if using host filesystem mapping, NFS on my host PC through Ethernet. The user guide from my SDK package is far from enough. Here is what I did to setup the file system in Nand by following a few user guide links:

1. Since I do not have a sample file system tree or image, I build the target file system using busybox and followed instructions below.

http://processors.wiki.ti.com/index.php/Creating_a_Root_File_System_for_Linux_on_OMAP35x

2. I made jffs2 image by following: http://processors.wiki.ti.com/index.php/Create_a_JFFS2_Target_Image

3. I put the jffs2 image into nand by following http://processors.wiki.ti.com/index.php/Put_JFFS2_Image_to_Flash. Since nand write.trimffs is not working in the SDK U-boot and the latest u-boot does not start with my SDK x-loader, I wrote the jffs2 image from Linux by using flash-eraseall, and nandwrite to /dev/mtd4 which is my nand partition.

4. I booted the board and change the filesystem bootargs as 'setenv bootargs console=${console} root=/dev/mtdblock4 rw rootfstype=jffs2'

The Linux boot is stuck after 6 seconds and here is the boot up log below. Please help to give me some clues what could be wrong. Thanks.

 

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Linux version 2.6.37 (cwang@ubuntu) (gcc version 4.3.3 (GCC) ) #36 Mon Jan 9 09:50:17 E2
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: OMAP3 EVM
[    0.000000] Reserving 4194304 bytes SDRAM for VRAM
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] OMAP3630 ES1.2 (l2cache iva sgx neon isp 192mhz_clk )
[    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=ttyO0,115200n8 root=/dev/mtdblock4 rw rootfstype=jffs2
[    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: 243044k/243044k available, 19100k 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 - 0xc003c000   ( 208 kB)
[    0.000000]       .text : 0xc003c000 - 0xc0520b08   (5011 kB)
[    0.000000]       .data : 0xc0522000 - 0xc06d3920   (1735 kB)
[    0.000000] NR_IRQS:409
[    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/400/1000 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 400000000 Hz
[    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 IRQ402
[    0.000000] Trying to install interrupt handler for IRQ403
[    0.000000] Trying to install interrupt handler for IRQ404
[    0.000000] Trying to install interrupt handler for IRQ405
[    0.000000] Trying to install interrupt handler for IRQ406
[    0.000000] Trying to install interrupt handler for IRQ407
[    0.000000] Trying to install interrupt handler for IRQ408
[    0.000000] Trying to install type control for IRQ409
[    0.000000] Trying to set irq flags for IRQ409
[    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... 998.84 BogoMIPS (lpj=3899392)
[    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] 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] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.000000] OMAP DMA hardware revision 5.0
[    0.052307] bio: create slab <bio-0> at 0
[    0.055664] regulator: vwl1271: 1800 mV
[    0.059509] SCSI subsystem initialized
[    0.068237] usbcore: registered new interface driver usbfs
[    0.069183] usbcore: registered new interface driver hub
[    0.069915] usbcore: registered new device driver usb
[    0.073272] omap_device: omap_i2c.1: new worst case activate latency 0: 30517
[    0.087310] omap_i2c omap_i2c.1: bus 1 rev4.0 at 2600 kHz
[    0.095458] twl4030: PIH (irq 7) chaining IRQs 368..375
[    0.095611] twl4030: power (irq 373) chaining IRQs 376..383
[    0.097198] twl4030: gpio (irq 368) chaining IRQs 384..401
[    0.107330] regulator: VIO: 1800 mV normal standby
[    0.109283] regulator: VMMC1: 1850 <--> 3150 mV at 3000 mV normal standby
[    0.111206] regulator: VDAC: 1800 mV normal standby
[    0.113159] regulator: VAUX2_4030: 2800 mV normal standby
[    0.115081] regulator: VPLL2: 1800 mV normal standby
[    0.116973] regulator: VSIM: 1800 <--> 3000 mV at 1800 mV normal standby
[    0.118896] regulator: VAUX3: 2800 mV normal standby
[    0.119995] omap_i2c omap_i2c.2: bus 2 rev4.0 at 400 kHz
[    0.121002] omap_device: omap_i2c.2: new worst case deactivate latency 0: 30517
[    0.134094] omap_i2c omap_i2c.3: bus 3 rev4.0 at 400 kHz
[    0.140350] Switching to clocksource 32k_counter
[    0.225463] musb-hdrc: version 6.0, host, debug=0
[    0.225677] musb-hdrc musb-hdrc.0: degrade from otg to host-only mode
[    0.225708] musb-hdrc musb-hdrc.0: dma type: dma-inventra
[    0.225891] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[    0.227264] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
[    0.227874] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.227874] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.227905] usb usb1: Product: MUSB HDRC host driver
[    0.227905] usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
[    0.227905] usb usb1: SerialNumber: musb-hdrc.0
[    0.231384] hub 1-0:1.0: USB hub found
[    0.231597] hub 1-0:1.0: 1 port detected
[    0.234649] musb-hdrc musb-hdrc.0: USB Host mode controller at fa0ab000 using DMA, IRQ 92
[    0.235839] NET: Registered protocol family 2
[    0.236389] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.237579] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.237854] TCP bind hash table entries: 8192 (order: 6, 360448 bytes)
[    0.240447] TCP: Hash tables configured (established 8192 bind 8192)
[    0.240509] TCP reno registered
[    0.240509] UDP hash table entries: 128 (order: 1, 12288 bytes)
[    0.240722] UDP-Lite hash table entries: 128 (order: 1, 12288 bytes)
[    0.241363] NET: Registered protocol family 1
[    0.242462] RPC: Registered udp transport module.
[    0.242462] RPC: Registered tcp transport module.
[    0.242492] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.246063] omap-iommu omap-iommu.0: isp registered
[    0.246673] AM37x/DM37x  Linux PSP version 04.02.00.07 (OMAP3EVM)
[    0.339263] JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[    0.339874] msgmni has been set to 474
[    0.343963] io scheduler noop registered
[    0.343994] io scheduler deadline registered
[    0.344085] io scheduler cfq registered (default)
[    0.406402] OMAP DSS rev 2.0
[    0.406799] OMAP DISPC rev 3.0
[    0.406890] OMAP VENC rev 2
[    0.407684] OMAP DSI rev 1.0
[    0.735565] omap_device: omap_i2c.1: new worst case activate latency 0: 61035
[    0.737426] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.743255] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0
[    1.477935] console [ttyO0] enabled
[    1.482788] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1
[    1.491180] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2
[    1.499542] omap_uart.3: ttyO3 at MMIO 0x49042000 (irq = 80) is a OMAP UART3
[    1.536712] brd: module loaded
[    1.554290] loop: module loaded
[    1.561950] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.568786] omap2-nand driver initializing
[    1.573638] NAND device: Manufacturer ID: 0xad, Chip ID: 0xbc (Hynix )
[    1.580535] Creating 5 MTD partitions on "omap2-nand.0":
[    1.586151] 0x000000000000-0x000000080000 : "X-Loader-NAND"
[    1.598327] 0x000000080000-0x0000001c0000 : "U-Boot-NAND"
[    1.608734] 0x0000001c0000-0x000000280000 : "Boot Env-NAND"
[    1.619110] 0x000000280000-0x000000780000 : "Kernel-NAND"
[    1.631225] 0x000000780000-0x000020000000 : "File System - NAND"
[    1.879638] OneNAND driver initializing
[    1.883972] omap2-onenand omap2-onenand: Cannot request GPMC CS
[    1.890289] omap2-onenand: probe of omap2-onenand failed with error -16
[    1.900207] smsc911x: Driver version 2008-10-21.
[    1.910278] smsc911x-mdio: probed
[    1.914245] eth0: attached PHY driver [SMSC LAN8700] (mii_bus:phy_addr=ffffffff:01, irq=-1)
[    1.923339] net eth0: MAC Address: 00:50:c2:7e:98:1c
[    1.929718] usbcore: registered new interface driver asix
[    1.935852] usbcore: registered new interface driver cdc_ether
[    1.942443] usbcore: registered new interface driver net1080
[    1.948852] usbcore: registered new interface driver cdc_subset
[    1.955535] usbcore: registered new interface driver zaurus
[    1.961425] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.968658] omap_device: omap_i2c.1: new worst case activate latency 0: 91552
[    2.984252] ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
[    2.990295] ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 2
[    2.998626] ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
[    3.015625] ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
[    3.021942] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    3.029052] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.036621] usb usb2: Product: OMAP-EHCI Host Controller
[    3.042205] usb usb2: Manufacturer: Linux 2.6.37 ehci_hcd
[    3.047851] usb usb2: SerialNumber: ehci-omap.0
[    3.055145] hub 2-0:1.0: USB hub found
[    3.059143] hub 2-0:1.0: 3 ports detected
[    3.094268] Initializing USB Mass Storage driver...
[    3.099975] usbcore: registered new interface driver usb-storage
[    3.106292] USB Mass Storage support registered.
[    3.111694] usbcore: registered new interface driver usbtest
[    3.117614] udc: OMAP UDC driver, version: 4 October 2004 (iso) (dma)
[    3.127990] mice: PS/2 mouse device common for all mice
[    3.136016] input: TWL4030 Keypad as /devices/platform/omap/omap_i2c.1/i2c-1/1-004a/twl4030_keypad/0
[    3.153656] ads7846 spi1.0: touchscreen, irq 335
[    3.160583] input: ADS7846 Touchscreen as /devices/platform/omap2_mcspi.1/spi1.0/input/input1
[    3.175292] input: twl4030_pwrbutton as /devices/platform/omap/omap_i2c.1/i2c-1/1-0049/twl4030_pwrb2
[    3.189544] twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
[    3.198089] i2c /dev entries driver
[    3.206451] omap_device: omap_wdt.-1: new worst case activate latency 0: 30517
[    3.215393] OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
[    3.228637] mmci-omap-hs.1 supply vmmc_aux not found, using dummy regulator
[    3.311218] usbcore: registered new interface driver usbhid
[    3.317077] usbhid: USB HID core driver
[    3.321105] oprofile: hardware counters not available
[    3.326354] oprofile: using timer interrupt.
[    3.330993] nf_conntrack version 0.5.0 (3797 buckets, 15188 max)
[    3.338562] ip_tables: (C) 2000-2006 Netfilter Core Team
[    3.344604] TCP cubic registered
[    3.347961] Initializing XFRM netlink socket
[    3.352569] NET: Registered protocol family 17
[    3.357299] NET: Registered protocol family 15
[    3.362365] Registering the dns_resolver key type
[    3.367736] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    3.377136] ThumbEE CPU extension supported.
[    3.393127] Power Management for TI OMAP3.
[    3.397918] sr_init: No PMIC hook to init smartreflex
[    3.403594] smartreflex smartreflex.0: omap_sr_probe: SmartReflex driver initialized
[    3.412261] smartreflex smartreflex.1: omap_sr_probe: SmartReflex driver initialized
[    3.421691] SmartReflex Class3 initialized
[    3.456573] clock: disabling unused clocks to save power
[    3.469665] mmc1: card claims to support voltages below the defined range. These will be ignored.
[    3.496002] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
[    3.504150] mmc1: new SDIO card at address 0001
[    3.550201] twl_rtc twl_rtc: setting system clock to 2011-07-07 18:20:40 UTC (1310062840)
[    6.008361] VFS: Mounted root (jffs2 filesystem) on device 31:4.
[    6.014739] Freeing init memory: 208K
[    6.208190] request_module: runaway loop modprobe binfmt-464c
[    6.214263] request_module: runaway loop modprobe binfmt-464c
[    6.221191] request_module: runaway loop modprobe binfmt-464c
[    6.227264] request_module: runaway loop modprobe binfmt-464c
[    6.235992] request_module: runaway loop modprobe binfmt-464c

 

 

  • That should be "nandwrite -p" (pads incomplete pages with 0's), but I don't think it's a filesystem issue.  Take a look at your last line of output...
    
    
    "That usually signals a mismatch between the word size of the kernel and the userspace modprobe (one is 32bit and one is 64bit)."

    http://lists.debian.org/debian-amd64/2006/06/msg00166.html

    Check to make sure that you're building your kernel with the proper toolchain for your platform and that you're not trying to link to resources in your host machine.

  • Hi Ben,

    Thanks for the quick response. I did use nandwrite -p.

    I think I did use the proper toolchain to build (make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm), because it can start well if  I point the filesystem back to NFS (setenv bootargs 'console=ttyO0, rw noinitrd omap_voud.vid1_static_vrfb_alloc=y root=/dev/nfs nfsroot=10.145.64.54:/home/cwang/ti-sdk-am37x-evm-05.02.00.00/targetNFS, nolock, rsize=1024, wsize=1024 ip=dhcp'). I don't know what you mean by 'not trying to link to resouces in my host machine'. What config or setting makes the link to my host machine? Below is my uboot env pri:

    I mannually tftp the uImage over and then set bootargs either run nfs filesystem which is working or jffs2 which is failing. Thanks.

    Frank


    Texas Instruments X-Loader 1.51 (Jan 16 2012 - 16:07:09)
    Booting from nand . . .
    Starting OS Bootloader...


    U-Boot 2010.06 (Jul 06 2011 - 14:01:34)

    OMAP34xx/35xx-GP ES2.1, CPU-OPP2 L3-165MHz
    OMAP3 EVM board + LPDDR/NAND
    I2C:   ready
    DRAM:  256 MiB
    NAND:  HW ECC [Kernel/FS layout] selected
    512 MiB
    In:    serial
    Out:   serial
    Err:   serial
    Read back SMSC id 0x92200000
    Die ID #152800229ff80000016071640a02c01f
    Net:   smc911x-0
    Hit any key to stop autoboot:  0
    OMAP3_EVM #
    OMAP3_EVM #
    OMAP3_EVM #
    OMAP3_EVM # pri
    bootcmd=if mmc init; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then run importboo;
    bootdelay=10
    baudrate=115200
    bootfile=uImage
    loadaddr=0x82000000
    usbtty=cdc_acm
    console=ttyO0,115200n8
    mmcargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait omap_vout.vy
    nandargs=setenv bootargs console=${console} root=/dev/mtdblock4 rw rootfstype=jffs2
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt
    importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
    loaduimage=fatload mmc 0 ${loadaddr} uImage
    mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
    nandboot=echo Booting from nand ...; run nandargs; onenand read ${loadaddr} 280000 400000; bootm ${loa}
    dieid#=152800229ff80000016071640a02c01f
    ethact=smc911x-0
    filesize=29D294
    fileaddr=80000000
    ipaddr=10.145.64.80
    serverip=10.145.64.54
    stdin=serial
    stdout=serial
    stderr=serial

    Environment size: 1082/131068 bytes

     


     

  • This is a better explanation of the problem:
    https://lkml.org/lkml/2001/2/24/9

    My best guess is that you somehow copied a binary meant for your host into the target FS.  This could be because you accidentally built something w/o the CROSS_COMPILE flag, or for some other reason.

    I work on an AM18X, so I'm not sure how much help I'll be here.

    Honestly, this manual method seems kinda clunky.  My preferred method of building a filesystem is to use OpenEmbedded.  There may be an existing overlay in Arago for this.  If not, take a look at the EVM machine configs in the openembedded repo and work from there.  It's not an easy learning curve, but there are a ton of benefits to building your rootfs this way vs manually.  My favorite features are dependency management, automatic ipk packaging and automated remote repository setup for the opkg package manager.

    Sorry I can't be more help, and good luck!

  • Hi Ben, After further debugging, I found the problem is from the target file tree directory I built. I used BusyBox build the target directory then mannually put the tree in as instructed by http://processors.wiki.ti.com/index.php/Creating_a_Root_File_System_for_Linux_on_OMAP35x. Today I set the nfsroot to the target diectory I build, then the linux boot up stuck by setting

    setenv bootargs 'mem=64M ip=dhcp noinitrd console=ttyO0,115200n8 root=/dev/nfs rw nfsroot=10.145.64.54:/home/cwang/target,nolock,rsize=1024,wsize=1024'

    If the nfsroot is set to targetNFS which is the target file system coming from TI SDK pacakge, then the boot up works. But if I build targetNFS into jffs2 image, it would be 230M bytes or so. It is too big. Could you give me a guide link for document about how to use OpenEmbedded or other tools to build a basic linux file system tree structure? Thanks.

     

    Frank

  • The file system built by following the link  http://processors.wiki.ti.com/index.php/Creating_a_Root_File_System_for_Linux_on_OMAP35x does not boot up. That is the problem I found. I used another base file system as the target. Now it works. Thanks Ben.