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).
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.
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
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Summary: Advanced IO Operation Software SPI Performance
- Detailed explanation of MSP430F149 serial port receiving and sending program
- 【Evaluation of SGP40】-SGP40 temperature and humidity test
- When choosing crystal oscillators, should we choose imported or domestic ones?
- How to use an oscilloscope?
- Does anyone know how to write a DLL for a card reader/writer? Is there any relevant information?
- Still using the burning method to test fabric composition? Now there is a new method.
- How to pair MCU with FPGA to improve system efficiency?
- [National Technology N32G457 Review] 1. Brief review of the first power-on
- About TAS5805M Stereo Class-D Amplifier