Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
Hi, I have ported linux kernel 2.6.19-1 on PXA270 ARM Xscale platform. We are using OneNand Flash in our product. Sometimes I see messages while loading kernel as shown below. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56

    Empty Flash Message in Kernel, OneNand Flash and JFFS2 File System


    Hi,

    I have ported linux kernel 2.6.19-1 on PXA270 ARM Xscale platform. We are using OneNand Flash in our product.

    Sometimes I see messages while loading kernel as shown below.

    Empty flash at 0x005ee828 ends at 0x005ef000
    Empty flash at 0x0084683c ends at 0x00847000
    jffs2_scan_eraseblock(): Node at 0x008fb7f8 {0x1985, 0xe002, 0x000000b5) has invalid CRC 0xe0011985 (calculated 0xa62d8adf)
    jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x008fb7fc: 0x00b5 instead
    Empty flash at 0x00dec9e8 ends at 0x00ded000
    Empty flash at 0x012e4d94 ends at 0x012e5000
    Empty flash at 0x01a9488c ends at 0x01a95000
    Empty flash at 0x020cd834 ends at 0x020ce000
    Empty flash at 0x02fc6040 ends at 0x02fc6800
    Empty flash at 0x03c1d02c ends at 0x03c1d800
    Empty flash at 0x044a8144 ends at 0x044a8800
    jffs2_scan_inode_node(): CRC failed on node at 0x047db7f4: Read 0xffffffff, calculated 0x1490a44bEmpty flash at 0x047db8a8 ends at 0x047dc000
    Empty flash at 0x04b68d60 ends at 0x04b69000
    Empty flash at 0x0503ca2c ends at 0x0503d000
    Empty flash at 0x0519b670 ends at 0x0519b800
    Empty flash at 0x059b3d40 ends at 0x059b4000
    Empty flash at 0x06490864 ends at 0x06491000
    Empty flash at 0x07125828 ends at 0x07126000
    Empty flash at 0x0723e084 ends at 0x0723e800
    Empty flash at 0x072fb438 ends at 0x072fb800
    VFS: Mounted root (jffs2 filesystem).
    Freeing init memory: 76K
    JFFS2 notice: (15 check_node_data: wrong data CRC in data node at 0x0519b000: read 0x641aaca7, calculated 0xa2625246.
    JFFS2 notice: (15 check_node_data: wrong data CRC in data node at 0x059b3800: read 0xe5d01ab2, calculated 0x2a8b028b.
    JFFS2 notice: (15 check_node_data: wrong data CRC in data node at 0x0503c800: read 0x1bd73a0a, calculated 0x7ffc181.

    I am using JFFS2 file system. What these messages mean? Does it mean flash is corrupted?

    I also see kernel panic sometimes. Here is the log below,
    Empty flash at 0x0026ae50 ends at 0x0026b000
    Empty flash at 0x003f70a8 ends at 0x003f7800
    Empty flash at 0x006c4478 ends at 0x006c4800
    Empty flash at 0x00730814 ends at 0x00731000
    Empty flash at 0x00d4f884 ends at 0x00d50000
    onenand_wait: controller error = 0x2400
    onenand_read: read failed = 9216
    jffs2_scan_medium(): unknown block state
    kernel BUG at fs/jffs2/scan.c:229!
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = c0004000
    00000000 *pgd=00000000
    Internal error: Oops: 8f5 #1
    Modules linked in:
    CPU: 0
    PC is at __bug+0x40/0x54
    LR is at vprintk+0x330/0x374
    pc : c001fd9c lr : c0032414 Not tainted
    sp : c038fb58 ip : c038fac8 fp : c038fb64
    r10: 01340450 r9 : 00000000 r8 : c7cc1f48
    r7 : 00001578 r6 : c7c8ee00 r5 : c7ce038c r4 : 00000000
    r3 : 00000000 r2 : 00000001 r1 : c0200794 r0 : 00000001
    Flags: nzCv IRQs on FIQs on Mode SVC_32 Segment kernel
    Control: 397F
    Table: A0004000 DAC: 00000017
    Process swapper (pid: 1, stack limit = 0xc038e25
    Stack: (0xc038fb58 to 0xc0390000)
    [STACK TRACE NOT PUT HERE]
    Kernel panic - not syncing: Attempted to kill init!
    Rebooting in 1 seconds..

    What it could be? Is it hardware error or JFFS2 error? How should I debug it or resolve it?

    Regards,
    Sumit

  2. #2
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56
    I investigated further. It seems that there could be a loss of data on flash when the write-buffer is not flushed before power down. There are some mechanisms to ensure, that the write-buffer is flushed. Wee can force the flush of the write-buffer by using fsync() or sync() in our application.

    The only question is when shall we call this 'sync' system call. I have it on my ARM platform. How will it work in case of unclean shut down?

    Regards,
    Sumit

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56
    How can I use sync command while mounting root file system?

    Regards,
    Sumit

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,639
    The sync command is used to flush unwritten data from file system buffers to disc (rotating or solid-state). In fact, it is usually recommended that flash drives that are mounted read+write should be mounted wtihout the sync option to improve the lifecycle of the device. Read-only file systems won't matter (obviously). A clean shutdown of the operating system should automatically run the sync command (you might want to verify that in the shutdown scripts), otherwise "bad things happen". If the system terminates abnormally and there is unflushed data in the buffers, then you get a dirty file system and have to run fsck on it when you reboot. Usually, the bootstrapping parts of the OS are in either a read-only partition of the device, or are in ramdisc copied from the read-only partition on the device. That's what my embedded systems do, so when booting the OS, the compressed ramdisc with standard commands needed to boot the system are decompressed into RAM, then the OS will chroot there and can then run fsck which will be in the ramdisc on any dirty partitions, including ones in flash.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56
    Thanks for the reply.

    I have been trying for last few days to make 'fsck' command to work on arm platform. I only have root file system. I am not able to run 'fsck' command successfully. It does not show me any output.

    I also observed one wierd thing with Onenad flash. I have created a single binary with bootloader, environment variables, kernel and file system. I have written a script which copies these binaries onto respective partition of flash. When I download this single binary, CPU hangs at location "Freeing Init Memory: 76K' and doesn't continue.

    But if I load these binaries one by one through tftp, and cp.b cpmmands, it works fine for me. I am using Samsung OneNand flash on PXA270 platform.

    Is this a known issue?

    Regards,
    Sumit

    Regards,
    Sumit

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,639
    Quote Originally Posted by sumitv View Post
    Thanks for the reply.

    I have been trying for last few days to make 'fsck' command to work on arm platform. I only have root file system. I am not able to run 'fsck' command successfully. It does not show me any output.

    I also observed one wierd thing with Onenad flash. I have created a single binary with bootloader, environment variables, kernel and file system. I have written a script which copies these binaries onto respective partition of flash. When I download this single binary, CPU hangs at location "Freeing Init Memory: 76K' and doesn't continue.

    But if I load these binaries one by one through tftp, and cp.b cpmmands, it works fine for me. I am using Samsung OneNand flash on PXA270 platform.

    Is this a known issue?
    Without more information I cannot answer this question, especially since just the kernel version without more information about the hardware configuration without some documentation (links to the manufacturer's web site would be helpful) for the hardware and software make an appropriate technical assessment quite impossible.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56
    Hi,

    We are using Samsung OneNand Flash - Part Number - KFG1G16U2C-AIB6. I have data sheet but due to attachment size limitations I am unable to upload it here.

    Here is the link: SAMSUNG's Digital World.

    Let me know if you need any additional information. I will definitely provide it unless it is confidential

    Thanks for your help.

    Regards,
    Sumit

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,639
    Sorry if I was unclear. I was requesting information about the ARM board, not the flash. The board maker has to have provided a Linux OS with the appropriate flash drivers and tool chain, as well as documentation on how to write the OS to the flash chip. That's the information I need. For example, I use boards from Technologic Systems PC/104 Single Board Computers and Peripherals and they provide full documentation on how to update the OS image on the flash chips on-board.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56
    Its been a long time now I am fighting with this issue.

    Here is the link for porting linux kernel 2.6.9 on PXA270. I am using kernel 2.6.19-1 and I did not find the documentation for the same.

    http://www.cs.cmu.edu/~rtmach/mainstone/glencoe.pdf

    For manufacturer links, please visit below links:
    http://www.marvell.com/products/proc...a_27x_emts.pdf

    http://www.marvell.com/products/proc...7x_dev_man.pdf

    Let me know if I can provide you anything else.

    Here is another capture I came across today.

    Empty flash at 0x007ab064 ends at 0x007ab800
    Empty flash at 0x00fca9d8 ends at 0x00fcb000
    Empty flash at 0x00fe5860 ends at 0x00fe6000
    onenand_wait: controller error = 0x2400
    onenand_read: read failed = 9216
    jffs2_scan_medium(): unknown block state
    kernel BUG at fs/jffs2/scan.c:229!
    Unable to handle kernel NULL pointer dereference at virtual address 00000000

    <Some stack trace goes here which is not included>
    [<c0008cd8>] (mount_root+0x0/0xf0) from [<c0008e88>] (prepare_namespace+0xc0/0x110)
    r6 = C038E000 r5 = C0019708 r4 = C0019710
    [<c0008dc8>] (prepare_namespace+0x0/0x110) from [<c001b1ec>] (init+0x170/0x27c)
    r5 = C0019194 r4 = C0242030
    [<c001b07c>] (init+0x0/0x27c) from [<c0033f48>] (do_exit+0x0/0x874)
    Code: 1b0049b1 e59f0014 eb0049af e3a03000 (e5833000)
    <0>Kernel panic - not syncing: Attempted to kill init!
    <0>Rebooting in 1 seconds..
    Last edited by sumitv; 11-16-2010 at 08:38 PM. Reason: Adding more information to the thread

  10. #10
    Just Joined!
    Join Date
    Nov 2006
    Location
    Harrisburg, PA, USA
    Posts
    56
    I was wondering if this could be related using 'mkfs.jffs2' command while building root file system.

    I was using mkfs.jffs2 revision 1.39. Today I upgraded it to revision 1.60 (mtd-utils-1.4.1).

    I am using following command to build root file system:
    "mkfs.jffs2 -d <destination_directory> -v -e 131072 -n -o rootfs.jffs2"

    I am not specifying any cleanmarker size and by default its 12. I searched it in OneNand Flash manufacturer data sheet but did not find anything.

    I was thinking another way of fixing this issue is to upgrade kernel version. But it requires a lot of efforts as we need to port all the drivers and configure kernel for the target platform.

    Please provide inputs.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •