2009-01-16 13:50:02     BF527 NAND and YFFS/JFFS2 usage

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

2009-01-16 13:50:02     BF527 NAND and YFFS/JFFS2 usage

Samuel Coelho (BRAZIL)

Message: 68044   




I have a "BF527 Ez-kit Lite" and uClinux-dist-2008R1.5-RC3.

I try to use NAND FLASH with YAFFS or JFFS2 file system.



bfin> nand info


Device 0: NAND 512MiB 3,3V 8-bit, sector size 128 KiB


bfin> bootm 0x01000000

## Booting image at 01000000 ...

   Image Name:   Linux-

   Created:      2009-01-14  19:12:31 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    3563787 Bytes =  3.4 MB

   Load Address: 00001000

   Entry Point:  0015e000

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 15e000

Linux version (estacao19@estacao19) (gcc version 4.1.2 (ADI svn)) #10 Wed Jan 14 17:12:27 BRST 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: Unsupported Chip Revision ADSP-BF527 Rev 0.0 detected

Blackfin Linux support by http://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-0x000f9d00

  rodata    = 0x000fa000-0x0014b3c0

  data      = 0x0014c000-0x0015e000

    stack   = 0x0014c000-0x0014e000

  init      = 0x0015e000-0x00662000

  bss       = 0x00662000-0x0066f7d4

  available = 0x0066f7d4-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 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: 57340k/65536k RAM, (5136k init code, 995k kernel code, 454k data, 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

hub 1-0:1.0: 1 port detected

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

yaffs Jan 14 2009 15:43:23 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 @ 0x00716000 - 256 pages at 0x03f00000

bfin-otp: initialized

simple-gpio: now handling 48 GPIOs: 0 - 47

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-bit)

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, regs_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-12 02:37:43 (959863)

Freeing unused kernel memory: 5136k freed

hostname: applet not found

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|            - http://blackfin.uclinux.org/

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

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

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


Have a lot of fun...



BusyBox v1.4.1 (2009-01-14 15:29:41 BRST) Built-in shell (msh)

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



root:/> cat /proc/mtd

dev:    size   erasesize  name

mtd0: 00400000 00020000 "Linux Kernel"

mtd1: 0fc00000 00020000 "File System"

root:/> cat /proc/partitions

major minor  #blocks  name

  31     0       4096 mtdblock0

  31     1     258048 mtdblock1

root:/> eraseall /dev/mtd0

Erased 4096 Kibyte @ 0 -- 100% complete.      

root:/> mount -t yaffs /dev/mtdblock0 /mnt

yaffs: dev is 32505856 name is "mtdblock0"

yaffs: Attempting MTD mount on 31.0, "mtdblock0"

yaffs: auto selecting yaffs2

root:/> cd /mnt/

root:/mnt> ls







If I try copy any file to the partition don't works. The linux prompt freeze.


If I reboot my board and try mount partition don't works too. Thats necessary erase the partition every time?


How can I work with NAND and file system?


Thanks and Regards, Samuel.




2009-01-16 13:57:23     Re: BF527 NAND and YFFS/JFFS2 usage

Mike Frysinger (UNITED STATES)

Message: 68045   


have you set the switches properly to disconnect the ethernet and hook up the nand ?






2009-01-19 06:36:56     Re: BF527 NAND and YFFS/JFFS2 usage

Samuel Coelho (BRAZIL)

Message: 68101   


Hello Mike.


Yes, I was set the switches to disable ethernet and hoop up the nand.


If I run "nand info", I have:




bfin> nand info


Device 0: NAND 512MiB 3,3V 8-bit, sector size 128 KiB





2009-01-19 09:47:49     Re: BF527 NAND and YFFS/JFFS2 usage

Mike Frysinger (UNITED STATES)

Message: 68104   


also try reading/dumping some nand pages from u-boot then




2009-01-21 06:41:17     Re: BF527 NAND and YFFS/JFFS2 usage


Message: 68193   


Hi Samuel,


do you solved your problem ? I'm currently working on nand flash device on my board and i'm interested in your case. it seems that i have some problem too.








2009-01-21 11:06:24     Re: BF527 NAND and YFFS/JFFS2 usage

Samuel Coelho (BRAZIL)

Message: 68198   


Hi Stephane.


Still I can't solve my problem.


I achieve mount filesystem with yaffs2. But write operation don't work, the linux prompt freeze.


I don't have idea.


Regards, Samuel.




2009-01-21 11:17:15     Re: BF527 NAND and YFFS/JFFS2 usage


Message: 68199   


hi samuel,


it seems that i have the same thing. detection is ok (i've got a micron nand flash), mount seems to be ok ; it detects the bad blocks. there is one lost+found directory and thats all.


when i try to create a directory or a file, or even if i try to umount the nand, the console freeze...


no idea for the moment too...


what option did you include in the kernel ?


ps : could you just try one little thing for me : as you have the ezkit, could you disconnectt the nand flash and try to boot ? in my case, when there is no nand flash chip and when nand flash support is added to the kernel, the kernel crash at bootime.










2009-01-21 12:50:26     Re: BF527 NAND and YFFS/JFFS2 usage

Samuel Coelho (BRAZIL)

Message: 68201   


Hi Stephane.


I made the test that you ask me.


My kernel is compiled with support to NAND.




Device Drivers --->

   Memory Technology Device (MTD) support --->

      NAND Device Support --->

         <*> Blackfin on-chip NAND Flash Controller driver

            [*] BF5XX NAND Hardware ECC

            [ ] Use Blackfin BootROM ECC Layout




I disable the NAND in my ezkit and receive a kernel panic too.


"Kernel panic - not syncing: Kernel exception"


regards, Samuel.




2009-01-21 15:15:19     Re: BF527 NAND and YFFS/JFFS2 usage


Message: 68206   


thanks a lot for the test. It really seems that we have the same problems...  hope we'll find a solution soon






2009-01-22 02:39:55     Re: BF527 NAND and YFFS/JFFS2 usage


Message: 68214   


Hi Samuel and Stephane,


I can reproduce this issue on my BF527-Ezkit, using the svn trunk kernel. The "cp" (busybox) process would hang there when r/w the Nand flash. I've also commit a bug to track it at: https://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=4833.








2009-01-22 03:08:14     Re: BF527 NAND and YFFS/JFFS2 usage


Message: 68216   


Thanks a lot for the test Yi, i'll study the evolution of the bug


very best regards






2009-01-27 13:31:30     Re: BF527 NAND and YFFS/JFFS2 usage

Evandro Pegorari (BRAZIL)

Message: 68427   


Hello Yi,


I am responsable for Samuel Coelho. Our Team would like to know if it is possible to change the priority of this "bug" from Medium Priority to  High Priority ?


We are up against the clock. We have a critical deadline to meet, and can not do it as long as this bug is in place.






2009-02-02 02:27:44     Re: BF527 NAND and YFFS/JFFS2 usage


Message: 68647   


Hi Evandro,


We just come back from a long public holiday and our developer is currently looking at the bug.






2009-02-02 07:10:12     Re: BF527 NAND and YFFS/JFFS2 usage

Evandro Pegorari (BRAZIL)

Message: 68664   


Hi Yi,


I understood you. I hope that you understand us. I am sorry my insistence.

We work with schedule and I need to know what is the estimated date to finish ?


Best Regards,




2009-02-04 05:55:31     Re: BF527 NAND and YFFS/JFFS2 usage

Cliff Cai (CHINA)

Message: 68848   


This problem has been fixed both on 2008r1 and trunk now.