Embedded Linux + UBI root file system transplantation based on AT91SAM9X35EK is successful

Publisher:muhaoying2017Latest update time:2022-07-05 Source: csdn Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

After nearly a month of study and practice, I finally ran the Linux system on the AT91SAM9X35EK development board, using the UBI file system. The development environment and constant compilation, searching for information, burning verification, and downloading related software took up a lot of time, but by constantly overcoming difficulties, we can keep moving forward. The road is long, but it requires patience to keep going.


The development environment is:

CentOS6.5 Linux virtual machine.

Hardware: AT91SAM9X35EK


NandFlash boot (Bootstrap+Uboot+Linux Kernel+UBI root file system are all burned into NandFlash).


Use the newer AT91Bootstrap and Uboot.

Use the newer and more stable Linux version 2.6.39 (ATmel officially provides relevant files for AT91SAM9X35EK for easy porting).


The time is mainly stuck in the preparation and support of the file system, which is always unsuccessful. The reason is that PMECC verification needs to be turned on, and a Trimffs option needs to be added when burning the file system (I use Jlink+SAMBA2.15 to burn all files here).

4e56ead74e52d5955f76f8f40834edf3.png

The following is the console information when it runs.

AT91Bootstrap 3.6.0

NAND: Done to load image

U-Boot 2014.04 (Feb 15 2016 - 14:56:42)

CPU: AT91SAM9X35

Crystal frequency: 12 MHz

CPU clock: 400 MHz

Master clock: 133.333 MHz

DRAM: 128 MiB

WARNING: Caches not enabled

NAND: 256 MiB

MMC:mci:0

*** Warning - bad CRC, using default environment

In: serial

Out: serial

Err: serial

Net: macb0

Warning: failed to set MAC address

Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x200000, size 0x300000

Skipping bad block 0x00320000

3145728 bytes read: OK

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

Image Name: Linux-2.6.39

Image Type: ARM Linux Kernel Image (uncompressed)

Data Size: 1979360 Bytes = 1.9 MiB

Load Address: 20008000

Entry Point: 20008000

Verifying Checksum ... OK

Loading Kernel Image ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Linux version 2.6.39 (root@zhangsz.zhangsz) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #3 Mon Feb 15 16:32:15 CST 2016

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

CPU: VIVT data cache, VIVT instruction cache

Machine: Atmel AT91SAM9X5-EK

Memory policy: ECC disabled, Data cache writeback

Clocks: CPU 400 MHz, master 133 MHz, main 12.000 MHz

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512

Kernel command line: mem=128M console=ttyS0,115200 mtdparts=atmel_nand:8M(bootstrap/uboot/kernel)ro,-(rootfs) root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs

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

Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)

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

Memory: 128MB = 128MB total

Memory: 125928k/125928k available, 5144k reserved, 0K highmem

Virtual kernel memory layout:

vector : 0xffff0000 - 0xffff1000 ( 4 kB)

fixmap: 0xfff00000 - 0xfffe0000 ( 896 kB)

DMA: 0xff000000 - 0xffe00000 (14 MB)

vmalloc: 0xc8800000 - 0xfee00000 (870 MB)

lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)

modules: 0xbf000000 - 0xc0000000 (16 MB)

.init : 0xc0008000 - 0xc0028000 ( 128 kB)

.text : 0xc0028000 - 0xc03a515c (3573 kB)

.data : 0xc03a6000 - 0xc03cc8a0 ( 155 kB)

NR_IRQS:192

AT91: 128 gpio irqs in 4 banks

Console: colour dummy device 80x30

console [ttyS0] enabled

Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

NET: Registered protocol family 16

AT91: CM rev B and higher

AT91: EK rev B and higher

AT91: Power Management (with slow clock mode)

AT91: Starting after power-restored wakeup

bio: create slab at 0

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

i2c-gpio i2c-gpio.0: using pins 62 (SDA) and 63 (SCL)

at_hdmac at_hdmac.0: Atmel AHB DMA Controller ( cpy slave ), 8 channels

at_hdmac at_hdmac.1: Atmel AHB DMA Controller ( cpy slave ), 8 channels

Switching to clocksource tcb_clksrc

NET: Registered protocol family 2

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

TCP established hash table entries: 4096 (order: 3, 32768 bytes)

TCP bind hash table entries: 4096 (order: 2, 16384 bytes)

TCP: Hash tables configured (established 4096 bind 4096)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

NetWinder Floating Point Emulator V0.97 (double precision)

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

msgmni has been set to 245

io scheduler noop registered (default)

atmel_hlcdfb atmel_hlcdfb_base.0: 1500KiB frame buffer at 27a00000 (mapped at ffc00000)

atmel_hlcdfb atmel_hlcdfb_base.0: fb0: Atmel LCDC at 0xf8038000 (mapped at c8864000), irq 25

atmel_hlcdfb atmel_hlcdfb_ovl.0: 1500KiB frame buffer at 27000000 (mapped at ffa00000)

atmel_hlcdfb atmel_hlcdfb_ovl.0: fb1: Atmel LCDC at 0xf8038100 (mapped at c886c100), irq -6

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

atmel_usart.1: ttyS1 at MMIO 0xf801c000 (irq = 5) is a ATMEL_SERIAL

brd: module loaded

loop: module loaded

ssc ssc.0: Atmel SSC device at 0xc8880000 (irq 28)

at24 0-0051: 65536 byte 24c512 EEPROM, writable, 128 bytes/write

atmel_nand atmel_nand: Using dma0chan0 for DMA transfers.

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)

atmel_pmecc_init_params

Scanning device for bad blocks

Bad eraseblock 25 at 0x000000320000

Bad eraseblock 1339 at 0x00000a760000

Bad eraseblock 1759 at 0x00000dbe0000

2 cmdlinepart partitions found on MTD device atmel_nand

Creating 2 MTD partitions on "atmel_nand":

0x000000000000-0x000000800000 : "bootstrap/uboot/kernel"

0x000000800000-0x000010000000 : "rootfs"

UBI: attaching mtd1 to ubi0

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

UBI: logical eraseblock size: 126976 bytes

UBI: smallest flash I/O unit: 2048

UBI: VID header offset: 2048 (aligned 2048)

UBI: data offset: 4096

UBI: max. sequence number: 7

UBI: attached mtd1 to ubi0

UBI: MTD device name: "rootfs"

UBI: MTD device size: 248 MiB

UBI: number of good PEBs: 1982

UBI: number of bad PEBs: 2

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: 0

UBI: total number of reserved PEBs: 1982

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

UBI: max/mean erase counter: 2/0

UBI: image sequence number: 42708581

UBI: background thread "ubi_bgt0d" started, PID 355

CAN device driver interface

at91_can at91sam9x5_can.1: can0: Features changed: 0x00004804 -> 0x00004004

at91_can at91sam9x5_can.1: device registered (reg_base=c88e0000, irq=30)

macb macb.0: invalid hw address, using random

macb macb.0: eth0: Features changed: 0x00004800 -> 0x00004000

MACB_mii_bus: probed

eth0: Atmel MACB at 0xf802c000 irq 24 (f6:84:b3:06:57:65)

eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

atmel-ehci atmel-ehci: Atmel EHCI UHP HS

atmel-ehci atmel-ehci: new USB bus registered, assigned bus number 1

atmel-ehci atmel-ehci: irq 22, io mem 0x00700000

atmel-ehci atmel-ehci: USB 2.0 started, EHCI 1.00

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 3 ports detected

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 2

at91_ohci at91_ohci: irq 22, io mem 0x00600000

hub 2-0:1.0: USB hub found

hub 2-0:1.0: 3 ports detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

usbcore: registered new interface driver libusual

atmel_usba_udc atmel_usba_udc: MMIO registers at 0xf803c000 mapped at c88ee000

atmel_usba_udc atmel_usba_udc: FIFO at 0x00500000 mapped at c8900000

input: gpio-keys as /devices/platform/gpio-keys/input/input0

atmel_tsadcc atmel_tsadcc: Master clock is set at: 133333333 Hz

atmel_tsadcc atmel_tsadcc: Prescaler is set at: 32

input: atmel touch screen controller as /devices/platform/atmel_tsadcc/input/input1

at91_rtc at91_rtc: rtc core: registered at91_rtc as rtc0

AT91 Real Time Clock driver.

i2c /dev entries driver

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

nf_conntrack version 0.5.0 (1967 buckets, 7868 max)

ip_tables: (C) 2000-2006 Netfilter Core Team

TCP cubic registered

NET: Registered protocol family 17

can: controller area network core (rev 20090105 abi 8)

NET: Registered protocol family 29

can: raw protocol (rev 20090105)

Registering the dns_resolver key type

at91_rtc at91_rtc: setting system clock to 2007-01-01 00:00:11 UTC (1167609611)

atmel_mci atmel_mci.0: Using dma0chan1 for DMA transfers

atmel_mci atmel_mci.0: Atmel MCI controller at 0xf0008000 irq 12, 1 slots

UBIFS: recovery needed

UBIFS: recovery completed

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

UBIFS: file system size: 236302336 bytes (230764 KiB, 225 MiB, 1861 LEBs)

UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)

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

UBIFS: default compressor: lzo

UBIFS: reserved for root: 0 bytes (0 KiB)

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

Freeing init memory: 128K

#-----Start /etc/init.d/rcS

***************************************************

Start Linux

2016 02 15

AT91SAM9X35ek

***************************************************

Please press Enter to activate this console. / #

/#ls

bin dev home linuxrc proc sbin tmp var

boot etc lib mnt root sys usr

/ # cd home/

/home#ls

hello.txt

/home # cat hello.txt

Can't the saved content be saved? What about restarting?

/home #


Next, I think, I need to constantly summarize and practice, and constantly improve the whole process. Further study Linux drivers, user program operation, network applications, human-computer interface, etc.


Sometimes, a small problem or mistake will make you discouraged and make you make excuses, but as long as you keep trying, keep classifying the information, and keep sorting out the correct ideas, you will keep moving forward. Bold practice and bold attempts can bring good results. I think being able to port Linux is just the first step to enter Linux. You still need to constantly modify and reduce the kernel, optimize the startup time, add user programs, etc., to achieve what you want.

[1] [2]
Reference address:Embedded Linux + UBI root file system transplantation based on AT91SAM9X35EK is successful

Previous article:Create Linux target file for AT91SAM9X5-EK development board
Next article:Transplantation of JFFS2 File System

Recommended ReadingLatest update time:2024-11-23 11:11

AT91SAM9X5EK transplant linux4sam6.1 package
AT91Bootstrap 3.8.13 (Thu Oct 17 17:21:19 CST 2019) 1-Wire: Loading 1-Wire information … 1-Wire: ROM Searching … Done, 0 1-Wire chips found WARNING: 1-Wire: No 1-Wire chip found 1-Wire: Using default information 1-Wire: Board sn: 0x4010425 revision: 0x8421 NAND: ONFI flash detected chip- numblocks = 0x800 ch
[Microcontroller]
AT91SAM9X5EK transplant linux4sam6.1 package
Implementation of touch screen driver in Linux (2) - based on s3c6410 processor
The previous article mainly talked about the module loading and unloading functions of the touch screen device as a platform device in Linux, as well as the corresponding probe function and remove function. This article will talk about the two interrupt handling functions registered in the probe function. 1. Let's t
[Microcontroller]
Implementation of touch screen driver in Linux (2) - based on s3c6410 processor
Creating an ARM Linux cross-compilation environment
1. Preparation                First, we need a PC running Linux operating system to complete our compilation work.        Secondly, we need to prepare the following source files.          1. Source file preparation          binutils-2.14.tar.gz           ftp://ftp.gnu.org/gnu/binutils/binutils-2.14.tar.gz      
[Microcontroller]
Understand the character device driver development process from the Linux kernel LED driver
development environment Environmental Statement details Remarks operating system Ubunut 18.04.3 LTS Development board S3C2440(JZ2440-V3) kernel version linux-3.4.2 Official website address busybox version busybox-1.22.1 Official website address translater arm-linux-gcc-4.4.3 download link compiler p
[Microcontroller]
Understand the character device driver development process from the Linux kernel LED driver
S3C6410 Embedded Application Platform Construction (VI) - Linux-3.14.4 Ported to OK6410 (Yaffs2 File System Ported)
I personally think that using the Yaffs2 file system on nandflash is a good solution, but the latest Linux does not support the Yaffs2 file system, and you need to patch the kernel yourself. However, as mentioned earlier, due to differences and compatibility issues between kernels, various compilation problems will
[Microcontroller]
S3C6410 Embedded Application Platform Construction (VI) - Linux-3.14.4 Ported to OK6410 (Yaffs2 File System Ported)
Embedded Linux + UBI root file system transplantation based on AT91SAM9X35EK is successful
After nearly a month of study and practice, I finally ran the Linux system on the AT91SAM9X35EK development board, using the UBI file system. The development environment and constant compilation, searching for information, burning verification, and downloading related software took up a lot of time, but by constantly
[Microcontroller]
Embedded Linux + UBI root file system transplantation based on AT91SAM9X35EK is successful
Embedded Linux driver based on S3C2440 - Interpretation of SPI subsystem (Part 3)
This series of articles will be divided into four parts:    In the first part, the SPI subsystem is described as a whole, the relevant data structure of SPI is given, and finally the registration of SPI bus is described .    In the second part, this article will describe the SPI master controller driver. Embedded Lin
[Microcontroller]
Design of control system driver based on ARM+Linux 2.6 kernel
0 Introduction The development of embedded systems has its own special application occasions and specific functions, and the embedded Linux operating system is favored by the industry because of its open source, wide processor support and easy portability. AT91RM9200 is a 32-bit RISC microprocessor based on the ARM92
[Microcontroller]
Design of control system driver based on ARM+Linux 2.6 kernel
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号