Linux下at91sam9x25嵌软开发测试环境搭建文档
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
硬件环境
软件环境
1 安装虚拟机
1.1虚拟机选择
Ubuntu 11.10以上版本(升级比较方便)
1.2虚拟机的配置与升级
apt-cache search package 搜索包
apt-cache show package 获取包的相关信息,如说明、大小、版本等sudo apt-get install package 安装包
sudo apt-get install package - - reinstall 重新安装包
sudo apt-get -f install 修复安装"-f = ——fix-missing"
sudo apt-get remove package 删除包
sudo apt-get remove package - - purge 删除包,包括删除配置文件等sudo apt-get update 更新源
sudo apt-get upgrade 更新已安装的包
sudo apt-get dist-upgrade 升级系统
sudo 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-42-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
2)命令行安装
# tar xvzf arm-2011.03-42-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
# cd arm-2011.03
3 安装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.9
3.2 Linux下安装
1)解压sam-ba_2.11.tar.bz2;
2)安装USB CDC驱动;
1/ Login with administrator rights
2/ Unload usbserial module if it is already running #rmmod usbserial
3/ Load usbserial kernel module
#modprobe usbserial vendor=0x03eb product=0x6124
4/ Verify that the USB connection is established
#lsusb -d 03eb:6124
Bus 004 Device 006: ID 03eb:6124 Atmel Corp
5/ Know which USB connection is established
#dmesg
kernel: usb 4-2: new full speed USB device using uhci_hcd and address 5
kernel: usb 4-2: configuration #1 chosen from 1 choice
kernel: usbserial_generic 4-2:1.0: generic converter detected
kernel: usbserial_generic: probe of 4-2:1.0 failed with error -5
kernel: usbserial_generic 4-2:1.1: generic converter detected
kernel: usb 4-2: generic converter now attached to ttyUSBx
=> you will have to use /dev/ttyUSBx to connect to your board
Running SAM-BA CDC Serial version :
Launch 'sam-ba_cdc_x.y.linux_zz' file, and select your board and the /dev/ttyUSBx
device 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/ttyACM0
# ln -s /dev/ttyACM0 /dev/ttyUSB0
- Launch sam-ba
Tested 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 alpha3
How to check if your kernel is up to date ?
$ dmesg
If you have something like that (not exactly the same) it's ok:
[227274.230016] usb 5-1: new full speed USB device using uhci_hcd and address 5
[227274.395739] cdc_acm 5-1:1.0: This device cannot do calls on its own. It is not a modem.
[227274.395768] cdc_acm 5-1:1.0: ttyACM0: USB ACM device
If you don't 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 AT91Bootstrap-5series_1.2
4.2 配置AT91Bootstrap和选择启动媒介
1) 从NAND FLASH启动
#make at91sam9xnf_defconfig
2)添加环境变量
#vi .profile
PATH="$PATH:/root/Public/arm-2011.03/bin"
export PATH
#souce .profile
3)配置AT91Bootstrap
#make menuconfig
4.3 编译AT91Bootstrap
#export $CROSS_COMPILE=” arm-none-eabi-”
#make clear
#make
在../AT91Bootstrap-5series_1.2/binaries下产生at91sam9x5ek-nandflashboot-3.1.bin文件4.4 使用AT91Bootstrap二进制文件
1)从NAND flash启动A T91Bootstrap
图 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所示;
图 4.2.1
2)清除芯片上原来烧的信息
图 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。