2009-06-18 01:24:51     Mounting JFFS2 fs in BF527 shows CRC Errors

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2009-06-18 01:24:51     Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 75930   

 

I am using BF527 EZ-KIT,  and built with MTD Partition, JFFS2 fs and i am using parallel NOR flash(8MB),

 

After compilation i have got following files in images directory,

 

linux -> linux.initramfs.gz

linux.ext2

linux.initramfs

linux.initramfs.gz

rootfs.ext2

rootfs.initramfs

rootfs.initramfs.contents

rootfs.initramfs.gz

rootfs.jffs2

System.map.initramfs

System.map.initramfs.gz

uImage -> uImage.initramfs

uImage.initramfs

uImage.initramfs.gz

vmImage

vmlinux

 

1)I am getting some CRC errors(log below : LOG1), but i am able to view the contents of the filesystem

 

2)Now that I have mounted(Assuming mount is successfull), restarting the board with "vmImage" is not successfull and kernel panic message thrown("Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)")

 

L O G 1 : 

 

/***********************************************************************/

 

root:/> cat /proc/mtd

dev:    size   erasesize  name

mtd0: 00040000 00010000 "Bootloader"

mtd1: 00040000 00010000 "Kernel"

mtd2: 00380000 00010000 "RootFS"

root:/> dd if=/rootfs.jffs2 of=/dev/mtdblock2

5934+1 records in

5934+1 records out

 

root:/> mkdir /mnt/ROOTFS_TEST

root:/> mount -t jffs2 /dev/mtdblock2 /mnt/ROOTFS_TEST

jffs2_scan_eraseblock(): Node at 0x00080810 {0x1985, 0xe001, 0x0000002d) has invalid CRC 0x584d793a (calculated 0x584d313a)

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080814: 0x002d instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080818: 0x793a instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0008081c: 0x000d instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080820: 0x0062 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080824: 0x0064 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080828: 0xf894 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0008082c: 0x0a05 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080830: 0x8747 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080834: 0x9f2d instead

Further such events for this erase block will not be printed

jffs2_scan_inode_node(): CRC failed on node at 0x00082c34: Read 0xfe5b12dd, calculated 0xb0692979

jffs2_scan_inode_node(): CRC failed on node at 0x000842b4: Read 0xfe5b3b90, calculated 0xcdb475f7

jffs2_scan_inode_node(): CRC failed on node at 0x00085524: Read 0x54bfdc56, calculated 0x10b4a92f

jffs2_scan_inode_node(): CRC failed on node at 0x00085d1c: Read 0x673cde5a, calculated 0x8e8bca96

jffs2_scan_inode_node(): CRC failed on node at 0x00086718: Read 0x23aa7b3e, calculated 0x7bc6c2ff

jffs2_scan_inode_node(): CRC failed on node at 0x00087a34: Read 0x1e4bc615, calculated 0x40f09883

jffs2_scan_inode_node(): CRC failed on node at 0x0008c548: Read 0xae5057a4, calculated 0xf63cee65

jffs2_scan_inode_node(): CRC failed on node at 0x0008d22c: Read 0x9543d8ae, calculated 0xe2a7e3b0

jffs2_scan_inode_node(): CRC failed on node at 0x0008de2c: Read 0x33b10d8a, calculated 0x71fa5fa0

jffs2_scan_inode_node(): CRC failed on node at 0x0008f658: Read 0x2a20792b, calculated 0xd0b0dff4

jffs2_scan_inode_node(): CRC failed on node at 0x00090000: Read 0x24caa31b, calculated 0xeabd44af

jffs2_scan_inode_node(): CRC failed on node at 0x000913bc: Read 0x323058fa, calculated 0xaac02388

jffs2_scan_inode_node(): CRC failed on node at 0x0009199c: Read 0x0e344bf4, calculated 0x2959e360

jffs2_scan_inode_node(): CRC failed on node at 0x00092040: Read 0x0288193c, calculated 0x901fdb80

jffs2_scan_inode_node(): CRC failed on node at 0x000925f0: Read 0x9989c32a, calculated 0x7b269bae

jffs2_scan_eraseblock(): Node at 0x00093e54 {0x1985, 0xe002, 0x00002846) has invalid CRC 0x3ced622e (calculated 0x04a024ce)

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00093e58: 0x2846 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00093e5c: 0x622e instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00093e60: 0x0067 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00093e64: 0x0022 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00093e68: 0x81e4 instead

 

/*******************************************************************************/

 

I have used uImage.initramfs to boot my board, transferred the rootfs.jffs2 using dd command and finally after mounting jffs2 filesystem i am having two issues,

QuoteReplyEditDelete

 

 

2009-06-18 01:40:35     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Robin Getz (UNITED STATES)

Message: 75931   

 

Santhosh:

 

Please go back and read the documentation on JFFS2. It doesn't say to copy things to the flash with dd.

 

https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:jffs

 

-Robin

QuoteReplyEditDelete

 

 

2009-06-18 06:09:25     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 75957   

 

I have read that document, and when i used U-Boot's cp.b command to copy rootfs.jffs2 image to flash i am getting an error "Copy to Flash... Outside available Flash" (Log below). Hopefully this error doesnt mean "Flash Size Not  Sufficient" as file size coppied is within the flash size.

 

So i tried to copy the same using dd command after kernel bootup

 

Can you let me know the why cp.b and dd command not working for me? Is there any other way to write in to flash?

 

/********************************************************************************************************/

 

bfin> set serverip 10.142.14.126;set ipaddr 10.142.14.146;set ethaddr 00:11:22:3:44:55;

bfin> flinfo

 

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors

Erase timeout 8192 ms, write timeout 1 ms, buffer write timeout 1 ms, buffer size 1

  Sector Start Addresses:

    20000000 (RO) 20002000 (RO) 20004000 (RO) 20006000 (RO) 20008000 (RO)

    2000A000 (RO) 2000C000 (RO) 2000E000 (RO) 20010000 (RO) 20020000 (RO)

    20030000 (RO) 20040000 (RO) 20050000 (RO) 20060000      20070000

    20080000      20090000      200A0000      200B0000      200C0000

    200D0000      200E0000      200F0000      20100000      20110000

    20120000      20130000      20140000      20150000      20160000

    20170000      20180000      20190000      201A0000      201B0000

    201C0000      201D0000      201E0000      201F0000      20200000

    20210000      20220000      20230000      20240000      20250000

    20260000      20270000      20280000      20290000      202A0000

    202B0000      202C0000      202D0000      202E0000      202F0000

    20300000      20310000      20320000      20330000      20340000

    20350000      20360000      20370000      20380000      20390000

    203A0000      203B0000      203C0000      203D0000      203E0000

    203F0000

bfin> protect off 0x20100000 0x203FFFFF

................................................ done

Un-Protected 48 sectors

bfin> erase 0x20080000 0x20800000

 

........................................................ done

Erased 56 sectors

bfin> tftpboot 0x1000000 rootfs.jffs2

Using Blackfin EMAC device

TFTP from server 10.142.14.126; our IP address is 10.142.14.146

Filename 'rootfs.jffs2'.

Load address: 0x1000000

Loading: #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #########

done

Bytes transferred = 3038372 (2e5ca4 hex)

bfin> cp.b 0x1000000 0x20080000 3038372

Copy to Flash... Outside available Flash

bfin> md.b 0x20080000 0x02

20080000: ff ff    ..

 

/****************************************************************************************************************/

QuoteReplyEditDelete

 

 

2009-06-18 07:21:29     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 75962   

 

did you actually read the output ?  there should be no errors.

 

bfin> erase 0x20080000 0x203F0000

Error: end address not on sector boundary

QuoteReplyEditDelete

 

 

2009-06-18 08:07:24     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 75964   

 

Mike,

 

You missed my next attempt of erase in my log, it is a successfull one

 

bfin> protect off 0x20100000 0x203FFFFF

................................................ done

Un-Protected 48 sectors

bfin> erase 0x20080000 0x203F0000

Error: end address not on sector boundary

bfin> erase 0x20080000 0x20800000

 

........................................................ done

Erased 56 sectors

QuoteReplyEditDelete

 

 

2009-06-18 08:16:15     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 75965   

 

you used protect off for 0x20100000+, not 0x20080000+

QuoteReplyEditDelete

 

 

2009-06-18 08:17:15     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Robin Getz (UNITED STATES)

Message: 75966   

 

Santhosh:

 

Like I said - go back and read the documentation, follow the directions.

 

https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:jffs

 

Use $(filesize) for the copy.

 

-Robin

QuoteReplyEditDelete

 

 

2009-06-18 09:24:16     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 75968   

 

Mike : Thanks for pointing it out, Now i have done the protect off from 0x20080000 instead from 0x20100000, but still getting the same error for copy(Log below)

 

Robin : I have read that link only and have come up to this stage, as you mentioned i have used the parameter filesize already, (see log below)

 

/****************************************************************************************************************/

 

U-Boot 1.1.6 (ADI-2009R1-pre) (Apr  7 2009 - 16:57:02)

 

CPU:   ADSP bf527-0.2 (Detected Rev: 0.2)

Board: ADI BF527 EZ-Kit board

       Support:   blackfin.uclinux.org/

Clock: VCO: 600 MHz, Core: 600 MHz, System: 120 MHz

RAM:   64 MB

Flash:  4 MB

In:    serial

Out:   serial

Err:   serial

Net:   Blackfin EMAC

MAC:   00:E0:22:FE:BE:0A

Hit any key to stop autoboot:  0

bfin> set serverip 10.142.14.126;set ipaddr 10.142.14.146;set ethaddr 00:11:2:3:44:55;

bfin> protect off 0x20080000 0x20800000

........................................................ done

Un-Protected 56 sectors

bfin> erase 0x20080000 0x20800000

 

........................................................ done

Erased 56 sectors

bfin> tftpboot 0x1000000 rootfs.jffs2

Using Blackfin EMAC device

TFTP from server 10.142.14.126; our IP address is 10.142.14.146

Filename 'rootfs.jffs2'.

Load address: 0x1000000

Loading: #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #################################################################

         #########

done

Bytes transferred = 3038372 (2e5ca4 hex)

bfin> cp.b 0x1000000 0x20080000 3038372

Copy to Flash... Outside available Flash

bfin> md.b 0x20080000 0x02

20080000: ff ff    ..

bfin>

QuoteReplyEditDelete

 

 

2009-06-18 09:31:26     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 75970   

 

you still arent doing what Robin told you to do.  cp.b works in hex values, not decimal.

QuoteReplyEditDelete

 

 

2009-06-18 11:32:20     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 75979   

 

Thanks mike, cp.b works with hex values and i have got the message "Copy to Flash... done" and i have also verified it using md.b command

 

As said in the link, i cannot load the vmImage to flash, as our flash is only 4 MB, and its not sufficient for Kernel(1,036 KB) and rootfs.jffs2(2,968Kb). So i have kept the vmImage in SDRAM, and i have tried to mount rootfs.jffs2 using cmd

 

mount -t jffs2 /dev/mtdblock2 /mnt/ROOTFS_TEST

 

Still  i am getting same CRC errors,

 

jffs2_scan_inode_node(): CRC failed on node at 0x00080000: Read 0x6d95c84f, calculated 0xd756290a

jffs2_scan_eraseblock(): Node at 0x00080810 {0x1985, 0xe001, 0x0000002d) has invalid CRC 0x584d7b7a (calculated 0x584d313a)

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080814: 0x002d instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080818: 0x7b7a instead

QuoteReplyEditDelete

 

 

2009-06-18 11:39:51     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 75981   

 

did you disconnect any of the async banks from the flash using the switches on the board ?

QuoteReplyEditDelete

 

 

2009-06-18 12:09:28     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 75986   

 

I dont know to check async banks of the flash are disconnected or not.

 

i am using BF527 EZKIT. Can you tell me, how to check that?

QuoteReplyEditDelete

 

 

2009-06-18 12:24:45     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 75989   

 

we have documentation you should be reading ...

 

  docs.blackfin.uclinux.org/doku.php?id=hw:boards:bf527-ezkit

QuoteReplyEditDelete

 

 

2009-06-19 01:56:10     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 76009   

 

I have checked the same in the link as well in document ADSP-BF527 EZ-KIT Lite® Evaluation System Manual.

 

I am not disconnecting any async banks from flash. All switches of SW7 are in ON state only.

 

Is there any diagnostics to check flash drivers, i have a feeling to test flash driver ?

QuoteReplyEditDelete

 

 

2009-06-19 02:59:18     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 76010   

 

there are no tests

 

try using cmp.b in u-boot to make sure the image copied properly from external memory to the flash correctly

QuoteReplyEditDelete

 

 

2009-06-19 05:54:41     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 76046   

 

Confirmed two things,

 

1.      JFFS2 written properly in to flash : Used cmp command in Uboot to compare the FS written in Flash and SDRAM, its same. This means rootfs.jffs2 written properly in to flash.

 

2.       JFFS2 working reliably : Copied a file to JFFS2 partition using tftp, and copied the same back to PC => No data loss, Both files are identical.

 

Now can we suspect the flash drivers of kernel? May be some customization required?

QuoteReplyEditDelete

 

 

2009-06-19 06:47:42     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 76048   

 

how exactly did you copy a file to the jffs2 partition if you couldnt even mount it ?

QuoteReplyEditDelete

 

 

2009-06-19 07:23:33     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 76049   

 

I hoped mount was working fine, as i am able to see the filesystem contents after mounting it.

 

Attached log for referance,

 

root:/> mkdir /mnt/ROOTFS_JFFS2

root:/> mount -t jffs2 /dev/mtdblock2 /mnt/ROOTFS_JFFS2

jffs2_scan_inode_node(): CRC failed on node at 0x000806f8: Read 0x81bd2025, calculated 0xb55a614e

jffs2_scan_eraseblock(): Node at 0x00080810 {0x1985, 0xe001, 0x0000002d) has invalid CRC 0x584d7b7a (calculated 0x584d313a)

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00080814: 0x002d instead

 

<Truncatted further CRC errors here>

 

root:/mnt/ROOTFS_JFFS2> ls

JFFS2 notice: (135) read_direntry: header CRC failed on dirent node at 0x0aed78: read 0x32045106, calculated 0x6a68e8c7

bin   dev   etc   home  lib   mnt   proc  root  sbin  sys   tmp   usr   var

root:/mnt/ROOTFS_JFFS2> tftp -g -r log.txt 10.142.14.126

tftp: send: Network is unreachable

root:/mnt/ROOTFS_JFFS2> ifconfig eth0 10.142.14.146

root:/mnt/ROOTFS_JFFS2> ifconfig eth0 10.142.14.146PHY: 0:03 - Link is Up - 100/Full

root:/mnt/ROOTFS_JFFS2> tftp -g -r log.txt 10.142.14.126

root:/mnt/ROOTFS_JFFS2> ls

bin      etc      lib      mnt      root     sys      usr

dev      home     log.txt  proc     sbin     tmp      var

root:/mnt/ROOTFS_JFFS2> tftp -p -r log.txt 10.142.14.126

QuoteReplyEditDelete

 

 

2009-06-19 07:26:21     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Mike Frysinger (UNITED STATES)

Message: 76050   

 

try slwoing down the async timing parameters.  i vaguely recall the defaults being too agressive for the parallel flash that is hooked up.

QuoteReplyEditDelete

 

 

2009-06-19 12:29:30     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Santhosh Kumar (INDIA)

Message: 76055   

 

Its working Mike !!!! Tried with max flash wait states(0xFFC0) for all banks. Now there are no CRC errors.

 

Am able to save nearly 5MB of RAM !!!

 

Thanks a lot for the support !!

QuoteReplyEditDelete

 

 

2009-06-24 09:42:24     Re: Mounting JFFS2 fs in BF527 shows CRC Errors

Stefan Wanja (GERMANY)

Message: 76246   

 

Yes I had a similar problem. Shouldn't the timing defaults be updated to prevent this confusion?

 

See   blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=ForumMessageBrowse&thread_id=33337&action=ForumBrowse&forum_id=39

 

Kind regards

Attachments

    Outcomes