转-总结出AM1808烧写kernel内核以及rootfs文件系统的方法

 http://www.cngaosu.com/a/2012/0206/252789.html

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

 

总结出AM1808烧写kernel内核以及rootfs文件系统的方法,主要是参考wiki网和lsd的国网集中器使用说明书一文。

工具/原料

  • VMware-workstation-full-7.0.1.227600.exe

  • am180x-sdk-bin-04.01.00.00.tar.gz

  • am180x-sdk-src-04.01.00.00.tar.gz

  • arago-am1x-demo-image-glibc-ipk-2010.03-da850-omapl138-evm.rootfs.tar.gz

  • DaVinci-PSP-SDK-03.20.00.12.gz

  • OMAP-L138_FlashAndBootUtils_2_23.tar.gz

  • am180x-evm-qsg.pdf

  • AM1x_1_10_00_01_release_notes.pdf

  • 1016316A_AM1808_BSL.rar

  • ubuntu-9.10-desktop-i386.iso

步骤/方法

  1.  一、在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: 5Starting telnet daemon.Starting syslogd/klogd: done.-------.|       |                  .-.|   |   |-----.-----.-----.| |   .----..-----.-----.|       |     | __  |  ---'| '--.|  .-'|     |     ||   |   |  |  |     |---  ||  --'|  |  |  '  | | | |'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'                -'  |                '---'The Angstrom Distribution hawkboard.org ttyS2Hawkboard.org 2009.03 hawkboard.org ttyS2hawkboard.org login: rootroot@hawkboard:~#

     

    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.comlierda ttyS2

    lierda 2010.12 lierda ttyS2

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

参考资料

wiki网站上关于AM1808的相关资料:
http://processors.wiki.ti.com/index.php/Getting_Started_With_the_AM18x_EVM_/_eXperimenter’s_Kit

lierda国网集中器使用说明书:
LSDDM-AMR1808-V1 使用说明.pdf

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值