1、Linux下at91sam9x25嵌软开发测试环境搭建文档硬件环境1AT91SAM9x5开发板2串口线3USB线软件环境1Linux开发环境2arm-2011.03-42-arm-none-eabi-交叉编译环境3SAM-BA v2.11编程工具4USB CDC驱动5sscom32.exe串口调试工具6AT91Bootstrap-5series_1.2.tar.bz2源码1 安装虚拟机1.1 虚拟机选择Ubuntu 11.10以上版本(升级比较方便)1.2 虚拟机的配置与升级apt-cache search package 搜索包apt-cache show package 获取包的相关信息,
2、如说明、大小、版本等sudo apt-get install package 安装包sudo apt-get install package - - reinstall 重新安装包sudo apt-get -f install 修复安装-f = fix-missingsudo apt-get remove package 删除包sudo apt-get remove package - - purge 删除包,包括删除配置文件等sudo apt-get update 更新源sudo apt-get upgrade 更新已安装的包sudo apt-get dist-upgrade 升级系统sud
3、o apt-get dselect-upgrade 使用 dselect 升级apt-cache depends package 了解使用依赖apt-cache rdepends package 是查看该包被哪些包依赖sudo apt-get build-dep package 安装相关的编译环境apt-get source package 下载该包的源代码sudo apt-get clean & sudo apt-get autoclean 清理无用的包sudo apt-get check 检查是否有损坏的依赖2 Linux下安装交叉编译环境2.1安装步骤1) 下载arm-2011.03-4
4、2-arm-none-eabi-i686-pc-linux-gnu.tar.bz22) 命令行安装# tar xvzf arm-2011.03-42-arm-none-eabi-i686-pc-linux-gnu.tar.bz2# cd arm-2011.033 安装arm设备编程工具SAM Boot Assistant(SAM-BA)3.1 Windows下安装1)安装sam-ba_2.11.exe软件;2)安装USB CDC驱动;图 3.1图 3.2图 3.3图 3.4图 3.5图 3.7打开SAM-BA 2图 3.8图 3.93.2 Linux下安装1)解压sam-ba_2.11.tar
5、.bz2;2)安装USB CDC驱动;1/ Login with administrator rights2/ Unload usbserial module if it is already running#rmmod usbserial3/ Load usbserial kernel module#modprobe usbserial vendor=0x03eb product=0x61244/ Verify that the USB connection is established#lsusb -d 03eb:6124Bus 004 Device 006: ID 03eb:6124 A
6、tmel Corp5/ Know which USB connection is established#dmesgkernel: usb 4-2: new full speed USB device using uhci_hcd and address 5kernel: usb 4-2: configuration #1 chosen from 1 choicekernel: usbserial_generic 4-2:1.0: generic converter detectedkernel: usbserial_generic: probe of 4-2:1.0 failed with
7、error -5kernel: usbserial_generic 4-2:1.1: generic converter detectedkernel: usb 4-2: generic converter now attached to ttyUSBx= you will have to use /dev/ttyUSBx to connect to your boardRunning SAM-BA CDC Serial version :Launch sam-ba_cdc_x.y.linux_zz file, and select your board and the /dev/ttyUSB
8、xdevice where your board in mounted on. - Update the kernel: # apt-get install linux-image-generic linux-headers-generic- On 64 bits version install 32 bits libraries:# apt-get install ia32-libs- Give sam-ba execute permission if needed:$ chmod +x sam-ba- Connect the board- Create a symlink on /dev/
9、ttyACM0# ln -s /dev/ttyACM0 /dev/ttyUSB0- Launch sam-baTested on: Ubuntu 10.04 64 bits 2.6.32-33-generic (2.6.32-33.70)Ubuntu 10.10 32 bits 2.6.35.30-generic (2.6.35-30.56)Ubuntu 10.10 64 bits 2.6.35.30-generic (2.6.35-30.56)Ubuntu 10.10 64 bits 2.6.38-10-generic (2.6.38-10.25)Ubuntu 11.10 64 bits a
10、lpha3How to check if your kernel is up to date ?$ dmesgIf you have something like that (not exactly the same) its ok:227274.230016 usb 5-1: new full speed USB device using uhci_hcd and address 5227274.395739 cdc_acm 5-1:1.0: This device cannot do calls on its own. It is not a modem.227274.395768 cdc
11、_acm 5-1:1.0: ttyACM0: USB ACM deviceIf you dont have this part: This device cannot do calls on its own. It is not a modem.,your kernel is probably not up to date or the cdc_acm patch has not been backported.4 示例4.1 下载AT91Bootstrap源码1)得到源码;2)解压# tar xvzf AT91Bootstrap-5series_1.2.tar.bz2#cd AT91Boot
12、strap-5series_1.24.2 配置AT91Bootstrap和选择启动媒介1) 从NAND FLASH启动#make at91sam9xnf_defconfig2)添加环境变量#vi .profilePATH=$PATH:/root/Public/arm-2011.03/binexport PATH#souce .profile3) 配置AT91Bootstrap#make menuconfig4.3 编译AT91Bootstrap#export $CROSS_COMPILE=” arm-none-eabi-”#make clear#make在./AT91Bootstrap-5se
13、ries_1.2/binaries下产生at91sam9x5ek-nandflashboot-3.1.bin文件4.4 使用AT91Bootstrap二进制文件1)从NAND flash启动AT91Bootstrap图 4.1在NAND和SPI无效的前提下,启动SAM-BA,烧AT91Bootstrap到NAND flash,如图4.1所示:(1) 在SAM-BA图形用户界面上选择NandFlash媒介选项卡;(2) 1)在NAND有效的前提下,在Scripts下拉列表框中选择“Enable NandFlash”;然后点击“Execute”按钮,完成NandFlash的初始化,如图 4.2所示
14、;图 4.2.12)清除芯片上原来烧的信息图 4.2.2结果如图 4.2.1、图 4.2.2和图 4.5所示。(3) 在Scripts下拉列表框中选择“Send Boot File”;在Download/Upload File组的Send File Name中选择生成的at91sam9x5ek-nandflashboot-3.1.bin文件;点击Sendfile按钮,程序已经烧到NAND flash中,如图 4.3所示;图 4.3 结果如图4.3 和图 4.6所示。(4) 关闭 SAM-BA,拔掉USB线。注意:保证NAND Flash有效。2)连接DBGU串口线3)启动sscom32.exe软件图 4.4图 4.5图 4.6重启板子,如图 4.7所示。图 4.7
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1