This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UBI in nand

Other Parts Discussed in Thread: AM3359, TPS65910

HI,

    我这边有个Am3359的板子,nand是用的海力士的 H27U4G8F 。 移植的是TI SDK6.0的版本。  

    通过U-boot把所有镜像烧到nand里,但是nand 挂载UBI 文件系统一直失败。求大神帮忙看看。

下面是UBI image的制作:

sudo ./mkfs.ubifs -r rootfs -F -m 2048 -e 126976 -c 4035 -o ubifs.img
sudo ./ubinize -o ubi.img -m 2048 -p 128KiB -O 2048 /home/fan/ti-sdk-am335x-evm-06.00.00.00/tools/ubinize.cfg

[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=200MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize

下面是U-boot烧写的命令:

"update=nand erase.chip;mmc rescan;"\
"fatload mmc 0 0x82000000 MLO; nand write.i 0x82000000 0 ${filesize};"\
"fatload mmc 0 0x82000000 u-boot.img;"\
"nand write.i 0x82000000 0x80000 ${filesize};"\
"fatload mmc 0 0x82000000 uImage;"\
"nand write.i 0x82000000 0x280000 ${filesize};"\
"fatload mmc 0 0x82000000 ubi.img;"\
"nand write.i 0x82000000 0x780000 ${filesize}\0"\

关于制作UBI的疑问:

1. -c 选项的计算?

2.关于子页系统的问题?

3.U-boot写入时ECC的设置??

下面是boot 信息:

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2014.08.12 15:19:52 =~=~=~=~=~=~=~=~=~=~=~=
CCCCCCCC
U-Boot SPL 2013.01.01 (Aug 11 2014 - 23:08:55)
Incorrect magic number (0xffffffff) in EEPROM
Could not get board ID.
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0


U-Boot 2013.01.01 (Aug 11 2014 - 23:08:55)

I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
Incorrect magic number (0xffffffff) in EEPROM
Could not get board ID.
NAND: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment

musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
Net: <ethaddr> not set. Validating first E-fuse MAC
PHY reset timed out
cpsw, usb_ether
Hit any key to stop autoboot: 2 1 0
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
mmc0(part 0) is current device
mmc_send_cmd : timeout: No status update
Card did not respond to voltage select!
Booting from nand ...

NAND read: device 0 offset 0x280000, size 0x500000
5242880 bytes read: OK
## Booting kernel from Legacy Image at 80007fc0 ...
Image Name: Linux-3.2.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3189784 Bytes = 3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Linux version 3.2.0 (fan@ubuntu) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #22 Mon Aug 11 23:24:39 PDT 2014
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: am335xevm
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] AM335X ES1.0 (sgx neon )
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 noinitrd rootfstype=ubifs rootwait=1 ip=none
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 512MB = 512MB total
[ 0.000000] Memory: 513180k/513180k available, 11108k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff000000 ( 488 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0596000 (5688 kB)
[ 0.000000] .init : 0xc0596000 - 0xc05d1000 ( 236 kB)
[ 0.000000] .data : 0xc05d2000 - 0xc063b3b0 ( 421 kB)
[ 0.000000] .bss : 0xc063b3d4 - 0xc066a1a4 ( 188 kB)
[ 0.000000] NR_IRQS:396
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] Total of 128 interrupts on 1 active controller
[ 0.000000] OMAP clockevent source: GPTIMER2 at 25000000 Hz
[ 0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz
[ 0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000122] Calibrating delay loop... 718.02 BogoMIPS (lpj=3590144)
[ 0.058959] pid_max: default: 32768 minimum: 301
[ 0.059082] Security Framework initialized
[ 0.059173] Mount-cache hash table entries: 512
[ 0.059539] CPU: Testing write buffer coherency: ok
[ 0.079772] omap_hwmod: pruss: failed to hardreset
[ 0.080902] print_constraints: dummy:
[ 0.081268] NET: Registered protocol family 16
[ 0.083435] OMAP GPIO hardware version 0.1
[ 0.086029] omap_mux_init: Add partition: #1: core, flags: 0
[ 0.087829] omap_i2c.1: alias fck already exists
[ 0.088684] omap2_mcspi.1: alias fck already exists
[ 0.088897] omap2_mcspi.2: alias fck already exists
[ 0.089874] edma.0: alias fck already exists
[ 0.089904] edma.0: alias fck already exists
[ 0.089935] edma.0: alias fck already exists
[ 0.116668] bio: create slab <bio-0> at 0
[ 0.118896] SCSI subsystem initialized
[ 0.120574] usbcore: registered new interface driver usbfs
[ 0.120880] usbcore: registered new interface driver hub
[ 0.121063] usbcore: registered new device driver usb
[ 0.121368] registerd cppi-dma Intr @ IRQ 17
[ 0.121398] Cppi41 Init Done Qmgr-base(e087a000) dma-base(e0878000)
[ 0.121398] Cppi41 Init Done
[ 0.121429] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
[ 0.121734] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
[ 0.122863] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
[ 0.124694] tps65910 1-002d: JTAGREVNUM 0x0
[ 0.127105] print_constraints: VRTC:
[ 0.128540] print_constraints: VIO: at 1500 mV
[ 0.130859] print_constraints: VDD1: 600 <--> 1500 mV at 1262 mV normal
[ 0.133148] print_constraints: VDD2: 600 <--> 1500 mV at 1137 mV normal
[ 0.134155] print_constraints: VDD3: 5000 mV
[ 0.135559] print_constraints: VDIG1: at 1800 mV
[ 0.136993] print_constraints: VDIG2: at 1800 mV
[ 0.138397] print_constraints: VPLL: at 1800 mV
[ 0.139801] print_constraints: VDAC: at 1800 mV
[ 0.141235] print_constraints: VAUX1: at 1800 mV
[ 0.142669] print_constraints: VAUX2: at 3300 mV
[ 0.144073] print_constraints: VAUX33: at 3300 mV
[ 0.145507] print_constraints: VMMC: at 3300 mV
[ 0.145996] tps65910 1-002d: No interrupt support, no core IRQ
[ 0.147369] Advanced Linux Sound Architecture Driver Version 1.0.24.
[ 0.148529] Switching to clocksource gp timer
[ 0.163848] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[ 0.164031] musb-hdrc musb-hdrc.0: dma type: dma-cppi41
[ 0.164367] MUSB0 controller's USBSS revision = 4ea20800
[ 0.165313] musb-hdrc musb-hdrc.0: USB OTG mode controller at e083c000 using DMA, IRQ 18
[ 0.165466] musb-hdrc musb-hdrc.1: dma type: dma-cppi41
[ 0.165740] MUSB1 controller's USBSS revision = 4ea20800
[ 0.166198] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[ 0.166290] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
[ 0.166412] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.166442] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.166442] usb usb1: Product: MUSB HDRC host driver
[ 0.166442] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
[ 0.166473] usb usb1: SerialNumber: musb-hdrc.1
[ 0.167266] hub 1-0:1.0: USB hub found
[ 0.167297] hub 1-0:1.0: 1 port detected
[ 0.167877] musb-hdrc musb-hdrc.1: USB Host mode controller at e083e800 using DMA, IRQ 19
[ 0.168304] NET: Registered protocol family 2
[ 0.168487] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.168853] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.169158] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.169342] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.169342] TCP reno registered
[ 0.169342] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.169372] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.169586] NET: Registered protocol family 1
[ 0.169860] RPC: Registered named UNIX socket transport module.
[ 0.169860] RPC: Registered udp transport module.
[ 0.169860] RPC: Registered tcp transport module.
[ 0.169891] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.170104] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.189544] VFS: Disk quotas dquot_6.5.2
[ 0.189605] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.190155] msgmni has been set to 1002
[ 0.193267] alg: No test for stdrng (krng)
[ 0.193969] io scheduler noop registered
[ 0.193969] io scheduler deadline registered
[ 0.194030] io scheduler cfq registered (default)
[ 0.195220] Could not set LED4 to fully on
[ 0.196960] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[ 0.840362] console [ttyO0] enabled
[ 0.844635] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[ 0.852478] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[ 0.860290] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[ 0.868041] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[ 0.875823] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
[ 0.884124] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00
[ 0.900451] brd: module loaded
[ 0.908416] loop: module loaded
[ 0.911926] i2c-core: driver [tsl2550] using legacy suspend method
[ 0.918365] i2c-core: driver [tsl2550] using legacy resume method
[ 0.924804] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 0.989105] No daughter card found
[ 0.992675] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[ 1.002014] The board is general purpose EVM in profile 0
[ 1.008605] da8xx_lcdc.0: alias fck already exists
[ 1.014160] da8xx_lcdc da8xx_lcdc.0: GLCD: Found TFC_S9700RTWV35TR_01B panel
[ 1.032562] Console: switching to colour frame buffer device 100x30
[ 1.046386] omap-gpmc omap-gpmc: GPMC revision 6.0
[ 1.051452] Registering NAND on CS0
[ 1.056030] omap_hsmmc.0: alias fck already exists
[ 1.065643] registered am33xx_sr device
[ 1.072235] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.079559] omap2-nand driver initializing
[ 1.084167] ONFI flash detected
[ 1.087554] ONFI param page 0 valid
[ 1.091247] NAND device: Manufacturer ID: 0xad, Chip ID: 0xdc (Hynix H27U4G8F2DTR-BC)
[ 1.099639] Creating 8 MTD partitions on "omap2-nand.0":
[ 1.105194] 0x000000000000-0x000000020000 : "SPL"
[ 1.111633] 0x000000020000-0x000000040000 : "SPL.backup1"
[ 1.118499] 0x000000040000-0x000000060000 : "SPL.backup2"
[ 1.125366] 0x000000060000-0x000000080000 : "SPL.backup3"
[ 1.132263] 0x000000080000-0x000000260000 : "U-Boot"
[ 1.139465] 0x000000260000-0x000000280000 : "U-Boot Env"
[ 1.146270] 0x000000280000-0x000000780000 : "Kernel"
[ 1.154785] 0x000000780000-0x000020000000 : "File System"
[ 1.370910] OneNAND driver initializing
[ 1.375640] UBI: attaching mtd7 to ubi0
[ 1.379699] UBI: physical eraseblock size: 131072 bytes (128 KiB)
[ 1.386230] UBI: logical eraseblock size: 126976 bytes
[ 1.391876] UBI: smallest flash I/O unit: 2048
[ 1.396759] UBI: VID header offset: 2048 (aligned 2048)
[ 1.403045] UBI: data offset: 4096
[ 5.086151] UBI: max. sequence number: 42
[ 5.110382] UBI: attached mtd7 to ubi0
[ 5.114318] UBI: MTD device name: "File System"
[ 5.120086] UBI: MTD device size: 504 MiB
[ 5.125244] UBI: number of good PEBs: 4034
[ 5.130157] UBI: number of bad PEBs: 2
[ 5.134796] UBI: number of corrupted PEBs: 0
[ 5.139434] UBI: max. allowed volumes: 128
[ 5.144256] UBI: wear-leveling threshold: 4096
[ 5.149169] UBI: number of internal volumes: 1
[ 5.153808] UBI: number of user volumes: 1
[ 5.158416] UBI: available PEBs: 0
[ 5.163055] UBI: total number of reserved PEBs: 4034
[ 5.168243] UBI: number of PEBs reserved for bad PEB handling: 40
[ 5.174591] UBI: max/mean erase counter: 2/0
[ 5.179046] UBI: image sequence number: 2029046386
[ 5.184265] UBI: background thread "ubi_bgt0d" started, PID 600
[ 5.199676] CAN device driver interface
[ 5.203674] CAN bus driver for Bosch D_CAN controller 1.0
[ 5.269378] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[ 5.275848] davinci_mdio davinci_mdio.0: detected phy mask ffffffef
[ 5.299438] davinci_mdio.0: probed
[ 5.302978] davinci_mdio davinci_mdio.0: phy[4]: device 0:04, driver unknown
[ 5.319427] usbcore: registered new interface driver zd1201
[ 5.329559] usbcore: registered new interface driver cdc_ether
[ 5.349182] usbcore: registered new interface driver cdc_eem
[ 5.355224] usbcore: registered new interface driver dm9601
[ 5.361114] cdc_ncm: 04-Aug-2011
[ 5.379608] usbcore: registered new interface driver cdc_ncm
[ 5.385528] Initializing USB Mass Storage driver...
[ 5.399261] usbcore: registered new interface driver usb-storage
[ 5.405517] USB Mass Storage support registered.
[ 5.419494] mousedev: PS/2 mouse device common for all mice
[ 5.439849] input: ti-tsc as /devices/platform/omap/ti_tscadc/tsc/input/input0
[ 5.459869] omap_rtc am33xx-rtc: rtc core: registered am33xx-rtc as rtc0
[ 5.466888] am33xx-rtc: already running
[ 5.479248] i2c /dev entries driver
[ 5.489288] Linux video capture interface: v2.00
[ 5.499267] usbcore: registered new interface driver uvcvideo
[ 5.505249] USB Video Class driver (1.1.1)
[ 5.629699] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[ 5.649597] cpuidle: using governor ladder
[ 5.659667] cpuidle: using governor menu
[ 5.680145] omap4_aes_mod_init: loading AM33X AES driver
[ 5.685821] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
[ 5.719268] omap4_aes_probe: probe() done
[ 5.723785] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
[ 5.729980] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
[ 5.800384] omap4_sham_probe: probe() done
[ 5.830291] usbcore: registered new interface driver usbhid
[ 5.836120] usbhid: USB HID core driver
[ 5.849365] tiadc tiadc: attached adc driver
[ 5.869445] usbcore: registered new interface driver snd-usb-audio
[ 5.890228] ALSA device list:
[ 5.893310] No soundcards found.
[ 5.896881] oprofile: hardware counters not available
[ 5.902160] oprofile: using timer interrupt.
[ 5.906616] nf_conntrack version 0.5.0 (8018 buckets, 32072 max)
[ 5.913452] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 5.919128] TCP cubic registered
[ 5.922546] NET: Registered protocol family 17
[ 5.927185] can: controller area network core (rev 20090105 abi 8)
[ 5.933715] NET: Registered protocol family 29
[ 5.938354] can: raw protocol (rev 20090105)
[ 5.942840] can: broadcast manager protocol (rev 20090105 t)
[ 5.948760] Registering the dns_resolver key type
[ 5.953765] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 5.961791] ThumbEE CPU extension supported.
[ 5.966308] mux: Failed to setup hwmod io irq -22
[ 5.971893] Power Management for AM33XX family
[ 5.976745] Trying to load am335x-pm-firmware.bin (60 secs timeout)
[ 5.983459] Copied the M3 firmware to UMEM
[ 5.987792] Cortex M3 Firmware Version = 0x181
[ 6.090606] create_regulator: VDD1: Failed to create debugfs directory
[ 6.110870] smartreflex smartreflex: am33xx_sr_probe: Driver initialized
[ 6.153137] clock: disabling unused clocks to save power
[ 6.419952] Detected MACID=78:c5:e5:76:9d:e3
[ 6.425567] cpsw: Detected MACID = 78:c5:e5:76:9d:e4
[ 6.449981] input: gpio-keys as /devices/platform/gpio-keys/input/input1
[ 6.469299] omap_rtc am33xx-rtc: setting system clock to 2000-01-01 00:00:34 UTC (946684834)
[ 6.570709] UBIFS: start fixing up free space
[ 7.638000] Internal error: Oops - undefined instruction: 0 [#1]
[ 7.644256] Modules linked in:
[ 7.647460] CPU: 0 Not tainted (3.2.0 #22)
[ 7.652099] PC is at wq_worker_sleeping+0x64/0x94

  • 你可以参考一下这个:

    Ubifs文件系统的制作和启动

    http://www.deyisupport.com/question_answer/dsp_arm/sitara_arm/f/25/t/59921.aspx

    wiki上也有个介绍:

    http://processors.wiki.ti.com/index.php/UBIFS_Support#UBIFS_User-space_tools

  • Hi,Steven:

            这两篇文章都看过了,其中Wiki里有句:

    subpage support
    Currently, OMAP NAND drivers do not support subpage, therefore while building and mounting UBI/UBIFS images 

    • subpage-size should set same as page-size
    • offset-of-vid-header should also be set same as page-size
     现在SDK6.0 关于Nand的驱动好像是OMAP的,所以nand选型上是不是不要带子页系统的。
    不好意思,能帮忙看看我上面红色标注的问题吗? 搞了好几天了,论坛资料也看了不少,问题么解决啊。 
    现在有个想法就是 把Nand  换成 EVM 板上的 Micron的型号 MT29F2G08AAD   。 
  • 1. -c 选项的计算?

    2.关于子页系统的问题?

    3.U-boot写入时ECC的设置??

    Steven:问题1,2中的参数设置和NAND flash本身的参数有关,你可以看上面中文文档中的案例,罗列如下:

    GPEVM 板上的 NAND 型号为 MT29F2G08,page size 为 2048B,block size 为
    64x2048B=131072B,block count 为 2048。如果制作针对 GPEVM 板的 ubifs,执行
    如下两条命令:
    1. $ mkfs.ubifs –F -q -r /home/usr/fs -m 2048 -e 126976 -c 2047 -o
    ubifs.img
    参数简介:
    -F:使能"white-space-fixup",如果是通过 u-boot 烧写需要使能此功能。
    -r:待制作的文件系统目录
    -m:NAND FLASH 的最小读写单元,一般为 page size
    -e:LEB size,对于 AM335x 的 NAND driver,为 block size-2x(page size)
    -c:文件系统所占用的最大 block 数,一般小于等于 block count -1
    -o:输出的 ubifs.img 文件
    2. $ ubinize -o ubi.img -m 2048 -p 128KiB ubinize.cfg
    参数简介:
    -p:block size。
    -m:NAND FLASH 的最小读写单元,一般为 page size
    -o:输出的 ubi.img 文件

    Steven:问题3,写入时的ECC设置,都使用BCH8(除了环境变量),可以参考这个链接:http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#ECC_schemes_usage_table

  • HI,steven:

    根据我现在的Nand, 海力士 H27U4G8_6F2D 。 8bit---(2K + 64) bytes x 64 pages x 4096 blocks  ,总共512M B

    类似于你上述的制作命令改为如下:

    sudo ./mkfs.ubifs -r rootfs -F -m 2048 -e 126976 -c 4095 -o ubifs.img 
    sudo ./ubinize -o ubi.img -m 2048 -p 128KiB -O 2048 /home/fan/ti-sdk-am335x-evm-06.00.00.00/tools/ubinize.cfg

    [ubifs] 
    mode=ubi 
    image=ubifs.img 
    vol_id=0 
    vol_size=200MiB 
    vol_type=dynamic 
    vol_name=rootfs 
    vol_flags=autoresize

    UBI image在U-boot中,以BCH8的ECC方式用 nand write写入,UBI fs 还是挂载不起来。

  • 如果你对你的ubifs的制作是比确定的话,可以先排查一下,是不是NAND本身读写就有问题。

    用BCH8写入MLO, u-boot.img, kernel,从NAND启动可以正常工作吗?

  • HI.steven

     我自己的板子,采用的是1.8V接口的8bit nand 美光产品,ID号能在TI 的表中查询到,我的uboot烧录到NAND后怎么没发启动,一直CCCCCC,通过串口或者MMC烧录到Nand中都是一样的结果,但是当我的uboot在RAM中跑起来后,去读写NAND都很正常,写入和读出数据对比都正常,无解了,请大神指点

  • 你确定你的NAND flash启动配置是正确的吗?注意SYSBOOT的pin脚,[8-9]bit为00.

    MLO和uboot是正常的吗?

    另外,只有MLO是跑在芯片的内部RAM中的,UBOOT是跑在DDR中的。你说的读写NAND都很正常,我在想是不是真的正常,如果写进去是错的,读出来是一样错的,是不是也会产生和你描述一样的情况?所以还是先确定NAND flash是OK的,可以正常启动读写比较靠谱。

  • SDK06的U-boot是不需要配置ECC的,你换成镁光的NAND FLASH,UBIFS如果能挂载起来,可能还是要检查下镁光和海力士的NAND有什么大的区别

  • 如果NAND FLASH不能启动,那么还是芯片的ROM code的识别有问题,你可以用仿真器跟踪下看看ROM code返回的错误代码是什么。

  • HI, Jian Zhou:

           问题解决。原来是DDR驱动的问题。Nand和FS 都OK的。   是不是挂载的时候Fs全是Copy到DDR 运行的吗?

       


         另外有个问题,SDK6.0   在/SDK/board-support/linux-3.2.0-psp04.06.00.11 目录下的makefile,   运行make menuconfig 修改内核参数后,如何在make出新的uimage,谢谢~~


  • HI,Jian zhou:

      SDK6.0的U-boot中  Nand 写入时跳过坏区的命令是 nand write.i 吗 ?   感觉没用呢 ...........  

      发现新的 海力士的 Nand 芯片中 就有十几个坏区 ....

      谢谢~

  • menuconfig之后,直接Make uImage就可以啊。

    U-boot初始化NAND的时候,就已经把坏块登记在坏块表里了,NAND的各种操作命令是不需要考虑的

  • Hi Jian 

    U-boot  既然已经标记的坏块的话,那写入的时候  就用   nand write 命令吗?      

      nand write  和nand write.i  nand write.e 他们写入时有什么区别?

  • 你好,SDK06的U-boot里面我看只有NAND write和NAND write raw这两个命令了,区别就是加不加ECC

  • UBI: run torture test for PEB 4
    [ 27.370910] UBI error: torture_peb: read problems on freshly erased PEB 4, must be bad
    [ 27.379211] UBI error: erase_worker: failed to erase PEB 4, error -5
    [ 27.385833] UBI: mark PEB 4 as bad
    [ 27.390014] UBI: 12 PEBs left in the reserve

    UBI出现这样的问题是什么情况,文件系统是能挂载的,好像有很多I/O error  。Nand Flash是海力士的。

  •  mkfs.ubifs命令中-e这个参数怎么计算的

  • 这个和坏块处理机制相关,你可以参考一下这篇文章,里面挺详细的,搜关键字“PEB”挑着看就好了:http://blog.csdn.net/kickxxx/article/details/6707589

  • 这个参数的值就等于你使用NAND flash的block size减去2倍的page size

    前面列举的文档中有介绍,很详细了,还有示例。


  • 例如GPEVM板上的NAND 型号为MT29F2G08,page size为2048B,block size为64x2048B=131072B,那么-e就是131072-4096=126976。

    具体参数要参考你的NAND FLASH的datasheet。

  • 你好,我也遇到了相同的問題,請問具体是DDR哪里的問題?