您尚未登录。

楼主 #1 2020-05-09 21:18:03

缥缈九哥
会员
注册时间: 2020-05-09
已发帖子: 76
积分: 92

基于9GSAM9260EK开发板的arm-linux开发过程

一,准备VMWARE+LINUX安装软件包

1,在http://www.ubuntu.com/getubuntu/download
    下载Ubuntu 7.10的X86桌面版本的ISO文件:
    http://mirror.rootguide.org/ubuntu-releases/gutsy/ubuntu-7.10-desktop-i386.iso
1,在http://releases.ubuntu.com/releases/.pool/
    下载Ubuntu 7.10的X86桌面版本的ISO文件:
    ubuntu-7.10-desktop-i386.iso
2,在http://www.crsky.com/soft/8612.html
    下载VMware Workstation v5.5.3 Build 34685 及 汉化补丁
    VMware-workstation-5.5.3-34685.rar
    VMware_Workstation_5.5.3_34685H.rar
2,在http://www.crsky.com/soft/1863.html
    下载VMware Workstation v6.0.0 Build 45731 及 汉化补丁
    VMwareWorkstation-v6.0.0.45731.rar
    VMwareWorkstation_v60045731H.rar
3,在http://www.crsky.com/soft/6748.html上
    下载SecureCRT v5.5.2
    SecureCRT-v5.5.2.rar
3,在http://www.crsky.com/soft/6838.html
    下载SecureCRT v5.1.2 Build 274 汉化版 by 偃月青龙
    SecureCRT_5.1.2H.rar
3,在http://www.crsky.com/soft/6838.html   
    SecureCRT v5.1.3 Build 281 汉化版
    HAP_SecureCRT_5.1.3.rar
4,在http://www.codesourcery.com/gnu_toolchains/arm/download.html
    下载ARM EABI + IA32 GNU/Linux 开发工具
    arm-2007q3-53-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
    下载ARM GNU/Linux + IA32 GNU/Linux 开发工具
    arm-2007q3-51-arm-none-gnueabi-i686-pc-linux-gnu.tar.bz2
4,在ftp://ftp.denx.de/pub/eldk/4.1/
    下载arm-linux-x86-uclibc
    ftp://ftp.denx.de/pub/eldk/4.1/arm-linux-x86-uclibc/iso/arm-2007-01-22-uclibc.iso       
    下载arm-linux-x86
    ftp://ftp.denx.de/pub/eldk/4.1/arm-linux-x86/iso/arm-2007-01-21.iso

二,准备AT91SAM9260+LINUX开发包

1,在http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933
    下载AT91SAM9260-EK 全套资料
    软件及硬件文档
1,在http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3883
    下载AT91-ISP.exe及使用手册
    Install AT91-ISP v1.10.exe
    doc6224.pdf     doc6272.pdf     doc6132.pdf
2,在http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4093
    下载AT91 Bootstrap及使用手册
    AT91Bootstrap1.5.zip
    doc6277.pdf
3,在http://sourceforge.net/projects/u-boot
    下载Das U-Boot - Universal Bootloader   
    u-boot-1.1.5.tar.bz2
    u-boot-1.1.6.tar.bz2
3,在ftp://ftp.denx.de/pub/u-boot/
    下载U-Boot-1.1.5 released
    u-boot-1.1.5.tar.bz2
4,在http://www.at91.com/ 上注册
    下载u-boot-1.1.5补丁
    u-boot-1.1.5_atmel_1.4.diff.bz2
5,在http://www.kernel.org/pub/linux/kernel/v2.6/
    下载Linux 2.6 内核源码
    linux-2.6.23.tar.bz2
6,在http://maxim.org.za/AT91RM9200/2.6/
    下载Linux 2.6 Patches
    2.6.23-at91.patch.gz
7,在http://www.busybox.net/
    下载BusyBox 1.8.2. (svn, patches, how to add a patch)
    busybox-1.8.2.tar.bz2

三,安装VMWARE+LINUX开发平台

1,在XP系统上安装VMwareWorkstation-v6.0.0.45731及汉化补丁
    A,双击VMware Workstation v6.0 Build 45731 KeyGen.exe 启动破解程序,“serial”栏目中会产生一个安装
        用的序列号,"Type"栏需要为“VMware Workstation ACE Edition for Windows V6";
    B,双击VMware-workstation-6.0.0-45731.exe 启动安装,点击NEXT,选择Typical;再NEXT,安装文件夹选择
        默认;再NEXT,快捷方式产生用默认;再NEXT,按install;输入使用者,公司和序列号,最后点击finish完成
        安装,重启动电脑;
    C,双击setup_tracky.exe 启动汉化,点击“下一步”,勾选“同意许可”;再“下一步”又“下一步”,安装
        文件夹选择默认;再“下一步”再“下一步”,去掉第三方插件;再“下一步”后,点击“安装”;最后点击
        “完成”;
    注意:XP系统需要512MB以上内存,15GB以上硬盘空间。
   
2,在VMware Workstation上安装ubuntu-7.10-desktop的X86版本
    A,双击桌面VMware Workstation图标进入虚拟机,点击“新建虚拟机”启动建立向导;点“下一步”选择“典型”;
        点“下一步”选择操作系统为“linux"和版本为“Ubuntu";点“下一步”输入虚拟机名称和选择安装路径;点
        “下一步”选择“使用桥接网络”;“下一步”磁盘大小填15GB以上,勾选“分割磁盘为2GB文件”;点击“完成”;
    B,进入建立好的虚拟机页面,双击“CD-ROM”,“连接”选择“使用ISO镜像”; 点击“浏览”选择下载的“ubuntu-
        7.10-desktop-i386.iso”文件“打开”并“确定”;点击虚拟机页面中“命令”中的“启动该虚拟机”启动安装;
    C,在LINUX安装界面中按F2功能键,选择“中文(简体)”;用上下箭头选择高亮“启动或安装UBUNTU”时按回车;进入
        Ubuntu-7.10-desktop的X86版本的LiveCD界面,双击“安装”进入了LiveCD安装到硬盘的过程;
    D,在安装界面点击“前进”,地点用默认“上海”;点击“前进”,键盘布局用默认“美国”;点击“前进”硬盘分区
        用默认“向导”,点击“前进”,输入用户名和密码;点击“前进”,在准备安装中,点击“Install";安装完成
        后,点击“现在重启”并把虚拟机“设置”中的“CD-ROM”改回“使用物理驱动器”;
       
    注意:XP系统需在DHCP的局域网内,要独立分配IP给虚拟机;安装的用户名和密码区别于ROOT用户,每次登陆系统及修改
        系统配置都要用到,需要牢记。

四,配置并更新ubuntu桌面系统

1,启动根用户和配置网络
A,进入系统后在启动菜单“应用程序”->“附件”->“终端”拉到桌面上;把启动菜单“位置”中的“计算机”也
        拉到桌面上;双击桌面“终端”中打开命令行终端
B,启用root用户并修改密码
        yuanxh@yuanxh-desktop:~$ sudo passwd root
C,进入root用户操作
        yuanxh@yuanxh-desktop:~$ su
D,查看本机IP配置信息
        root@yuanxh-desktop:/home/yuanxh# ifconfig -a
E,在启动菜单“系统”->“系统管理”->“网络”中
  填入IP,子域掩码,网关,DNS等网络参数;
F,修改.bashrc启用ll la等到命令转义
  root@yuanxh-desktop:/home/yuanxh# vi /root/.bashrc
 
2,安装虚拟驱动Vmware tools
A,进入系统后在虚拟机菜单“虚拟机”中点击“安装Vmware tools”后桌面会弹出一个CD-ROM内容的文件夹,里面有两个
  rpm和tar.gz压缩文件包;
B,双击桌面“终端”打开命令行终端,用命令模式安装虚拟驱动:
  切换到root用户
            yuanxh@yuanxh-desktop:~$ su
        建立文件夹
            root@yuanxh-desktop:/home/yuanxh# mkdir vm-tools
        修改文件夹权限
            root@yuanxh-desktop:/home/yuanxh# chmod 777 vm-tools/
        进入文件夹
            root@yuanxh-desktop:/home/yuanxh# cd vm-tools/
        复制虚拟驱动软件包
            root@yuanxh-desktop:/home/yuanxh/vm-tools# cp /media/cdrom0/VMwareTools-6.0.0-45731.tar.gz .
        解压虚拟驱动文件包
            root@yuanxh-desktop:/home/yuanxh/vm-tools# tar xzvf VMwareTools-6.0.0-45731.tar.gz
        进入虚拟驱动文件夹
            root@yuanxh-desktop:/home/yuanxh/vm-tools# cd vmware-tools-distrib/
        运行虚拟驱动安装脚本
            root@yuanxh-desktop:/home/yuanxh/vm-tools/vmware-tools-distrib# ./vmware-install.pl
C,一路按回车键,直到最后能选择屏幕分辨率大小,并且鼠标能自由进入虚拟机和XP之间;

3,启用XP与虚拟机系统间的共享文件夹功能
A,在虚拟机菜单“虚拟机”->“设置”中,切换到“选项”页;选择到“共享文件夹” 设置,选择“总是启用”;点击文件夹
  下的添加进入“添加文件夹向导”;点击“下一步”设置文件夹“名称”和选择XP系统中的文件夹;点击“下一步”配置好
  共享文件夹属性后,点击“完成”;退出向导,点击“确定”退出设置;
B,在设置好共享文件夹后,并且安装好虚拟驱动后启动虚拟机,便可以在虚拟机中看到共享文件夹的内容;
     root@yuanxh-desktop:/home/yuanxh# ls -l  /mnt/hgfs
       
4,更新软件包服务器源后更新升级系统并安装SSH和ZMODEM协议
A,在http://www.ubuntu-nl.org/source-o-matic/
  自动产生source.list内容,更新到/etc/apt/sources.list 中;
B,切换到root用户后执行以下命令更新升级系统:
  网络更新系统
        root@yuanxh-desktop:/home/yuanxh# apt-get update
        网络升级系统
        root@yuanxh-desktop:/home/yuanxh# apt-get upgrade
    C,网络安装系统汉字库
        root@yuanxh-desktop:/home/yuanxh# apt-get install language-pack-zh language-pack-zh-base language-support-zh
        在系统登陆界面的“选项”中可以选择系统默认语言;在启动菜单的“系统”->“系统管理”->“语言支持”中也可以
        修改系统默认语言支持;
    D,网络安装SSH客户端和服务器端
        root@yuanxh-desktop:/home/yuanxh# apt-get install ssh openssh-server
        只有安装了这个才能用SecureCRT远程终端SSH访问系统
    E,用以下命令查找并安装ZMMODEM协议支持软件包:
        查找rzsz相关软件包
        root@yuanxh-desktop:~# apt-cache search rzsz
        显示lrzsz软件包详细情况
     root@yuanxh-desktop:~# apt-cache show lrzsz       
        网络安装zmodem传输协议
        root@yuanxh-desktop:/home/yuanxh# apt-get install lrzsz
        查看网络下载软件包存放目录
        root@yuanxh-desktop:/home/yuanxh# ll /var/cache/apt/archives/

5,安装SecureCRT远程终端SSH访问虚拟机和启用SFTP文件传输功能
A,双击HAP_SecureCRT_5.1.3.exe,点击“继续”;选择“接受协议”,再点击“继续”;点击“继续”后安装路径
     选择默认的;点击“继续”后选择“完整安装”;点击“继续”后产生快捷方式用默认;点击“安装”后点击“完成”;
B,双击桌面SecureCRT 5.1.3图标启动终端软件,在输入许可数据中依次输入“名字”“公司”“序列号”“许可密钥”和
  “发布日期”完成注册;
C,利用向导建立一个SSH会话到虚拟机;“下一步”后输入虚拟机IP地址和登陆用户名,建立好后双击会话SSH登陆LINUX,
  在会话属性中可配置终端类型,字体,滚屏行数,字符编码,XMODEM和SFTP默认路径等;
D,建立了到LINUX的SSH会话后,在SecureCRT 5.1.3界面的菜单“文件”->“连接SFTP标签”可启动到相应的LINUX的SFTP连接,
  在SFTP标签中输入“help”可以查看相关的SFTP命令。

五,建立FTP,NFS和交叉编译环境

1,用命令配置TFTP服务
    A, 建立TFTP系统根目录并修改权限
        root@yuanxh-desktop:/home/yuanxh/at91_works# mkdir  /tftpboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# chmod 777  /tftpboot
    B,安装TFTP服务器端和客户端
        root@yuanxh-desktop:/# sudo apt-get install tftp tftpd openbsd-inetd
    C,修改配置文件使用TFTP根目录
        root@yuanxh-desktop:/home/yuanxh/at91_works# vi  /etc/inetd.conf
        在/etc/inetd.conf新行中填入以下内容
        tftp    dgram   udp     wait    nobody  /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
    D,启动服务
        root@yuanxh-desktop:/home/yuanxh/at91_works#  /etc/init.d/openbsd-inetd  restart
    E,测试服务
        root@yuanxh-desktop:/home/yuanxh# touch /tftpboot/aaa
        root@yuanxh-desktop:/home/yuanxh# vi /tftpboot/aaa
        root@yuanxh-desktop:/home/yuanxh# tftp 192.168.1.100
        tftp> get aaa
        tftp> quit
        root@yuanxh-desktop:/home/yuanxh# cat aaa

2,用命令配置NFS服务
    A,安装NFS服务器端
        root@yuanxh-desktop:/home/yuanxh# apt-get install nfs-kernel-server  nfs-common  portmap
    B,配置访问目录及权限
        root@yuanxh-desktop:/home/yuanxh/at91_works# mkdir  /nfsboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# chmod 777  /nfsboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# touch  /nfsboot/yuanxh
        root@yuanxh-desktop:/# vi /etc/exports
        在/etc/exports新行中填入以下内容
        /nfsboot  192.168.1.0/24(rw,sync)
    C,启动服务
        root@yuanxh-desktop:/# exportfs -ra
        root@yuanxh-desktop:/# /etc/init.d/portmap restart
        root@yuanxh-desktop:/# /etc/init.d/nfs-common restart
        root@yuanxh-desktop:/# /etc/init.d/nfs-kernel-server restart
    D,测试服务
        root@yuanxh-desktop:/# mount 192.168.1.100:/nfsboot  /mnt
        root@yuanxh-desktop:/home/yuanxh# ll /mnt
        root@yuanxh-desktop:/home/yuanxh# rm -rf /mnt/yuanxh
        root@yuanxh-desktop:/home/yuanxh# showmount
        root@yuanxh-desktop:/home/yuanxh# df
        root@yuanxh-desktop:/home/yuanxh# umount /mnt
        root@yuanxh-desktop:/home/yuanxh# ll /nfsboot
       
3,安装交叉编译工具链
    A,利用SecureCRT 5.1.3登陆,传送文件到系统
        root@yuanxh-desktop:/home/yuanxh# mkdir /usr/local/arm
        root@yuanxh-desktop:/home/yuanxh# chmod 777 /usr/local/arm/
        root@yuanxh-desktop:/home/yuanxh# cd /usr/local/arm/
        root@yuanxh-desktop:/usr/local/arm# rz
        在SecureCRT弹出的窗口中选择交叉编译工具安装包
    B,解压交叉编译工具包
        root@yuanxh-desktop:/usr/local/arm# tar xjvf arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
        root@yuanxh-desktop:/usr/local/arm# tar xjvf arm-2007q3-53-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
    C,安装ELDK交叉编译工具
        在虚拟机窗口中右击“arm-2007-01-22-uclibc.iso”选择“解压到此处”来解压;
        root@yuanxh-desktop:/usr/local/arm# cd arm-2007-01-22-uclibc/
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-22-uclibc# chmod 777 install
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-22-uclibc# ./install -d /usr/local/arm/eldk-uclibc-4.1
        在虚拟机窗口中右击“arm-2007-01-21.iso”选择“解压到此处”来解压;
        root@yuanxh-desktop:/usr/local/arm# cd arm-2007-01-21/
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-21# chmod 777 install
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-21# ./install -d /usr/local/arm/eldk-4.1
    D,把编译器路径添加到系统路径中
        root@yuanxh-desktop:/usr/local/arm#  vi /root/.bashrc
        在alias l='ls -CF'后的空白处填上:
  PATH=$PATH:/usr/local/arm/eldk-4.1/usr/bin:/usr/local/arm/eldk-4.1/bin
  export PATH
  启动新系统路径
  root@yuanxh-desktop:/usr/local/arm# source /root/.bashrc
  显示新系统路径
  root@yuanxh-desktop:/usr/local/arm# echo $PATH
  查看版本号
  root@yuanxh-desktop:/usr/local/arm# arm-linux-gcc -v
    E,查看交叉编译工具版本信息
        root@yuanxh-desktop:/usr/local/arm# ./arm-2007q3/bin/arm-none-eabi-gcc -v
        root@yuanxh-desktop:/usr/local/arm# ./arm-2007q3/bin/arm-none-linux-gnueabi-gcc -v
        root@yuanxh-desktop:/usr/local/arm# ./eldk-uclibc-4.1/usr/bin/arm-linux-gcc -v

六,编译Bootstrap+U-BOOT启动代码 

1,传送文件包到LINUX系统并解压
    A,利用SecureCRT 5.1.3登陆,传送文件到系统
        root@yuanxh-desktop:/home/yuanxh# mkdir at91_works
        root@yuanxh-desktop:/home/yuanxh# chmod 777 at91_works/
        root@yuanxh-desktop:/home/yuanxh# cd at91_works/
        root@yuanxh-desktop:/home/yuanxh/at91_works# rz
        在SecureCRT弹出的窗口中选择AT91Bootstrap1.5.zip,u-boot-1.1.5.tar.bz2,u-boot-1.1.5_atmel_1.4.diff.bz2软件包
    B,解压所有软件包
        在虚拟机窗口中右击AT91Bootstrap1.5.zip,选择“解压到此处”来解压,同样解压u-boot-1.1.5_atmel_1.4.diff.bz2;
        root@yuanxh-desktop:/home/yuanxh/at91_works# tar xjvf u-boot-1.1.5.tar.bz2
       
2,编译生成一级启动目标码
    A,为Bootstrap-v1.5指定编译器
        root@yuanxh-desktop:/home/yuanxh/at91_works# cd Bootstrap-v1.5/board/at91sam9260ek/nandflash/
        root@yuanxh-desktop:/home/yuanxh/at91_works/Bootstrap-v1.5/board/at91sam9260ek/nandflash# vi Makefile
        把文件中的CROSS_COMPILE=/usr/local/arm/eldk-4.1/usr/bin/arm-linux-填好,指定eldk-4.1的编译器;
    B,编译生成了目标码并传送回XP
        root@yuanxh-desktop:/home/yuanxh/at91_works/Bootstrap-v1.5/board/at91sam9260ek/nandflash# make
        root@yuanxh-desktop:/home/yuanxh/at91_works/Bootstrap-v1.5/board/at91sam9260ek/nandflash# sz nandflash_at91sam9260ek.bin
        在dataflash目录同样修改Makefile也能生成dataflash_at91sam9260ek.bin;
        注意:必须保证 dataflash_at91sam9260ek.bin 和平nandflash_at91sam9260ek.bin 小于4KB;
3,编译生成二级启动目标码
    A,打上补丁
        root@yuanxh-desktop:/home/yuanxh/at91_works# cd u-boot-1.1.5
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# mv ../u-boot-1.1.5_atmel_1.4.diff .
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# apt-get install patch
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# patch -p1 < ./u-boot-1.1.5_atmel_1.4.diff
    B,指定编译器
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# vi Makefile
        把CROSS_COMPILE = arm-linux- 改成 CROSS_COMPILE=/usr/local/arm/eldk-4.1/usr/bin/arm-linux-
    C,配置并编译在DATAFLASH中运行模式
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# apt-get install libncurses5-dev
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make clean
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make mrproper
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make at91sam9260ek_config
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# mv u-boot.bin u-boot-env-df.bin
        注意:需要修改一下/u-boot-1.1.5/examples/Makefile的语法错误,请按/u-boot-1.1.6/examples/Makefile部分更新;
    D,配置并编译在NANDFLASH中运行模式
     修改配置头文件
     root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# vi include/configs/at91sam9260ek.h
     把文件中的
     #define CFG_ENV_IS_IN_DATAFLASH         1
  #undef CFG_ENV_IS_IN_NAND
  改成
  #undef  CFG_ENV_IS_IN_DATAFLASH
  #define  CFG_ENV_IS_IN_NAND            1
  重新编译
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make clean
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make mrproper
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make at91sam9260ek_config
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# make
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# mv u-boot.bin u-boot-env-nf.bin
    E,发送目标码
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# sz u-boot-env-df.bin
        root@yuanxh-desktop:/home/yuanxh/at91_works/u-boot-1.1.5# sz u-boot-env-nf.bin

七,为SAM9260编译ARM-LINUX内核

1,传送文件包到LINUX系统并解压
    利用SecureCRT 5.1.3登陆,传送文件到系统
        root@yuanxh-desktop:/home/yuanxh# cd at91_works/
        root@yuanxh-desktop:/home/yuanxh/at91_works# rz
        在SecureCRT弹出的窗口中选择2.6.23-at91.patch.gz和linux-2.6.23.tar.bz2包;
2,解压内核及打上补丁包
        root@yuanxh-desktop:/home/yuanxh/at91_works# tar xjvf linux-2.6.23.tar.bz2
        root@yuanxh-desktop:/home/yuanxh/at91_works# gzip -d 2.6.23-at91.patch.gz
        root@yuanxh-desktop:/home/yuanxh/at91_works# cd linux-2.6.23
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# patch -p1 < ../2.6.23-at91.patch
3,为内核指定编译器
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# vi Makefile
        把 EXTRAVERSION = -9gsam9260ek 写上自己版本标识,指定体系结构和编译器
        ARCH           ?= arm
        CROSS_COMPILE  ?= /usr/local/arm/eldk-4.1/usr/bin/arm-linux-
        添加可加载模块安装路径
        INSTALL_MOD_PATH = $(TOPDIR)/modules-$(KERNELRELEASE)
4,编译内核及发布目标码
    A,查看内核支持的开发板
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- help
    B,配置为AT91RM9260EK板默认设置
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- at91sam9260ek_defconfig
    C,编译生成全部目标码
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux-
    D,也可分步依次生成zImage,可加载modules和安装可加载模拟到默认目录
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- zImage
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- modules
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- modules_install
    E,发送内核目标码和可加载模块
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# cp arch/arm/boot/zImage .
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# mv zImage zImage-2.6.23-9gsam9260ek.bin
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# sz zImage-2.6.23-9gsam9260ek.bin
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# tar czvf modules-2.6.23-9gsam9260ek.tar.gz modules-2.6.23-9gsam9260ek/
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# sz modules-2.6.23-9gsam9260ek.tar.gz
F,个性化配置内核
  root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
  .config中内核启动命令行参数CONFIG_CMDLINE改为:
  mem=64M console=ttyS0,115200 initrd=0x21100000,8388608 root=/dev/ram0 rw init=/linuxrc
G,编译生成U-BOOT可识别目标码uImage
  root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- uImage
  root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# cp arch/arm/boot/uImage .
  root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# mv uImage uImage-2.6.23-9gsam9260ek.bin
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# sz uImage-2.6.23-9gsam9260ek.bin
5,清除内核目标码恢复未配置状态
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- clean
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- distclean
        root@yuanxh-desktop:/home/yuanxh/at91_works/linux-2.6.23# make ARCH=arm CROSS_COMPILE=arm-linux- mrproper


八,编译BUSYBOX建立根文件系统 

1,编译BUSYBOX
A,传送文件包到LINUX系统并解压
     利用SecureCRT 5.1.3登陆,传送文件到系统
  root@yuanxh-desktop:~# cd /home/yuanxh/at91_works/
  root@yuanxh-desktop:/home/yuanxh/at91_works# rz
  在SecureCRT弹出的窗口中选择busybox-1.8.2.tar.bz2包;
B,解压及指定编译器
  root@yuanxh-desktop:/home/yuanxh/at91_works# tar xjvf busybox-1.8.2.tar.bz2
  root@yuanxh-desktop:/home/yuanxh/at91_works# cd busybox-1.8.2
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# vi Makefile
        把 EXTRAVERSION = -9gsam9260ek 写上自己版本标识,指定体系结构和编译器
        ARCH           ?= arm
        CROSS_COMPILE  ?= /usr/local/arm/eldk-4.1/usr/bin/arm-linux-
C,编译生成全部目标码
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make help
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make defconfig
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make install
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# mv _install/ rootfs
        root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# cp -dpR examples/bootfloppy/etc rootfs/
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# tar czvf busybox-9gsam9260ek.tar.gz rootfs/
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# sz busybox-9gsam9260ek.tar.gz
D,个性化配置BUSYBOX
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make menuconfig
E,清除内核目标码恢复未配置状态
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make clean
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make distclean
  root@yuanxh-desktop:/home/yuanxh/at91_works/busybox-1.8.2# make mrproper
2,编译RZSZ软件包

A,在http://ftp.uni-koeln.de/util/comm/
  上下载rzsz-3.49.zip
B,上传到LINUX系统
  root@yuanxh-desktop:/home/yuanxh/at91_works# rz
C,解压软件包
  在虚拟机窗口中右击rzsz-3.49.zip,选择“解压到此处”来解压,
D,进入软件包
  root@yuanxh-desktop:/home/yuanxh/at91_works# cd rzsz-3.49
E,指定编译器
  root@yuanxh-desktop:/home/yuanxh/at91_works/rzsz-3.49# vi makefile
  修改如下内容
  CC=/usr/local/arm/eldk-4.1/usr/bin/arm-linux-gcc
F,编译生成目标码
  root@yuanxh-desktop:/home/yuanxh/at91_works/rzsz-3.49# make posix
  root@yuanxh-desktop:/home/yuanxh/at91_works/rzsz-3.49# tar czvf rzsz-9gsam9260ek.tar.gz rz sz
  root@yuanxh-desktop:/home/yuanxh/at91_works/rzsz-3.49# sz rzsz-9gsam9260ek.tar.gz
  注意:此软件有版权保护,软件中REGISTERED如果没有被宏定义,程序在使用中提示使用越权;
3,建立根文件系统
A,建立BUSYBOX基本目录
  root@yuanxh-desktop:/home/yuanxh/at91_works# mkdir rootfs-9g9sam9260ek
  root@yuanxh-desktop:/home/yuanxh/at91_works# cd rootfs-9g9sam9260ek/
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# rz
  传送上节编译生成的busybox-9gsam9260ek.tar.gz目标码包
B,建立树型根目录
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# tar xzvf busybox-9gsam9260ek.tar.gz
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# cd rootfs/
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# mkdir -pv app dev home mnt proc sys tmp var opt
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# install -dv -m 0750 root
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# mkdir -pv var/{lock,log,lib,run,tmp}
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# mkdir -pv usr/{lib,share}
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# chmod 1777 tmp var/tmp
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# mkdir -pv dev/pts 
C,添加动态库文件
  root@yuanxh-desktop:/home/yuanxh# cd /usr/local/arm/eldk-4.1/arm
  root@yuanxh-desktop:/usr/local/arm/eldk-4.1/arm# tar czvf lib-eldk-4.1.tar.gz lib/
  root@yuanxh-desktop:/usr/local/arm/eldk-4.1/arm# mv lib-eldk-4.1.tar.gz /home/yuanxh/at91_works/rootfs-9g9sam9260ek
  root@yuanxh-desktop:/usr/local/arm/eldk-4.1/arm# cd /home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# tar xzvf ../lib-eldk-4.1.tar.gz
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# arm-linux-strip --remove-section=.note --remove-section=.comment lib/*.so
  注意:可以删除部分不常用字的库以减小体积。
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/lib# rm -rf *.a *.o security gconv
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/lib# rm -rf *.7f *.79 libnss*  libmudflap*
D,添加设备节点
     root@yuanxh-desktop:/home/yuanxh/at91_works# cd rootfs-9g9sam9260ek/rootfs/
     root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# cp -dpR /dev/* dev/
E,添加系统配置
     在etc/inittab中加入以下内容
     #id:3:initdefault:
     #su:S016:once:/sbin/sulogin
     #si::sysinit:/etc/rc.d/init.d/rc sysinit
        #l0:0:wait:/etc/rc.d/init.d/rc 0
       
        3:12345:respawn:/sbin/getty -L ttyS0 115200 vt100
//        ::respawn:/sbin/getty -L ttyS1 115200 vt100
//  ::respawn:/sbin/getty -L ttyS2 115200 vt100
//  ::respawn:/usr/sbin/telnetd
  ::respawn:/usr/sbin/inetd -f
        ::shutdown:/bin/mount / o remount,ro
        #::ctrlaltdel:/sbin/reboot
        #::shutdown:/bin/umount ar
        #ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

        在etc/fstab中添加入以下内容
        tmpfs   /tmp    tmpfs   defaults    0 0
        sysfs   /sys    sysfs   defaults    0 0
        none    /dev/pts devpts  mode=0622  0 0
        #devpts /dev/pts     devpts gid=4,mode=620  0     0
        #shm    /dev/shm     tmpfs  defaults        0     0

        在etc/profile中添加入以下内容
        #set patch
        PATH=/bin:/sbin:/usr/bin:/usr/sbin
        export PATH
        #alias command
        alias ll='ls -l'
        alias la='ls -a'
        alias du='du -h'
        alias df='df -h'

        在/etc/init.d/rcS中添加入以下内容
        /sbin/ifconfig lo 127.0.0.1
        /sbin/ifconfig eth0 192.168.1.10
        /bin/mount /dev/pts
        dmesg > /var/log/dmesg
        #hostname F /etc/hostname
        hostname 9gsam9260-Linux
        # mount fs
        /bin/mount -o remount,rw /
        # display
        echo 'rootfs version 2.6.23-9gsam9260ek (yuanxihua@y21cn.com) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0))' > /dev/ttyS0
        cat /root/build_time > /dev/ttyS0
        /app/appinit.sh

        启动/etc/init.d/rcS可执行权限
        root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs# chmod a+x /etc/init.d/rcS
       
        命令建立etc/passwd文件
       
  cat > etc/passwd << "EOF"
  root:x:0:0:root:/root:/bin/sh
  EOF
 
  复制部分配置文件
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# cd rootfs/etc/
//  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/etc# cp /etc/nsswitch.conf .
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/etc# cp /etc/group .
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/etc# cp /etc/shadow .
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/etc# cp /etc/inetd.conf .
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/etc# cp /etc/passwd .
 
  修改etc/passwd,使root登陆后执行程序为bin/sh

F,添加可加载模块
     root@yuanxh-desktop:/home/yuanxh/at91_works# cd rootfs-9g9sam9260ek
     root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# rz
     利用SecureCRT发送modules-2.6.23-9gsam9260ek.tar.gz
     root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# tar xzvf modules-2.6.23-9gsam9260ek.tar.gz
     root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# rm -rf rootfs/lib/modules/*
     root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# mv modules-2.6.23-9gsam9260ek/lib/modules/*  rootfs/lib/modules/
     root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# rm -rf modules-2.6.23-9gsam9260ek
   
G,添加其它命令和应用程序
     root@yuanxh-desktop:/home/yuanxh/at91_works# cd rootfs-9g9sam9260ek
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# rz
     root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# cd rootfs/bin/
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek/rootfs/bin# tar xzvf ../../rzsz-9gsam9260ek.tar.gz
 
4,打包成RAMDISK根文件系统
A,进入根文件系统目录
  root@yuanxh-desktop:/home/yuanxh/at91_works# cd rootfs-9g9sam9260ek
B,然后执行如下脚本:
  mkdir ramdisk
  dd if=/dev/zero of=ramdisk.img bs=1k count=8192
  mke2fs -F -v -m 0 -N 2000 ramdisk.img
  mount -t ext2 -o loop ramdisk.img  ramdisk
  cp -av rootfs/* ramdisk/
  umount ramdisk
  gzip -9 < ramdisk.img > initrd.bin
  #mv ramdisk.img initrd.bin
  rm -rf ramdisk-2.6.23-9gsam9260ek.bin
  mv initrd.bin  ramdisk-2.6.23-9gsam9260ek.bin
  cp ramdisk-2.6.23-9gsam9260ek.bin /tftpboot/
  rm -rf ramdisk.img
  rm -rf ramdisk
C,发送RAMDISK文件系统目标码
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# sz ramdisk-2.6.23-9gsam9260ek.bin

5,打包成JFFS2根文件系统
A,利用ELDK-4.1中的mkfs.jffs2命令打包
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# mkfs.jffs2 -d rootfs/ -o jffs2-2.6.23-9gsam9260ek.bin
B,发送目标码
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# sz jffs2-2.6.23-9gsam9260ek.bin
C,本机测试JFFS2文件系统
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# rmmod mtdram
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# modprobe mtdram total_size=29568 erase_size=128
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# modprobe mtdblock   
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# modprobe mtdchar
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# cat /proc/mtd
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# dd if=jffs2-2.6.23-9gsam9260ek.bin of=/dev/mtd0
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# mount -t jffs2 /dev/mtdblock0 /mnt
D,修改JFFS2文件系统内容
  添加内容到/mnt,然后执行如下命令:
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# umount /mnt
  root@yuanxh-desktop:/home/yuanxh/at91_works/rootfs-9g9sam9260ek# dd if=/dev/mtd0 of=jffs2-2.6.23-9gsam9260ek.new.bin

九,固化目标码到9GSAM9260EK中 

1,安装ISP工具
    双击Install AT91-ISP v1.10.exe,按NEXT;按I Agree,按NEXT,按install;

9GSAM9260EK V20 linux代码烧录过程

使用dataflash

1.J1接通2-3,J2跳开,J4,J5跳开,连上USB线,识别USB设备后,

2.启动SAM-BA v2.6,用\usb\ARM0和AT91SAM9260-EK配置,进入sam-ba,
选择DataFlash AT45DB/DCB页面,合上J5,

3.在Scripts中选择Enable Dataflash on CS1,点击旁边的Execute,

4.在Scripts中选择Erase All,点击旁边的Execute,

5.在Scripts中选择Send Boot File,在Address框中填入0x0,
点击旁边的Execute,在弹出的打开框中选择
dataflash_at91sam9260ek.bin ,
或者
9gsam9260ek-dfboot.bin ,

6.点击Send File Name框旁边的Browse,在弹出的打开框中选择
u-boot-env-df.bin,
在Internal Address框中填入 0x8000 ,
点击Send File

DATAFLASH空间不足,以下参照NAND部分7,8,9。
{
7.点击Send File Name框旁边的Browse,在弹出的打开框中选择
uImage-2.6.23-9gsam9260ek.bin,
在Internal Address框中填入 0x30000 ,
点击Send File

8.点击Send File Name框旁边的Browse,在弹出的打开框中选择
ramdisk-2.6.23-9gsam9260ek.bin,
在Internal Address框中填入 0x300000 ,
点击Send File

9.连上调试串口,复位9GSAM9260EK,看看效果。
setenv bootcmd cp.b 0xD0030000 0x21500000 0x00200000\;cp.b 0xD0300000 0x21100000 0x00400000\;bootm 0x21500000
回车,再输入
saveenv。
}
10.现在手动烧录完成,复位9GSAM9260EK,进入linux。


使用nandflash


1.J1接通2-3,J2跳开,J4,J5跳开,连上USB线,识别USB设备后,

2.启动SAM-BA v2.6,用\usb\ARM0和AT91SAM9260-EK配置,进入sam-ba,
选择NandFlash页面,合上J4,

3.在Scripts中选择NandFlash Init,点击旁边的Execute,

4.在Scripts中选择NandFlash Erase All,点击旁边的Execute,

5.在Scripts中选择NandFlash Send Boot File,在Address框中填入0x0,
点击旁边的Execute,在弹出的打开框中选择
nandflash_at91sam9260ek.bin,

6.点击Send File Name框旁边的Browse,在弹出的打开框中选择
u-boot-env-nf.bin,
在Address框中填入 0x00020000 ,
点击Send File

7.点击Send File Name框旁边的Browse,在弹出的打开框中选择
uImage-2.6.23-9gsam9260ek.bin,
在Address框中填入 0x00100000 ,
点击Send File

8.点击Send File Name框旁边的Browse,在弹出的打开框中选择
ramdisk-2.6.23-9gsam9260ek.bin,
在Address框中填入 0x00300000 ,
点击Send File

9.连上调试串口,reste 9260-ek,进入u-boot,输入
setenv bootcmd nand read 0x21500000 0x100000 0x200000\;nand read 0x21100000 0x300000 0x400000\;bootm 0x21500000
回车,再输入
saveenv

10.现在手动烧录完成,复位9GSAM9260EK,进入linux。

不用u-boot


1.J1接通2-3,J2跳开,J4,J5跳开,连上USB线,识别USB设备后,

2.启动SAM-BA v2.6,用\usb\ARM0和AT91SAM9260-EK配置,进入sam-ba,
选择NandFlash页面,合上J4,

3.在Scripts中选择NandFlash Init,点击旁边的Execute,

4.在Scripts中选择NandFlash Erase All,点击旁边的Execute,

5.在Scripts中选择NandFlash Send Boot File,在Address框中填入 0x0 ,
点击旁边的Execute,在弹出的打开框中选择
9gsam9260ek-nfboot.bin ,

6.点击Send File Name框旁边的Browse,在弹出的打开框中选择
uImage-2.6.23-9gsam9260ek.bin,
在Address框中填入 0x00100000 ,
点击Send File

7.点击Send File Name框旁边的Browse,在弹出的打开框中选择
ramdisk-2.6.23-9gsam9260ek.bin,
在Address框中填入 0x00300000 ,
点击Send File

8.现在手动烧录完成,连上DEBUG串口,复位9GSAM9260EK,进入linux。


u-boot网络启动

1.在dataflash或者nandflash里烧录上u-boot-env-df.bin或者u-boot-env-nf.bin;

2.连上DEBUG串口,复位9GSAM9260EK,进入 u-boot;

3.u-boot中配置网络环境变量

    setenv serverip 192.168.102.104
    setenv ipaddr 192.168.102.105
    setenv ethaddr 00:11:22:33:44:55
    setenv netmask 255.255.255.0
    setenv hostname 9gsam9260ek
    setenv gatewayip 192.168.102.254
    setenv dnsip 192.168.100.254
    setenv hostname 9gsam9260ek
    saveenv
4.u-boot中配置启动环境变量       
    setenv bootfile /tftpboot/uImage-2.6.23-9gsam9260ek.bin
    setenv rootpath /tftpboot/rootfs
    setenv bootargs mem=64M console=ttyS0,115200 initrd=0x21100000,8388608 root=/dev/ram0 rw init=linuxrc
    saveenv
5.网络下载内核和根文件系统
    tftp 21500000 uImage-2.6.23-9gsam9260ek.bin
    tftp 21100000 ramdisk-2.6.23-9gsam9260ek.bin
    保存自动启动命令
    setenv bootcmd tftp 21500000 uImage-2.6.23-9gsam9260ek.bin\;tftp 21100000 ramdisk-2.6.23-9gsam9260ek.bin\;bootm 0x21500000
    saveenv
6.启动内核
    bootm 0x21500000

十,9GSAM9260EK功能测试 

1,USB转SD卡读卡器
A,插入SD卡读卡器到USB-HOST
B,加载到/MNT
  / # mount /dev/sda1 /mnt
C,查看
  / # ll mnt
 
2,SD卡座
A,补丁
http://marc.info/?l=linux-arm-kernel&m=118036170932720&w=2

3,测试USB-DEVICE
A,外接电源启动进入LINUX建立文件
  / # dd if=/dev/zero of=/tmp/usbramdisk.img bs=1k count=8192
B,执行下面命令安装驱动
  / # insmod /lib/modules/2.6.23-9gsam9260ek/kernel/drivers/usb/gadget/g_file_storage.ko file=/tmp/usbramdisk.img stall=0 removable=1
C,插上USB-DEVICE线到XP
D,在XP会出现插入U盘
E,格式化U盘全可以使用

4,测试网络
    / # ifconfig eth0 192.168.1.10
    / # ping 192.168.1.100
    / # tftp -g 192.168.1.100 -r uImage-2.6.23-9gsam9260ek.bin
5,测试远程登陆
在终端上运行查看IP
/ # ifconfig -a
然后启动telnetd服务器端
    / # /usr/sbin/telnetd
    然后在SecureCRT上建立一个到开发板IP的telnet连接
    测试命令
    ~ # echo abcd > /dev/ttyS0
    在调试串口0上可以看到abcd字符
6,测试其它串口
启用串口1
/ # /sbin/getty -L ttyS1 115200 vt100
串口线接到串口1
在telnet中执行
~ # echo yuanxh > /dev/ttyS1
  在调试串口1上可以看到yuanxh字符
在串口1终端上按回车,可以看到登陆信息
9gsam9260-Linux login:
输入用户名密码登陆后
执行
/sbin/getty -L ttyS2 115200 vt100
    把串口线接到串口2,按回车出现同样登陆信息
    输入用户名密码登陆后就可以登陆。
    在网络telnet登陆中执行
    ~ # echo abcdyuanxh > /dev/ttyS2
    在调试串口2上可以看到abcdyuanxh字符

十,9GSAM9260EK功能测试 

1,USB转SD卡读卡器
A,插入SD卡读卡器到USB-HOST
B,加载到/MNT
  / # mount /dev/sda1 /mnt
C,查看
  / # ll mnt
 
2,SD卡座
A,补丁
http://marc.info/?l=linux-arm-kernel&m=118036170932720&w=2

3,测试USB-DEVICE
A,外接电源启动进入LINUX建立文件
  / # dd if=/dev/zero of=/tmp/usbramdisk.img bs=1k count=8192
B,执行下面命令安装驱动
  / # insmod /lib/modules/2.6.23-9gsam9260ek/kernel/drivers/usb/gadget/g_file_storage.ko file=/tmp/usbramdisk.img stall=0 removable=1
C,插上USB-DEVICE线到XP
D,在XP会出现插入U盘
E,格式化U盘全可以使用

4,测试网络
    / # ifconfig eth0 192.168.1.10
    / # ping 192.168.1.100
    / # tftp -g 192.168.1.100 -r uImage-2.6.23-9gsam9260ek.bin
5,测试远程登陆
在终端上运行查看IP
/ # ifconfig -a
然后启动telnetd服务器端
    / # /usr/sbin/telnetd
    然后在SecureCRT上建立一个到开发板IP的telnet连接
    测试命令
    ~ # echo abcd > /dev/ttyS0
    在调试串口0上可以看到abcd字符
6,测试其它串口
启用串口1
/ # /sbin/getty -L ttyS1 115200 vt100
串口线接到串口1
在telnet中执行
~ # echo yuanxh > /dev/ttyS1
  在调试串口1上可以看到yuanxh字符
在串口1终端上按回车,可以看到登陆信息
9gsam9260-Linux login:
输入用户名密码登陆后
执行
/sbin/getty -L ttyS2 115200 vt100
    把串口线接到串口2,按回车出现同样登陆信息
    输入用户名密码登陆后就可以登陆。
    在网络telnet登陆中执行
    ~ # echo abcdyuanxh > /dev/ttyS2
    在调试串口2上可以看到abcdyuanxh字符


9GSAM9260EK开发板简介 

AT91SAM9260特性
带Java扩展的ARM926EJ-S内核, 2 x 8KB快速缓存, MMU内存管理单元
■ 2x4 KB SRAM, 32 KB Boot ROM
■ 180 MHz时200 MIPS
■ EBI总线可支持SDRAM, NAND Flash (带ECC)和Compact Flash CARD
■ 外设可支持DMA和FIFO,集成复位控制电路,高速中断
■ USB主控制器和USB从设备口, V2.0全速12M
■ Ethernet MAC - 10/100M
■ 图像传感器接口,10BIT接口,支持SAV和EAV
■ 一个 SSC可支持I2S和TDM
■ 两个 SPI, MCI (SD Card和MMC兼容), TWI
■ 六 USART, 支持IrDA, ISO7816 T=0/T=1, RS-485 RS-232 IRDA
■ 一个调试UART
■ 4-通道 10位ADC
■ 带实时时钟的备用电池供电的下电模式
■ 1个主时钟,1个32.768K时钟, 2 PLL和RTC
■ 3.0到3.6V IO电源,1.65到1.95V内核电源, 3.0到3.6V或1.95到3.0V 存储器电源接口
■ JTAG和边际扫描
■ PQFP-208和LFBGA217
开发板特性:
MPU
at91sam9260(PQFP-208,无铅产品)
存储器
■256MB 8位 NandFlash
■64MB  两片16位 SDRAM
■2MB DataFash
电源(Power)
■USB从设备口取电,或者5V外接
网络(Ethernet)
■一个10/100M网口,带网络变压器的RJ-45接口和板上LED指示灯
USB Host端口
■一路USB 2.0 全速12M Host端口
■支持U盘、鼠标、键盘、摄像头、打印机 等设备
USB Device 端口
■一路USB 2.0 全速12M Device端口
串口(USART)
■一个三线串口,一个五线串口,USART支持RS485和ISO7816协议
Dbgu调试口
■一个专用调试串口
实时时钟
■带后备电池的RTC
■一路CAN-Bus接口,支持CAN2.0A/B协议
■一个SD卡接口(四线方式)
■外接SPI和I2C接口
■外接简易EBI接口,可接LCD
■一路AD接口,板上可调电阻
■一路音频录放接口
■一路触摸屏接口
■四个独立GPIO口按键
■一个外置硬件看门狗和电源电压检测
■JTAG调试接口
■USB器件接口固化代码模式
■四个独立GPIO口按键
■一个外置硬件看门狗和电源电压检测
■JTAG调试接口
■USB器件接口固化代码模式

最近编辑记录 缥缈九哥 (2020-05-10 00:01:29)

离线

#2 2021-03-25 15:08:39

szchen2006
会员
注册时间: 2019-10-09
已发帖子: 216
积分: 166.5

Re: 基于9GSAM9260EK开发板的arm-linux开发过程

该评论内容与本帖子无关,鼓励各位坑友积极发言讨论与帖子有关的内容!

离线

  • 不通过:与技术无关

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn