開發板配置
1. 串口終端的使用
secureCRT(windows)
minicom(linux)
2. 修改開發板的配置文件
vi /etc/profile
vi /etc/init.d/rcS //啓動腳本
=>
ifconfig eth0 down
ifconfig eth0 hw ether 08:90:00:A0:01:xx
ifconfig eth0 192.168.1.xx netmask 255.255.255.0 up
vi /etc/init.d/rcS
在最後加一行, 方便網絡調試
telnetd &
3. 下載程序/文件到210開發板
(1)使用串口下載
Xmodern/Ymodern/Zmodern
(2) U盤
(3) 網絡下載
ftp/tftp/nfs...
4. 交叉編譯程序
4.1 把arm-2009q3.tar.bz2 放到虛擬機的主目錄下面
4.2 把arm-2009q3.tar.bz2 解壓到 /usr/local/arm目錄
sudo mkdir -p /usr/local/arm
sudo tar jxvf arm-2009q3.tar.bz2 -C /usr/local/arm
4.3 建立鏈接文件
cd /usr/local/arm/arm-2009q3/bin
sudo ln -s arm-none-linux-gnueabi-gcc arm-linux-gcc
sudo ln -s arm-none-linux-gnueabi-as arm-linux-as
sudo ln -s arm-none-linux-gnueabi-g++ arm-linux-g++
sudo ln -s arm-none-linux-gnueabi-ld arm-linux-ld
sudo ln -s arm-none-linux-gnueabi-ar arm-linux-ar
4.4 交叉編譯程序
vim hello.c
/usr/local/arm/arm-2009q3/bin/arm-linux-gcc hello.c -o hello
gcc hello.c -o hello
file hello #file命令用來查看文件的類型及屬性
=〉
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16,
not stripped
cp hello /home/csgec/tftp #把可執行文件,拷貝到你的tftp服務的目錄
tftp -g -r hello 192.168.10.204 #在開發板運行,把hello下載到開發板上
chmod +x hello
./hello
4.5 修改PATH
export PATH=$PATH:/usr/local/arm/arm-2009q3/bin/
把上面那句話加到
vim ~/.bashrc
最後一行。 (僅對當前用戶有效)
如果把上面那句話加到
sudo vim /etc/profile
最後一行。(對系統所有用戶有效)
=>
arm-linux-gcc hello.c -o hello
secureCRT(windows)
minicom(linux)
2. 修改開發板的配置文件
vi /etc/profile
vi /etc/init.d/rcS //啓動腳本
=>
ifconfig eth0 down
ifconfig eth0 hw ether 08:90:00:A0:01:xx
ifconfig eth0 192.168.1.xx netmask 255.255.255.0 up
vi /etc/init.d/rcS
在最後加一行, 方便網絡調試
telnetd &
3. 下載程序/文件到210開發板
(1)使用串口下載
Xmodern/Ymodern/Zmodern
(2) U盤
(3) 網絡下載
ftp/tftp/nfs...
4. 交叉編譯程序
4.1 把arm-2009q3.tar.bz2 放到虛擬機的主目錄下面
4.2 把arm-2009q3.tar.bz2 解壓到 /usr/local/arm目錄
sudo mkdir -p /usr/local/arm
sudo tar jxvf arm-2009q3.tar.bz2 -C /usr/local/arm
4.3 建立鏈接文件
cd /usr/local/arm/arm-2009q3/bin
sudo ln -s arm-none-linux-gnueabi-gcc arm-linux-gcc
sudo ln -s arm-none-linux-gnueabi-as arm-linux-as
sudo ln -s arm-none-linux-gnueabi-g++ arm-linux-g++
sudo ln -s arm-none-linux-gnueabi-ld arm-linux-ld
sudo ln -s arm-none-linux-gnueabi-ar arm-linux-ar
4.4 交叉編譯程序
vim hello.c
/usr/local/arm/arm-2009q3/bin/arm-linux-gcc hello.c -o hello
gcc hello.c -o hello
file hello #file命令用來查看文件的類型及屬性
=〉
hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16,
not stripped
cp hello /home/csgec/tftp #把可執行文件,拷貝到你的tftp服務的目錄
tftp -g -r hello 192.168.10.204 #在開發板運行,把hello下載到開發板上
chmod +x hello
./hello
4.5 修改PATH
export PATH=$PATH:/usr/local/arm/arm-2009q3/bin/
把上面那句話加到
vim ~/.bashrc
最後一行。 (僅對當前用戶有效)
如果把上面那句話加到
sudo vim /etc/profile
最後一行。(對系統所有用戶有效)
=>
arm-linux-gcc hello.c -o hello
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.