at91sam9261-ubifs successfully transplanted

Publisher:书香门第Latest update time:2016-10-08 Source: eefocusKeywords:at91sam9261  ubifs Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Based on: linux-3.6.9, 128M Nand, busybox-1.20.2
The ubi command comes from busbox.
As follows:
flash_eraseall /dev/mtd1
 
ubiattach /dev/ubi_ctrl -m 1
 
ubimkvol /dev/ubi0 -s 104857600 -N rootfs
 
mount -t ubifs /dev/ubi0_0 /media

Since ubifs occupies its own space, it is impossible to use all 128M, so only 100M=104857600 Bytes is used temporarily.
~#flash_eraseall /dev/mtd1
Erasing 128 Kibyte @ 7fc0000 - 100% complete.
~ # ubiattach /dev/ubi_ctrl -m 1
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: empty MTD device detected
UBI: max. sequence number:       0
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "Partition 2"
UBI: MTD device size:            127 MiB
UBI: number of good PEBs:        919
UBI: number of bad PEBs:         103
UBI: number of corrupted PEBs:   0
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             906
UBI: total number of reserved PEBs: 13
UBI: number of PEBs reserved for bad PEB handling: 9
UBI: max/mean erase counter: 0/0
UBI: image sequence number:  -267629685
UBI: background thread "ubi_bgt0d" started, PID 868
~ # ubimkvol /dev/ubi0 -s 104857600 -N rootfs
~ # mount -t ubifs /dev/ubi0_0 /media
UBIFS: default file-system created
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   103606272 bytes (101178 KiB, 98 MiB, 803 LEBs)
UBIFS: journal size:       5160960 bytes (5040 KiB, 4 MiB, 40 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  4893579 bytes (4778 KiB)
~#
Use ramdisk to start the kernel, and copy the file system to nand flash via USB.
After ramdisk starts the kernel, insert USB:
mount -t vfat /dev/uba1 /mnt
tar -zxvf /mnt/rootfs-busy1.20.tar.gz -C /media
 
Then, you need to add the following in the file system
:
/sbin/ubiattach /dev/ubi_ctrl -m 1
/bin/mount -t ubifs /dev/ubi0_0 /media/

reboot
u-boot, boot parameters:
setenv bootargs ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs init=/linuxrc console=ttyS0,115200
The kernel is successfully booted.
After the ubifs is successfully transplanted, yaffs2 can be abandoned. After half a month, I finally transplanted the self-made fs and ubifs to at91sam926x, and I am in a good mood.

## Booting kernel from Legacy Image at 20400000 ...

   Image Name:   Linux-3.6.9

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    1990904 Bytes = 1.9 MiB

   Load Address: 20008000

   Entry Point:  20008000

   Verifying Checksum ... OK

   Loading Kernel Image ... OK

OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Booting Linux on physical CPU 0

Initializing cgroup subsys cpu

……

atmel_usart.0: ttyS0 at MMIO 0xfffff200 (irq = 17) is a ATMEL_SERIAL

console [ttyS0] enabled

atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 22) is a ATMEL_SERIAL

atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 23) is a ATMEL_SERIAL

……

Creating 2 MTD partitions on "atmel_nand":

0x000000000000-0x000000040000 : "Partition 1"

0x000000040000-0x000008000000 : "Partition 2"

UBI: attaching mtd1 to ubi0

UBI: physical eraseblock size:   131072 bytes (128 KiB)

UBI: logical eraseblock size:    129024 bytes

UBI: smallest flash I/O unit:    2048

UBI: sub-page size:              512

UBI: VID header offset:          512 (aligned 512)

UBI: data offset:                2048

UBI: max. sequence number:       58

UBI: attached mtd1 to ubi0

UBI: MTD device name:            "Partition 2"

UBI: MTD device size:            127 MiB

UBI: number of good PEBs:        915

UBI: number of bad PEBs:         107

UBI: number of corrupted 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:             39

UBI: total number of reserved PEBs: 876

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

UBI: max/mean erase counter: 2/1

UBI: image sequence number:  1228014130

UBI: background thread "ubi_bgt0d" started, PID 855

……

ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

at91_ohci at91_ohci: AT91 OHCI

at91_ohci at91_ohci: new USB bus registered, assigned bus number 1

at91_ohci at91_ohci: irq 36, io mem 0x00500000

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

rtc-at91sam9 rtc-at91sam9.0: rtc core: registered rtc-at91sam9 as rtc0

i2c /dev entries driver

at91sam9_wdt: sorry, watchdog is disabled

at91_wdt: probe of at91_wdt failed with error -5

softdog: Software Watchdog Timer: 0.08 initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)

……

UBIFS: mounted UBI device 0, volume 0, name "rootfs"

UBIFS: file system size:   108767232 bytes (106218 KiB, 103 MiB, 843 LEBs)

UBIFS: journal size:       5419008 bytes (5292 KiB, 5 MiB, 42 LEBs)

UBIFS: media format:       w4/r0 (latest is w4/r0)

UBIFS: default compressor: lzo

UBIFS: reserved for root:  4952683 bytes (4836 KiB)

VFS: Mounted root (ubifs filesystem) on device 0:8.

Freeing init memory: 120K

running /etc/init.d/rcS

starting udevd...

cannot open /dev/null

udevd (898): /proc/898/oom_adj is deprecated, please use /proc/898/oom_score_adj instead.

/etc/init.d/rcS: line 21: /sbin/ubiattach: not found

dm9000 dm9000.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1

Please press Enter to activate this console.
Keywords:at91sam9261  ubifs Reference address:at91sam9261-ubifs successfully transplanted

Previous article:STM32F4 starts debugging USART, ADC-DMA
Next article:uC/GUI initialization settings based on STM32F10x

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号