2009-01-08 22:37:53     Can't boot jaffs from NOR flash

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

2009-01-08 22:37:53     Can't boot jaffs from NOR flash

Sonic Zhang (CHINA)

Message: 67645   

 

Question from "Jay AT hand-you DOT com DOT tw"

 

 

 

MTD 问题

目前使用 Nor Flash 放置U‐Boot 以及uImage 想请问如何正确的挂载以及存取NOR 剩余空间、Nand Flash

空间

参考网页为

docs.blackfin.uclinux.org/doku.php?id=linux‐kernel:drivers:bf5xx_nand

docs.blackfin.uclinux.org/doku.php?id=linux‐kernel:jffs&s[]=nand

docs.blackfin.uclinux.org/doku.php?id=linux‐kernel:yaffs&s[]=nand

尝试照着步骤使用jaffs 格式 放入Nor Flash 或 Nand Flash 中

但皆无法正常开机 ,(所以目前放入Nor Flash 使用最原始的格式)

 

nand設定1.pdf

nor設定1.pdf

QuoteReplyEditDelete

 

 

2009-01-09 08:05:29     Re: Can't boot jaffs from NOR flash

Yi Li (CHINA)

Message: 67718   

 

“但皆无法正常开机”

 

有无详细的出错信息?还是Uboot 也无法起来?

 

 

QuoteReplyEditDelete

 

 

2009-01-09 22:08:47     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 67738   

 

“但皆无法正常开机”

 

有无详细的出错信息?还是Uboot 也无法起来?

 

U-boot 可正常启动 但是如果使用jffs 格式

 

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

 

要从NOR FLASH  读取uImage 時 都會出現 bad image file

 

另外如附件说明的在uClinux 底下 我NAND FLASH  可以在/proc/mtd里看到  也可mount到/mnt底下  并且会出现 "lost+found"的文件夹

 

但从开机后我在 "lost+found"里面建立的数据就全部消失了  我该如何做存储的动作呢??

軟件開發版本為:    uClinux-dist-2008R1.5-RC3

硬件開發板    為:    ADSP-BF527 EZ-KIT  LITE  1.4

CPU:                       ADSP-BF527  Rev  0.2

 

Hand-You Technology Company

jay@hand-you.com.tw

 

TranslateQuoteReplyEditDelete

 

 

2009-01-11 22:28:10     Re: Can't boot jaffs from NOR flash

Sonic Zhang (CHINA)

Message: 67772   

 

Could you use jffs2 instead of jffs? jffs was not tested in 08R1.5.

 

 

QuoteReplyEditDelete

 

 

2009-01-15 01:04:02     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 67955   

 

最多只能顯示出"lost+found"

 

mtd需要事先將FLASH 做 IMG檔嗎?like  "jffs2.img" or other.....

 

需要打什麼指令讓檔案能夠回存至flash中呢???

TranslateQuoteReplyEditDelete

 

 

2009-01-15 01:26:50     Re: Can't boot jaffs from NOR flash

Sonic Zhang (CHINA)

Message: 67957   

 

Select JFFS2 option in kernel menuconfig. The Makefile of uClinux-dist will create the rootfs.jffs2 image in folder images for you after building.

 

 

QuoteReplyEditDelete

 

 

2009-01-21 05:39:33     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 68191   

 

I have Select JFFS2 ....

 

關於存取nand flsah

 

我的测试流程是..

 

依照 (附件中..)Nand.doc的设定 menuconfig

 

在uboot状态下 先将sw1 切换成 ON ON OFF ON   将uImage 下载到 memory中

 

之后切换回 OFF OFF ON OFF

 

执行"bootm "进入uClinux

 

执行" cat /proc/mtd" 确认是否有 mtd讯息....如果有就

 

执行"  mount -t JFFS2 /dev/mtdblock0 /mnt/  "

 

到mnt/目录下 只看到  "lost +found"

 

在"lost +found" 目录下 执行 "mkdir "建立目录 或是透过tftp下载文件

 

此时都看得到 目录和档案  但是执行"reboot"或是直接reset后 再重新mount后所有数据就全部消失了...

 

是我哪个步骤出了问题呢?请各位指导..thx

 

 

TranslateQuoteReplyEditDelete

 

 

2009-02-03 22:35:38     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 68805   

 

經過多日是否有人可以給我一些方向呢?

TranslateQuoteReplyEditDelete

 

 

2009-02-04 05:10:43     Re: Can't boot jaffs from NOR flash

Yi Li (CHINA)

Message: 68846   

 

Jay,

 

能不能按照这个步骤,在BF527-ezkit 的Nand Flash 上创建 Jffs2 文件系统。

 

把你看到的详细信息贴上来?

 

1. cat /proc/mtd

 

2. flash_eraseall -j /dev/mtd0

 

3. mount /dev/mtdblock0 /mnt

 

4. cd /mnt

 

5. touch test

 

-Yi

QuoteReplyEditDelete

 

 

2009-02-08 23:25:25     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 69053   

 

## Booting image at 01000000 ...

   Image Name:   Linux-2.6.22.19-ADI-2008R1.5-svn

   Created:      2009-02-09   3:12:58 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    3328329 Bytes =  3.2 MB

   Load Address: 00001000

   Entry Point:  0016c000

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 16c000

Linux version 2.6.22.19-ADI-2008R1.5-svn (root@h200) (gcc version 4.1.2 (ADI svn

)) #58 PREEMPT Mon Feb 9 11:12:56 CST 2009

early printk enabled on early_BFuart0

Hardware Trace Active and Enabled

Blackfin support (C) 2004-2007 Analog Devices, Inc.

Compiled for ADSP-BF527 Rev 0.0

Warning: Compiled for Rev 0, but running on Rev 2

Blackfin Linux support by  blackfin.uclinux.org/

Processor Speed: 525 MHz core clock and 131 MHz System Clock

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  text      = 0x00001000-0x00107930

  rodata    = 0x00108000-0x0015910c

  data      = 0x0015a000-0x0016c000

    stack   = 0x0015a000-0x0015c000

  init      = 0x0016c000-0x00631000

  bss       = 0x00631000-0x0063e7d0

  available = 0x0063e7d0-0x03eff000

  DMA Zone  = 0x03f00000-0x04000000

NOMPU: setting up cplb tables for global access

Instruction Cache Enabled

Data Cache Enabled (write-through)

Built 1 zonelists.  Total pages: 16002

Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart1,57600 conso

le=tty0 console=ttyBF0,57600

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 256 (order: 8, 1024 bytes)

console handover: boot [early_BFuart0] -> real [ttyBF0]

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 57536k/65536k RAM, (4884k init code, 1050k kernel code, 455k d

ata, 1024k dma, 584k reserved)

Blackfin Scratchpad data SRAM: 4 KB

Blackfin Data A SRAM: 16 KB (16 KB free)

Blackfin Data B SRAM: 16 KB (16 KB free)

Blackfin Instruction SRAM: 48 KB (42 KB free)

Security Framework v1.0.0 initialized

Mount-cache hash table entries: 512

Blackfin GPIO Controller

Blackfin DMA Controller

stamp_init(): registering device resources

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

musb_hdrc: version 6.0, pio, host, debug=0

musb_hdrc: kernel must blacklist external hubs

musb_hdrc: USB Host mode controller at ffc03800 using PIO, IRQ 59

musb_hdrc musb_hdrc.0: MUSB HDRC host driver

musb_hdrc musb_hdrc.0: new USB bus registered, assigned bus number 1

usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hubJFFS2 version 2.2. (NAND) 穢 2001-2006 Red Hat, Inc.

yaffs Feb  9 2009 11:04:20 Installing.

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bfin-t350mcqb: 320x240 24-bit RGB FrameBuffer initializing...

dma_alloc_init: dma_page @ 0x039d5000 - 256 pages at 0x03f00000

bfin-otp: initialized

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc02000 (irq = 31) is a BFIN-UART

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

BF5xx on-chip NAND FLash Controller Driver, Version 1.2 (c) 2007 Analog Devices,

Inc.

bf5xx-nand bf5xx-nand.0: page_size=256, data_width=8, wr_dly=3, rd_dly=3

NAND device: Manufacturer ID: 0x20, Chip ID: 0xdc (ST Micro NAND 512MiB 3,3V 8-b

it)

Creating 2 MTD partitions on "NAND 512MiB 3,3V 8-bit":

0x00000000-0x00400000 : "Linux Kernel"

0x00400000-0x10000000 : "File System"

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0, r

egs_base@ffc00500, dma channel@7

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

usbcore: registered new interface driver usbhid

drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver

Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50

2006 UTC).

ALSA device list:

  No soundcards found.

rtc-bfin rtc-bfin: setting the system clock to 1970-01-02 12:14:22 (130462)

Freeing unused kernel memory: 4884k freed

No usable address families found.

socket: Function not implemented

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            -  blackfin.uclinux.org/

\    YP"    `| 8P  `.          -  docs.blackfin.uclinux.org/

/     \.___.d|    .'           -  www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    -  www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.4.1 (2009-02-09 10:39:52 CST) Built-in shell (msh)

Enter 'help' for a list of built-in commands.

 

 

 

其他內容如附件...

 

第五項    touch test

 

是指進入mnt /  lost+found  存取嗎??

 

像是使用mkdir ,rm 之類的指令?

 

還是說使用nanddump  nandweite  ???

 

nanddump  nandweite  指令該如何使用呢??

 

可否舉例??

 

nand_test.pdf

TranslateQuoteReplyEditDelete

 

 

2009-02-09 00:47:42     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 69055   

 

我使用nandwrite 測試結果如下...

 

root:/> ls

123   dev   home  lib   proc  sbin  tmp   var

bin   etc   init  mnt   root  sys   usr

 

root:/> nandwrite  /dev/mtdblock1 123 0

MEMGETINFO: Inappropriate ioctl for device

 

 

root:/> nandwrite  /dev/mtd1 123 0

Unknown flash (not normal NAND)

 

root:/> nandwrite  /mnt/lost\+found/ 123 0

open flash: Is a directory

 

ps.123為我自行設置的txt檔

TranslateQuoteReplyEditDelete

 

 

2009-02-12 06:20:31     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 69338   

 

目前測試 如下

 

root:/proc> cat mtd

dev:    size   erasesize  name

mtd0: 00400000 00020000 "mtdram test device"

mtd1: 00400000 00020000 "Linux Kernel"

mtd2: 0fc00000 00020000 "File System"

 

root # cd /tmp

root # mkdir jffs2                             

root # echo abc >jffs2/abc.txt

 

root # mkfs.jffs2 -d jffs2 -o jffs2.img           //創立一個jffs2 的img檔

 

在mtdram 執行複製掛載

 

 

dd if=jffs.img of=/dev/mtdblock0               //複製到 mtdblock0成功....

 

mount  -t jffs2 /dev/mtdblock0 /mnt           //掛載成功

 

從開機執行完上面的指令後 在nandflash執行掛載

 

dd if=jffs.img of=/dev/mtdblock1              //複製到 mtdblock1 當機

 

cp jffs2.img /dev/mtd1                               //使用cp指令複製也當機

 

mount  -t jffs2 /dev/mtdblock1 /mnt        //掛載當機

 

 

 

jffs設定如下:

 

File System--->

 

                     Miscellaneous filesystems  --->

 

x x           <*> Journalling Flash File System v2 (JFFS2) support                              x x

  x x           (0)   JFFS2 debugging verbosity (0 = quiet, 2 = noisy)                              x x

  x x           [*]   JFFS2 write-buffering support                                                                x x

  x x           [*]   JFFS2 summary support (EXPERIMENTAL)                                       x x

  x x           [*]   JFFS2 XATTR support (EXPERIMENTAL)                                            x x

  x x           [*]     JFFS2 POSIX Access Control Lists                                                     x x

  x x           [*]     JFFS2 Security Labels                                                                           x x

  x x           [*]   Advanced compression options for JFFS2                                         x x

  x x           [*]     JFFS2 ZLIB compression support                                                      x x

  x x           [*]     JFFS2 RTIME compression support                                                  x x

  x x           [*]     JFFS2 RUBIN compression support                                                 x x

  x x                   JFFS2 default compression mode (priority)  --->                              x x

 

 

問題如下:

 

1.是否需要注意哪些細節 執行  mount  -t jffs2 /dev/mtdblock1 /mnt      可以正常掛載  而不當機....

 

2.Blackfin Linux Docs 所提供資訊中...有使用到 flasheraseall ,flashcp等指令  但我使用的版本沒有這些指令 flasheraseall 可 用 eraseall 取代 然而   flashcp  可以使用cp取代嗎? 還是說需要使用flashw 指令 但我選擇他之後make無法成功....

 

3.可否給我們一份for  527的image檔     讓我們可以正常掛載nand  flash並可以讓我們執行存取  好讓我們進行驗證???

 

  謝謝

 

 

TranslateQuoteReplyEditDelete

 

 

2009-02-17 22:05:02     Re: Can't boot jaffs from NOR flash

Jay Yung (TAIWAN)

Message: 69533   

 

經過多日是否有人可以協助我們呢?

 

問題如下:

 

1.是否需要注意哪些細節 執行  mount  -t jffs2 /dev/mtdblock1 /mnt      可以正常掛載  而不當機....

 

2.Blackfin Linux Docs 所提供資訊中...有使用到 flasheraseall ,flashcp等指令  但我使用的版本沒有這些指令 flasheraseall 可 用 eraseall 取代 然而   flashcp  可以使用cp取代嗎? 還是說需要使用flashw 指令 但我選擇他之後make無法成功....

 

3.可否給我們一份for  527的image檔     讓我們可以正常掛載nand  flash並可以讓我們執行存取  好讓我們進行驗證???

 

  謝謝

Attachments

Outcomes