Boot from SPI NOR FLASH N25Q128 - jffs2 error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Boot from SPI NOR FLASH N25Q128 - jffs2 error

Jump to solution
11,029 Views
pt
Senior Contributor I

Hi igorpadykov,Yuri,MarekVasut

Board : mcimx28evk

Linux : 2.6.35 kernel version

I am getting jffs2 error while booting from spi.

Why it happens?how to solve this?

Regards

Pt

Labels (2)
1 Solution
7,067 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pt

what are error messages ?

Please refer to this FAQ from MTD

http://www.linux-mtd.infradead.org/faq/jffs2.html#L_messages

======================= JFFS2 generates messages, is there a problem?

JFFS2 adopts the philosophy of keeping the user completely appraised of

what is going on.

This can catch out the unwary novice. The following messages can be

moved to a higher log level once you are sure that they are benign.

Empty flash at 0xXXXXXXXX ends at 0xXXXXXXXX This message is generated

if a block of data is partially written. It is generally not a sign of

any problem.

Name CRC failed on node at 0x00b620c8: Read 0x640c8ca3, calculated

0x795111fe or similar message about CRC failures. If you have ever done

unclean reboots - this is harmless. 

=======================

Some the messages may be indeed being caused by power cycling the board

without a proper shutdown. Seems this is harmless.

Best regards

igor

View solution in original post

0 Kudos
Reply
16 Replies
7,068 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pt

what are error messages ?

Please refer to this FAQ from MTD

http://www.linux-mtd.infradead.org/faq/jffs2.html#L_messages

======================= JFFS2 generates messages, is there a problem?

JFFS2 adopts the philosophy of keeping the user completely appraised of

what is going on.

This can catch out the unwary novice. The following messages can be

moved to a higher log level once you are sure that they are benign.

Empty flash at 0xXXXXXXXX ends at 0xXXXXXXXX This message is generated

if a block of data is partially written. It is generally not a sign of

any problem.

Name CRC failed on node at 0x00b620c8: Read 0x640c8ca3, calculated

0x795111fe or similar message about CRC failures. If you have ever done

unclean reboots - this is harmless. 

=======================

Some the messages may be indeed being caused by power cycling the board

without a proper shutdown. Seems this is harmless.

Best regards

igor

0 Kudos
Reply
7,067 Views
pt
Senior Contributor I

Hi

Thanks.

The error messages are:

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0000: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0004: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0008: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf000c: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0010: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0014: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0018: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf001c: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0020: 0x5555 instead

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00bf0024: 0x5555 instead

Further such events for this erase block will not be printed

VFS: Mounted root (jffs2 filesystem) on device 31:1.

Freeing init memory: 156K

Mounting /proc and /sys

Starting the hotplug events dispatcher udevd

Synthesizing initial hotplug events

JFFS2 notice: (1146) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x0cae68.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000004c)

JFFS2 warning: (1146) jffs2_do_read_inode_internal: no data nodes found for ino #79

JFFS2 notice: (1307) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x4b6174.

jffs2_read_inode(): Bogus imode 0 for ino 373

Returned error for crccheck of ino #79. Expect badness...

JFFS2 notice: (1146) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x0caee0.

Node totlen on flash (0xffffffff) != totlen from node ref (0x0000004c)

JFFS2 warning: (1146) jffs2_do_read_inode_internal: no data nodes found for ino #80

Returned error for crccheck of ino #80. Expect badness...

JFFS2 notice: (1146) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x0caf5c.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000004c)

JFFS2 warning: (1146) jffs2_do_read_inode_internal: no data nodes found for ino #81

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x579bf8.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000004c)

JFFS2 warning: (1151) jffs2_do_read_inode_internal: no data nodes found for ino #569

iget() failed for ino #569

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x75be5c.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000002c)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x75b178.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

Returned error for crccheck of ino #81. Expect badness...

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x75b0f4.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x75b070.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x7578c0.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000002c)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x74c764.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x749d40.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x749d10.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x74682c.

JFFS2 notice: (1146) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x0cafd8.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000004c)

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 warning: (1146) jffs2_do_read_inode_internal: no data nodes found for ino #82

Returned error for crccheck of ino #82. Expect badness...

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x74675c.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x743098.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000002c)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x73d0d8.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x73b5c4.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000002c)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x739264.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x735470.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x715730.

Node totlen on flash (0x00000000) != totlen from node ref (0x00000030)

JFFS2 notice: (1146) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x0cb050.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000004c)

JFFS2 notice: (1151) jffs2_get_inode_nodes: Wrong magic bitmask 0x0000 in node header at 0x71299c.

Node totlen on flash (0x00000000) != totlen from node ref (0x0000002c)

JFFS2 warning: (1146) jffs2_do_read_inode_internal: no data nodes found for ino #83

Returned error for crccheck of ino #83. Expect badness...


It continues...

I have attached the log here

0 Kudos
Reply
7,067 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pt

the message "Magic bitmask 0x1985 not found " means that

size of erase block was not set correctly.

you can just ignore them

Best regards

igor

0 Kudos
Reply
7,067 Views
pt
Senior Contributor I

Hi

Ok. Now I am not able to boot from SPI.

It shows rom error code

0x80501003 The file signature or file version is incorrect.

Regards

Pt

0 Kudos
Reply
7,067 Views
igorpadykov
NXP Employee
NXP Employee

I think you did not erase nor-flash, check below

https://lists.yoctoproject.org/pipermail/meta-freescale/2013-August/003989.html

~igor

0 Kudos
Reply
7,067 Views
pt
Senior Contributor I

Hi

I always erase SPI before the sf write.

sf probe 0

sf erase 0x0 0x300000

sf write 0x42000000 0x0 0x300000

Regards

Pt

0 Kudos
Reply
7,067 Views
igorpadykov
NXP Employee
NXP Employee

you can use sf update,

for first installation use erase + write

~igor

0 Kudos
Reply
7,067 Views
pt
Senior Contributor I

Hi

I am using uboot 2009 version .It doesn't have sf update command.

How to solve this "0x80501003 The file signature or file version is incorrect." error?

Booted from SD card and erased flash

---------------------------------------------------------

root@freescale ~$ cat /proc/mtd

dev:    size   erasesize  name

mtd0: 00300000 00010000 "linux-boot-stream"

mtd1: 00d00000 00010000 "rootfs"

root@freescale ~$ mtdinfo /dev/mtd0

mtd0

Name:                           linux-boot-stream

Type:                           nor

Eraseblock size:                65536 bytes, 64.0 KiB

Amount of eraseblocks:          48 (3145728 bytes, 3.0 MiB)

Minimum input/output unit size: 1 byte

Sub-page size:                  1 byte

Character device major/minor:   90:0

Bad blocks are allowed:         false

Device is writable:             true

root@freescale ~$ mtdinfo /dev/mtd1

mtd1

Name:                           rootfs

Type:                           nor

Eraseblock size:                65536 bytes, 64.0 KiB

Amount of eraseblocks:          208 (13631488 bytes, 13.0 MiB)

Minimum input/output unit size: 1 byte

Sub-page size:                  1 byte

Character device major/minor:   90:2

Bad blocks are allowed:         false

Device is writable:             true

root@freescale ~$ flash_erase /dev/mtd0 0 0

Erasing 64 Kibyte @ 2f0000 -- 100 % complete

root@freescale ~$ flash_erase /dev/mtd1 0 0

Erasing 64 Kibyte @ cf0000 -- 100 % complete

root@freescale ~$ mount -t jffs2 mtd1 /mnt

Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes

empty_blocks 0, bad_blocks 0, c->nr_blocks 208

mount: mounting mtd1 on /mnt failed: Input/output error

Then from uboot prompt.I repeated those commands

tftp 0x42000000 imx28_ivt_linux.sb

sf probe 0

sf erase 0x0 0x300000

sf write 0x42000000 0x0 0x300000

Now I am getting H0x80501003...

Regards

Pt

0 Kudos
Reply
7,067 Views
igorpadykov
NXP Employee
NXP Employee

Shortly "0x80501003 The file signature or file version is incorrect." error

means that image is wrong.

~igor

0 Kudos
Reply
7,067 Views
pt
Senior Contributor I

Hi igorpadykov, Yuri, MarekVasut

I have checked the command line. build image again.

Then I boot from sd card and tried to erase the flash using

flash_erase -j /dev/mtd0 0 0

flash_erase -j /dev/mtd1 0 0


The messages shows that the flash is successfully erased.But I don't think so.

When I done this erase command earlier,it took some time to erase flash and mount command works well.

mount -t jffs2 mtd1 /mnt


Now when I tried to mount after erasing, I am getting following error.


root@freescale ~$ mount -t jffs2 mtd1 /mnt

Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes

empty_blocks 0, bad_blocks 0, c->nr_blocks 208

mount: mounting mtd1 on /mnt failed: Input/output error.

Then from uboot prompt, I tried sf probe

But first time it failed to initialize SPI

iMX28 U-Boot > sf probe 0

SF: Got idcode ff ff ff ff ff

Failed to initialize SPI flash at 2:0

iMX28 U-Boot > sf probe 0

SF: Got idcode 20 ba 18 10 00

stmicro

SF: Detected N25Q128 with page size 256, total 16777216 bytes

16384 KiB N25Q128 at 2:0 is now current device

Then I erased the SPI and wrote image file to SPI.

Changed the boot mode switch to 0010 and click on reset button.

Getting the previous rom error code: 0x80501003 The file signature or file version is incorrect

What is the reason for this issue?

Yesterday I was faced the same problem.But when I tried these steps today ,It worked well at first time.

Also I am facing an another problem: -

     when I "poweroff",it reboots.

Any powering issues?

Regards

Pt


0 Kudos
Reply
7,067 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pt

if it worked first time (factory blank chip), then probably you did not

erase successfully nor after that with flash_erase.

~igor

0 Kudos
Reply
7,067 Views
pt
Senior Contributor I

Hi igorpadykov

     The erase command 'sf erase message' shows that it successfully erased the area.

     Also I have tried that mtd utils - flash_erase .It also shows that spi flash erased successfully.

     But I have noticed something while using flash_erase command.

     When I used flash_erase earlier,It had taken some time to erase flash.

         

     But now the erase operation finish very quickly.

     What is the reason behind this issue?Why the erase not working properly?

     Even though there is some problem in erasing,why the message is showing "erased successfully"?

Regards

Pt A R

0 Kudos
Reply
7,067 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pt A R

I think you should just debug this with oscilloscope

and jtag debugger.

Also one can dump NOR memory and check if it is erased

correctly or not.

>"But now the erase operation finish very quickly."

Probably it checks that memory already has all 0xFF and just skips ?

~igor

7,067 Views
pt
Senior Contributor I

Hi igorpadykov

     Thanks. I have seen a thread similar to my issue.

     iMX233 boot from SPI flash

     I am loading the imx28_ivt_linux.sb to address '0x0'.

     My source code doesn't have the structure defined in the reference manual.

     Regards

     Pt

0 Kudos
Reply
7,066 Views
pt
Senior Contributor I

Hi igorpadykov,

Ok.

I have erased SPI using flash_erase command and  then mount jffs2.

Then I used those uboot commands to load linux boot stream image and rootfs on SPI.

Successfully booted up.But now its waiting for

Waiting for root device /dev/mtdblock2...


Actually I have given noinitrd console=ttyAM0,115200 root=/dev/mtdblock1 rootwait rw rootfstype=jffs2 in command line


Regards

Pt

0 Kudos
Reply
7,067 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pt

Probably you did not update kernel boot command

In ltib. Please run ltib and enter new kernel boot command

In ltib.

~igor

0 Kudos
Reply