织梦CMS - 轻松建站从此开始!

罗索

AM1808 烧写kernel内核以及rootfs文件系统

jackyhwei 发布于 2012-05-14 18:38 点击:次 
这几天上班都是泡在ti的官网上,算是第三方支持网站吧(wiki网),看了各种应用报告并亲自做了实践,得出以下结论,希望你们少走弯路。搞这玩意我linux版本都换了两个fedora和ubuntu都装了,我勒个去。
TAG:

这几天上班都是泡在ti的官网上,算是第三方支持网站吧(wiki网),看了各种应用报告并亲自做了实践,得出以下结论,希望你们少走弯路。搞这玩意我linux版本都换了两个fedora和ubuntu都装了,我勒个去。

具体步骤如下:

一、在uart2启动模式下,通过sfh_OMAP-L138.exe烧写ubl.bin和u-boot.bin文件至nandflash中;

1、sfh_OMAP-L138.exe -erase -targetType INTDEV0 -flashType NAND -p COM1
2、sfh_OMAP-L138.exe -flash -targetType INTDEV0 -flashType NAND -v -p COM1 ubl_INTDEV0_NAND.bin u-boot.bin

二、在linux环境中安装配置好tftp、nfs服务器,并拷贝kernel内核文件至tftp服务器文件夹中,拷贝fs.tar.gz文件至zx目录中;

1、nfs安装配置:

HOST $ sudo apt-get install portmap nfs-kernel-server
HOST $ sudo apt-get install portmap nfs-common

HOST $ sudo gedit /etc/exports
在该文件末尾加上下面这一条语句 /home/toby/toby_nfs *(rw,sync,no_root_squash)

HOST $ sudo /etc/init.d/portmap restart
HOST $ sudo /etc/init.d/nfs-kernel-server restart

测试方式:
HOST $ showmount -e

HOST $ sudo mount 192.168.14.22:/home/zx/zx_nfs/ /mnt

cd到mnt目录下看是否出现zx_nfs目录下面的文件。

HOST $ sudo umount /mnt

2、tftp安装配置:

HOST $ cd /home/zx/
HOST $ mkdir zx_tftp
HOST $ chmod 777 zx_tftp
HOST $ sudo apt-get install xinetd tftpd-hpa tftp-hpa

HOST $ cd /etc/xinetd.d/
HOST $ sudo touch tftpd

HOST $ sudo gedit /etc/xinetd.d/tftpd

service tftp
{
disable = no
socket_type = dgram
wait = no
user = root
protocol = udp
server = /usr/sbin/in.tftpd
server_args = -s /home/zx/zx_tftp
log_on_success = PID HOST DURATION
log_on_failure = HOST
}


HOST $ sudo gedit /etc/inetd.conf
然后加入以下代码
tftp dgram udp wait
root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -
s /home/zx_tftp/zx_tftp


HOST $ sudo gedit /etc/default/tftpd-hpa
修改成以下代码
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /home/zx/zx_tftp"


HOST $ sudo /etc/init.d/xinetd restart
HOST $ sudo /etc/init.d/tftpd-hpa restart

测试方式:
在zx_tftp目录下面新建一个空的test文件

串口终端中输入 tftp 0xc0700000 test


3、通过cp命令拷贝kernel内核文件至zx_tftp目录下,拷贝fs.tar.gz至zx目录下。

三、在nandflash启动器模式下,通过串口超级终端使用setevn命令设置系统参数(在nand flash指定的区域),并通过saveevn命令保存并使用reset命令重启;

输入以下系统参数设置命令:

U-Boot> setenv ethaddr 00:ff:ff:ff:ff:00
U-Boot> setenv nfshost 192.168.14.22
U-Boot> setenv rootpath /home/zx/zx_nfs
U-Boot> setenv serverip 192.168.14.22
U-Boot> setenv ipaddr 192.168.14.20
U-Boot> setenv netmask 255.255.255.0
U-Boot> setenv bootfile uImage
U-Boot> setenv bootcmd 'tftp 0xc0700000 uImage;bootm'
U-Boot> setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=192.168.14.20:192.168.14.22:192.168.14.22:255.255.255.0 root=/dev/nfs nfsroot=${nfshost}:${rootpath},nolock mem=32M

U-Boot> saveenv
U-Boot> reset


备注:如果需要擦除参数区,并设置为默认参数,可以使用命令
U-Boot> nand erase 0 2000
U-Boot> reset

四、在串口终端中使用tftp传输内核镜像文件至内存中再通过nand write.e命令写入nand falsh指定的地址并通过reset重启系统;

进入uboot命令行

U-Boot> tftp 0xc0700000 uImage

U-Boot> nand erase 0x200000 0x230000
U-Boot> nand write.e 0xc0700000 0x200000 0x230000

U-Boot> reset

五、拷贝文件系统镜像fs.bin文件至nfs服务器文件夹中,在串口终端中用root登陆,并使用mtd-util相关命令烧写文件系统至对应的nand flash区域,最后reboot重启系统;

1、拷贝fs文件系统fs.bin至zx_nfs目录下。


2、在linux的终端中运行一下命令

HOST $ cd /home/zx
HOST $ sudo tar -zxvf fs.tar.gz (sudo tar xvfi fs.tar.bz2)
HOST $ sudo rm -r zx_nfs
HOST $ sudo mv fs zx_nfs
HOST $ sudo chmod 777 zx_nfs


3、用root登陆之后,在串口终端中执行以下命令:

TARGET# flash_eraseall /dev/mtd4

TARGET# cd /
TARGET# nandwrite /dev/mtd4 fs.bin

TARGET# reboot


备注:使用命令前用cat /proc/mtd 查看一下mtdchar字符设备

六、在u-boot之后通过setenv命令设置从nand falsh启动,保存之后使用reset命令重启系统,耐心等待进入即可完成。

重启板子,按空格,出现u-boot命令行之后运行一下命令:

U-Boot> setenv bootargs console=ttyS2,115200n8 noinitrd root=/dev/mtdblock4 rootfstype=jffs2 rootwait rw
ip=192.168.14.20:192.168.14.22:192.168.14.22:255.255.255.0 init=/sbin/init
U-Boot> setenv bootcmd 'nboot.e 0xc0700000 0 0x200000; bootm'
U-Boot> saveenv

U-Boot> reset

加上效果:

INIT: Entering runlevel: 5
Starting telnet daemon.
Starting syslogd/klogd: done
.-------.
| | .-.
| | |-----.-----.-----.| | .----..-----.-----.
| | | __ | ---'| '--.| .-'| | |
| | | | | |--- || --'| | | ' | | | |
'---'---'--'--'--. |-----''----''--' '-----'-'-'-'
-' |
'---'
The Angstrom Distribution hawkboard.org ttyS2
Hawkboard.org 2009.03 hawkboard.org ttyS2
hawkboard.org login: root

opulating dev cachemv: cannot rename '/tmp/uname': No such file or directory
logger: mount: mount point /proc/bus/usb does not exist
ALSA: Restoring mixer settings...
/usr/sbin/alsactl: load_state:1608: NOT configuring network interfaces: / is an
NFS mount
No soundcards found...
Tue May 4 05:40:00 UTC 2010
INIT: Entering runlevel: 5
Starting telnet daemon.
modprobe: FATAL: Could not open 'kernel/net/ipv6/ipv6.ko': No such file or direc
tory

Starting syslogd/klogd: done
Starting thttpd.
ti_omapl_pru_suart ti_omapl_pru_suart.1: firmware: requesting PRU_SUART_Emulatio
n.bin
ti_omapl_pru_suart ti_omapl_pru_suart.1: fw size 3172. downloading...
ti_omapl_pru_suart.1: ttySU0 at MMIO 0x1d00000 (irq = 3) is a suart_tty
ti_omapl_pru_suart.1: ttySU1 at MMIO 0x1d00000 (irq = 4) is a suart_tty
ti_omapl_pru_suart.1: ttySU2 at MMIO 0x1d00000 (irq = 5) is a suart_tty
ti_omapl_pru_suart.1: ttySU3 at MMIO 0x1d00000 (irq = 6) is a suart_tty
ti_omapl_pru_suart.1: ttySU4 at MMIO 0x1d00000 (irq = 7) is a suart_tty
ti_omapl_pru_suart.1: ttySU5 at MMIO 0x1d00000 (irq = 8) is a suart_tty
ti_omapl_pru_suart.1: ttySU6 at MMIO 0x1d00000 (irq = 9) is a suart_tty
ti_omapl_pru_suart.1: ttySU7 at MMIO 0x1d00000 (irq = 10) is a suart_tty
ti_omapl_pru_suart ti_omapl_pru_suart.1: ti_omapl_pru_suart device registered(pr
u_clk=150000000, asp_clk=150000000)
Starting lierda_am1808_jzq applicationinsmod: error inserting '/lib/modules/2.6.
33-rc4/kernel/drivers/serial/omapl_pru/suart_emu.ko': -1 File exists
.

#################################################

# #

# #

# #

# # ### ### # # # # ### ### ### ### # #

# # # # # # # # ## ## ## # # # # # # # # ## #

# # # # # # # ## ## # # # # # # # # # # # # #

# # ### # # # # # # # # # ### # # ### # # # #

# # # # # ## ##### # # # # # # # # # # # ## # # # #

# # # # # # # # # # # # # # # # # # # # # # #

# ##### ### ### # # # # # # ### ### ### ### # #

# #

# #

#################################################

http://www.lierda.com lierda ttyS2

lierda 2010.12 lierda ttyS2

lierda login: root
root@lierda:~# cd /dev

(lyzhangxiang)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 [http://www.rosoo.net/a/201205/16007.html]
本文出处:百度博客 作者:lyzhangxiang 原文
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
将本文分享到微信
织梦二维码生成器
推荐内容