Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

Problem with UBIFS (NOR flash) in uClinux



I'm trying use UBIFS in my board because I had problem with JFFS2, after some writes in JFFS2 I can't write anymore and shows a message: 

MTD do_write_oneword(): software timeout 

MTD do_write_oneword(): software timeout 

MTD do_write_oneword(): software timeout 

MTD do_write_oneword(): software timeout 

Write of 188 bytes at 0x005fc078 failed. returned -5, retlen 0 

Not marking the space at 0x005fc078 as dirty because the flash driver returned o 




Because this problem I'm trying UBIFS. 



I use a NOR FLASH with 8MB (S29JL064H) and uClinux kernel 2.30 

In the kernel is enabled  



config.c (Flash partitions) 

.name = "romfs", 

.size = 0x600000, 

.offset = 0x200000, 


.name = "loader/kernel", 

.size = 0x200000, 

.offset = 0, 


--- Memory Technology Device (MTD) support  

[ ] Debugging  

< > MTD concatenating support  


[*] MTD partitioning support  



<*> Enable UBI  

(4096) UBI wear-leveling threshold  



And in Miscellaneous filesystems 


<*> UBIFS file system support  



In the kernel boot : 

(rootfstype=ubifs ubi.mtd=0 root=ubi0:rootfs) Default kernel command 




For create a ubifs image I used 

cat ubinize.cfg  












mkfs.ubifs -d romfs -m 1 -e 65408 -c 128 -o ubifs.img -D device_table.txt  

ubinize -o ubi.img -m 1 -p 64KiB -v ubinize.cfg  


Everthing is allrigth , to create a .flash I use the commands 


bin2flash --input=ubi.img --location=0x200000 --output=ubi.flash 

nios2-flash-programmer --base=0x2000000 --erase-all (format flash) 

nios2-flash-programmer --base=0x2000000 ubi.flash 


After this I tried boot with my kernel 

nios2-download -g zImage 


After the boot I have a kernel panic 




uClinux/Nios II 

Built 1 zonelists in Zone order, mobility grouping off. Total pages: 2032 

Kernel command line: rootfstype=ubifs ubi.mtd=0 root=ubi0:rootfs 


PID hash table entries: 32 (order: 5, 128 bytes) 

Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) 

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) 

Memory available: 5804k/2107k RAM, 0k/0k ROM (1747k kernel code, 360k data) 

Calibrating delay loop... 63.89 BogoMIPS (lpj=319488) 

Mount-cache hash table entries: 512 

net_namespace: 264 bytes 

NET: Registered protocol family 16 

init_BSP(): registering device resources 

bio: create slab <bio-0> at 0 

NET: Registered protocol family 2 

IP route cache hash table entries: 1024 (order: 0, 4096 bytes) 

TCP established hash table entries: 512 (order: 0, 4096 bytes) 

TCP bind hash table entries: 512 (order: -1, 2048 bytes) 

TCP: Hash tables configured (established 512 bind 512) 

TCP reno registered 

NET: Registered protocol family 1 

io scheduler noop registered 

io scheduler deadline registered (default) 

ttyS0 at MMIO 0x2810000 (irq = 3) is a Altera UART 

console [ttyS0] enabled 

ttyS1 at MMIO 0x2810060 (irq = 4) is a Altera UART 

IIPDEV Driver Initialized 

SYSDEV Driver Initialized 

TXTABLEDEV Driver Initialized 

RXTABLEDEV Driver Initialized 

ALARMDEV Driver Initialized 

smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <

eth0: SMC91C11xFD (rev 2) at 82800300 IRQ 2 [nowait] 

eth0: Ethernet addr: 00:11:22:33:44:55 

physmap platform flash device: 00800000 at 02000000 

physmap-flash.0: Found 1 x16 devices at 0x0 in 8-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

physmap-flash.0: CFI does not contain boot bank location. Assuming top. 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

cmdlinepart partition parsing not available 

RedBoot partition parsing not available 

Using physmap partition information 

Creating 2 MTD partitions on "physmap-flash.0": 

0x000000200000-0x000000800000 : "romfs" 

0x000000000000-0x000000200000 : "loader/kernel" 

UBI: attaching mtd0 to ubi0 

UBI: physical eraseblock size: 65536 bytes (64 KiB) 

UBI: logical eraseblock size: 65408 bytes 

UBI: smallest flash I/O unit: 1 

UBI: VID header offset: 64 (aligned 64) 

UBI: data offset: 128 

UBI: volume 0 ("rootfs") re-sized from 65 to 92 LEBs 

UBI: attached mtd0 to ubi0 

UBI: MTD device name: "romfs" 

UBI: MTD device size: 6 MiB 

UBI: number of good PEBs: 96 

UBI: number of bad PEBs: 0 

UBI: max. allowed volumes: 128 

UBI: wear-leveling threshold: 4096 

UBI: number of internal volumes: 1 

UBI: number of user volumes: 1 

UBI: available PEBs: 0 

UBI: total number of reserved PEBs: 96 

UBI: number of PEBs reserved for bad PEB handling: 0 

UBI: max/mean erase counter: 1/0 

UBI: background thread "ubi_bgt0d" started, PID 20 

m25p80 spi0.0: m25p16 (2048 Kbytes) 

Creating 1 MTD partitions on "m25p80": 

0x000000000000-0x000000200000 : "fpga configuration" 

i2c /dev entries driver 

i2c-0: I2C OpenCores Bus Adapter, MMIO = 0x20, irq = 0 

i2c-0: Using 16003kHz clock source 

TCP cubic registered 

NET: Registered protocol family 17 

UBIFS error (pid 1): ubifs_check_node: bad CRC: calculated 0x914d95fa, read 0x3c 

UBIFS error (pid 1): ubifs_check_node: bad node at LEB 0:0 

UBIFS error (pid 1): ubifs_read_node: expected node type 6 

VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0) 

Please append a correct "root=" boot option; here are the available partitions: 

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) 





Someone have some ideia? 




Caio Pereira
0 Kudos
0 Replies