mini2440上烧写Angstrom(GTK)版本内核

前天一不小心,将自己的GT2440开发板烧写,而且还是CPU烧了。于是只能从网上回收了一块二手的mini2440开发板(SDRAM:64M,NANDFLASH:64M,LCD:N35),想起以前在google上看到过的一篇博客《mini2440上运行Angstrom(GTK)》,于是想试试,就开始翻墙上谷歌,把那些资源下载下来了,然后开始烧写尝试,中间遇到各种问题,而且还没资料,不过最终还是解决了。下面把我移植的具体过程和相关资源分享给大家:
资源下载地址:http://download.csdn.net/detail/pengrui18/9360729
u-boot:
1)下载u-boot的BIN文件:u-boot-mini2440-git-r22.bin.bz2,如果想自己移植或者nandflash大小不是64M的,可以下载u-boot-mini2440.tar.gz,然后自己修改,然后编译,具体不详细介绍。
2)烧写
解压 u-boot-mini2440-git-r22.bin.bz2,获得 u-boot-mini2440-git-r22.bin文件.
连接上mini2440开发板的USB线,串口线,网线,将启动开关S2切换至Norflash启动:

 ##### FriendlyARM BIOS for 2440 #####
[x] bon part 0 320k 2368k
[v] Download vivi 
[k] Download linux kernel 
[y] Download root_yaffs image 
[c] Download root_cramfs image 
[a] Absolute User Application
[n] Download Nboot 
[e] Download Eboot 
[i] Download WinCE NK.nb0 
[w] Download WinCE NK.bin 
[d] Download & Run 
[z] Download zImage into RAM 
[g] Boot linux from RAM 
[f] Format the nand flash 
[p] Partition for Linux 
[b] Boot the system 
[s] Set the boot parameters 
[t] Print the TOC struct of wince 
[u] Backup NAND Flash to HOST through USB(upload) 
[r] Restore NAND Flash from HOST through USB 
[q] Goto shell of vivi 
Enter your selection: n
USB host is connected. Waiting a download.
Now, Downloading [ADDRESS:30000000h,TOTAL:245770]
RECEIVED FILE SIZE:  245770 (240KB/S, 1S)
Downloaded file at 0x30000000, size = 245760 bytes
Erase flash ok: start address = 0x0, size = 0x3c000
Write to flash ok: start address = 0x0, size = 0x3c000

下载完成之后,将S2开关切换至NandFlash启动,然后重启上电:

U-Boot 1.3.2-moko12 (Apr  4 2009 - 14:15:08)

I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  64 MiB
Found Environment offset in OOB..
USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot:  0 
//清空nandlflash所有数据,包括坏块标记table
MINI2440 # nand scrub
NAND scrub: device 0 whole chip
Warning: scrub option will erase all factory set bad blocks!
         There is no reliable way to recover them.
         Use this command only for testing purposes if you
         are sure of what you are doing!
Really scrub this NAND flash? <y/N>
Erasing at 0x3ffc000 -- 100% complete.
Bad block table not found for chip 0
Bad block table not found for chip 0
OK
//扫描并标记坏块
MINI2440 # nand createbbt
Create BBT and erase everything ? <y/N>
Skipping bad block at  0x03ff0000                                            
Skipping bad block at  0x03ff4000                                            
Skipping bad block at  0x03ff8000                                            
Skipping bad block at  0x03ffc000                                            

Creating BBT. Please wait ...Bad block table not found for chip 0
Bad block table not found for chip 0
Bad block table written to 0x03ffc000, version 0x01
Bad block table written to 0x03ff8000, version 0x01
//设置IP地址,用于tftp烧写,serverip:电脑IP地址,ipaddr:mini2440的IP地址
MINI2440 # setenv ipaddr 192.168.1.230
MINI2440 # setenv serverip 192.168.1.155
//打开上位机的tftp服务,设置相关参数(我使用的是tftpd32软件),重新烧写u-boot(因为vivi中烧写的u-boot,没有在oob区写入ECC数据,在内核启动后,文件系统中检测时,会报错)
MINI2440 # tftp 0x32000000 u-boot-mini2440-git-r22.bin
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
TFTP from server 192.168.1.155; our IP address is 192.168.1.230
Filename 'u-boot-mini2440-git-r22.bin'.
Load address: 0x32000000
Loading: checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
T #################
done
Bytes transferred = 245760 (3c000 hex)
//写入u-boot数据至nandflash
MINI2440 # nand write 0x32000000 0x0 0x40000

NAND write: device 0 offset 0x0, size 0x40000
 262144 bytes written: OK
//复位mini2440开发板
MINI2440 #reset
U-Boot 1.3.2-moko12 (Apr  4 2009 - 14:15:08)

I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  64 MiB
Found Environment offset in OOB..
*** Warning - bad CRC or NAND, using default environment

USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot:  0 
//设置环境变量地址
MINI2440 # dynenv set 40000
device 0 offset 0x40000, size 0x3fc0000
45 4e 56 30 - 00 00 04 00
MINI2440 # setenv ipaddr 192.168.1.230
MINI2440 # setenv serverip 192.168.1.155
//保存修改后的变量
MINI2440 # saveenv 
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
//设置bootcmd命令参数
MINI2440 # setenv bootcmd 'nboot.e kernel ; bootm'
//下载并解压uImage-2.6.29+git-r4-mini2440.bin.bz2文件,获得uImage-2.6.29+git-r4-mini2440.bin文件,拷贝uImage-2.6.29+git-r4-mini2440.bin文件,并重命名为:uImage-2.6.29+git-r4-mini2440-new.bin
使用hxd(十六进制数据编辑器软件)打开uImage-2.6.29+git-r4-mini2440-new.bin,将前64字节修改:
//未修改的uImage-2.6.29+git-r4-mini2440-new.bin文件前64字节
27 05 19 56 AB 6A 96 00 49 D5 0B 9F 00 1D 8F 94
20 00 80 00 20 00 80 00 4B AB F7 A6 05 02 02 00 
41 6E 67 73 74 72 6F 6D 2F 32 2E 36 2E 32 39 2B 
67 69 74 2F 6D 69 6E 69 32 34 34 30 00 00 00 00
//修改后的uImage-2.6.29+git-r4-mini2440-new.bin文件前64字节
27 05 19 56 0C 74 66 46 56 67 08 42 00 1D 8F 94 
30 00 80 00 30 00 80 00 4B AB F7 A6 05 02 02 00 
41 6E 67 73 74 72 6F 6D 2F 32 2E 36 2E 32 39 2B 
67 69 74 2F 6D 69 6E 69 32 34 34 30 00 00 00 00
//上述主要是将linux内核的启动参数Load Address和Entry Point由20008000修改为30008000
//tftp下载uImage-2.6.29+git-r4-mini2440-new.bin
MINI2440 # tftp 0x32000000 uImage-2.6.29+git-r4-mini2440-new.bin
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
TFTP from server 192.168.1.155; our IP address is 192.168.1.230
Filename 'uImage-2.6.29+git-r4-mini2440-new.bin'.
Load address: 0x32000000
Loading: checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
T checksum bad
T #################################################################
         #################################################################
         ##
done
Bytes transferred = 1937364 (1d8fd4 hex)
//写入uImage数据至nandflash
MINI2440 # nand write 0x32000000 0x60000 0x200000
NAND write: device 0 offset 0x60000, size 0x200000
 2097152 bytes written: OK
//下载并解压Angstrom-mini2440-image-glibc-ipk-2009.X-test-20090405-mini2440.rootfs.jffs2.bz2文件,获得Angstrom-mini2440-image-glibc-ipk-2009.X-test-20090405-mini2440.rootfs.jffs2,将该文件重命名为rootfs.jffs2
//tftp将rootfs.jffs2数据写入mini开发板
MINI2440 # tftp 0x31000000 rootfs.jffs2
dm9000 i/o: 0x20000300, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
TFTP from server 192.168.1.155; our IP address is 192.168.1.230
Filename 'rootfs.jffs2'.
Load address: 0x31000000
Loading: checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
checksum bad
T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###########################################
done
Bytes transferred = 24477696 (1758000 hex)
MINI2440 # nand write 0x31000000 0x560000 0x1758000
//写入rootfs.jffs2数据至nandflash
NAND write: device 0 offset 0x560000, size 0x1758000
 24477696 bytes written: OK
MINI2440 # reset
此时,mini2440可以正常启动,启动信息如下:
U-Boot 1.3.2-moko12 (Apr  4 2009 - 14:15:08)

I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  Bad block table not found for chip 0
Bad block table not found for chip 0
64 MiB
Found Environment offset in OOB..
USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot:  0 

Loading from NAND 64MiB 3,3V 8-bit, offset 0x60000
   Image Name:   Angstrom/2.6.29+git/mini2440
   Created:      2015-12-08  16:41:38 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1937300 Bytes =  1.8 MB
   Load Address: 30008000
   Entry Point:  30008000
## Booting kernel from Legacy Image at 32000000 ...
   Image Name:   Angstrom/2.6.29+git/mini2440
   Created:      2015-12-08  16:41:38 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1937300 Bytes =  1.8 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux............................................................................................................................. done, booting the kernel.
Linux version 2.6.29 (michel@yap) (gcc version 4.2.4) #1 Thu Apr 2 19:52:50 BST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: MINI2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: root=/dev/mtdblock3 rootfstype=jffs2 console=ttySAC0,115200
irq: clearing pending status 02000000
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 60736KB available (3580K code, 408K data, 144K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 672 bytes
NET: Registered protocol family 16
MINI2440: Option string mini2440=0tb
MINI2440: LCD [0:240x320] 1:800x480 2:1024x768
s3c24xx-pwm s3c24xx-pwm.1: tin at 25312500, tdiv at 25312500, tin=divclk, base 8
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
msgmni has been set to 118
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 60x53
fb0: s3c2410fb frame buffer device
s3c2440-uart.0: ttySAC0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: ttySAC1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttySAC2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
dm9000 Ethernet Driver, V1.31
eth0 (dm9000): not using net_device_ops yet
eth0: dm9000e at c486a300,c486e304 IRQ 51 MAC: 08:08:11:18:12:27 (chip)
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=1, 9ns Twrph0=3 29ns, Twrph1=2 19ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Creating 4 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000040000 : "u-boot"
ftl_cs: FTL header not found.
0x000000040000-0x000000060000 : "u-boot-env"
ftl_cs: FTL header not found.
0x000000060000-0x000000560000 : "kernel"
ftl_cs: FTL header not found.
0x000000560000-0x000004000000 : "root"
ftl_cs: FTL header not found.
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
s3c2440-usbgadget s3c2440-usbgadget: S3C2440: increasing FIFO to 128 bytes
mice: PS/2 mouse device common for all mice
input: gpio-keys as /devices/platform/gpio-keys/input/input0
s3c2440-ts s3c2440-ts: Starting
  Created group ts filter len 12 depth 2 close 10 thresh 6
  Created Median ts filter len 20 depth 2 dec 24
  Created Mean ts filter len 4 depth 2 thresh 65535
  Created Linear ts filter depth 2
s3c2440-ts s3c2440-ts: 4 filter(s) initialized
s3c2440-ts s3c2440-ts: successfully loaded
input: s3c2410 TouchScreen as /devices/virtual/input/input1
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 395 KHz
at24 0-0050: 1024 byte 24c08 EEPROM (writable)
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
cpuidle: using governor ladder
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mapped channel 0 to 0
s3c2440-sdi s3c2440-sdi: powered down.
s3c2440-sdi s3c2440-sdi: initialisation done.
Registered led device: led1
Registered led device: led2
Registered led device: led3
Registered led device: led4
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.18a.
No device for DAI UDA134X
No device for DAI s3c24xx-i2s
S3C24XX_UDA134X SoC Audio driver
UDA134X SoC Audio Codec
asoc: UDA134X <-> s3c24xx-i2s mapping ok
ALSA device list:
  #0: S3C24XX_UDA134X (UDA134X)
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
s3c2410-rtc s3c2410-rtc: setting system clock to 2015-12-09 11:36:28 UTC (1449660988)
Empty flash at 0x0175605c ends at 0x01756200
VFS: Mounted root (jffs2 filesystem) on device 31:3.
Freeing init memory: 144K
INIT: version 2.86 booting
startup /etc/rcS.d/S01psplash
startup /etc/rcS.d/S02banner
startup /etc/rcS.d/S03sysfs
startup /etc/rcS.d/S03udev
Starting udevudevd version 124 started

startup /etc/rcS.d/S06alignment
startup /etc/rcS.d/S10checkroot
Remounting root file system...
startup /etc/rcS.d/S20modutils.sh
Bluetooth: Core ver 2.14
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP ver 2.11
Bluetooth: L2CAP socket layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.10
startup /etc/rcS.d/S30procps.sh
startup /etc/rcS.d/S30ramdisk
startup /etc/rcS.d/S35mountall.sh
startup /etc/rcS.d/S37populate-volatile.sh
startup /etc/rcS.d/S38devpts.sh
startup /etc/rcS.d/S39alsa-state
ALSA: Restoring mixer settings...
startup /etc/rcS.d/S39hostname.sh
startup /etc/rcS.d/S40networking
Configuring network interfaces... No state is present for card S3C24XXUDA134X
eth0: link down
eth0      no wireless extensions.

udhcpc (v1.13.2) started
run-parts: /etc/udhcpc.d/00avahi-autoipd exited with code 1
Sending discover...
eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
Sending discover...
Sending discover...
No lease, failing
done.
startup /etc/rcS.d/S43portmap
Starting portmap daemon: portmap.
startup /etc/rcS.d/S45mountnfs.sh
startup /etc/rcS.d/S55bootmisc.sh
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
startup /etc/rcS.d/S97blueprobe
startup /etc/rcS.d/S99finish.sh
startup /etc/rcS.d/S99zzapsplash
INIT: Entering runlevel: 5
startup /etc/rc5.d/S10dropbear
Starting Dropbear SSH server: dropbear.
startup /etc/rc5.d/S20dbus-1
Starting system message bus: dbus.
startup /etc/rc5.d/S20syslog
Starting syslogd/klogd: done
startup /etc/rc5.d/S21avahi-daemon
`* Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
eth0: link down
Timeout reached while wating for return value
Could not receive return value from daemon process.
 *[fail]
startup /etc/rc5.d/S50usb-gadget
startup /etc/rc5.d/S90i2c
Starting i2c...
FATAL: Module i2c_pxa not found.
FATAL: Module i2c_dev not found.
startup /etc/rc5.d/S99rmnologin
startup /etc/rc5.d/S99zzapsplash

.-------.                                           
|       |                  .-.                      
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
               -'  |
               '---'

The Angstrom Distribution mini2440 ttySAC0

Angstrom 2009.X-test-20090402 mini2440 ttySAC0

mini2440 login: root
root@mini2440:~# 

LCD显示屏截图:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值