本教程所使用的開發板是GEC210開發板,核心板資源概述:CPU:S5PV210,SDRAM:512MB,Flash:8MB,NandFlash:256MB。
本教程搭建的環境可以用於uboot移植、Linux移植,即使開發板只有uboot也能輕松實現內核驅動程序開發。
U-Boot源代碼下載地址 http://www.linuxidc.com/Linux/2011-07/38897.htm
u-boot Makefile完全解讀 http://www.linuxidc.com/Linux/2013-04/83529.htm
U-Boot中的date命令 http://www.linuxidc.com/Linux/2013-07/87614.htm
U-Boot源代碼下載地址 http://www.linuxidc.com/Linux/2011-07/38897.htm
U-Boot下的兩個重要數據:bd_t和gd_t http://www.linuxidc.com/Linux/2013-05/83993.htm
U-Boot中的version命令 http://www.linuxidc.com/Linux/2013-05/83990.htm
U-Boot中的usb命令 http://www.linuxidc.com/Linux/2013-05/83991.htm
接下來,直接進入正題:
1、交叉編譯器
1.1 因為我們編寫的程序是要運行在開發板上的,而Ubuntu自帶的編譯器編譯的程序只能在X86架構下運行。
解壓編譯器:
$ tar -jxvf arm-2009q3.tar.bz2 -C /usr/local/arm/(arm-2009q3.tar.bz2是適用於S5PV210平台的編譯器)。
1.2 設置環境變量
#vim ~/.bashrc
在文件尾端加入
export PATH=/usr/local/arm/arm-2009q3/bin:$PATH
使環境變量生效
#. ~/.bashrc
驗證環境變量設置
#arm-linux-gcc -v
2、配置串口工具--minicom
2.1 安裝串口工具
sudo apt-get install minicom
2.2 配置
#minicom -s
選擇第三項 Serial port setup 進行配置
2.3 串口通訊參數配置
波特率: 115200 8N1
硬件控制流: 無
端口配置: Serial Device: /dev/ttyS0(台式機使用COM1)
3、搭建tftp服務器
3.1 安裝 tftp 工具
apt-get --force-yes -y install tftpd-hpa tftp-hpa xinetd
3.2 建立 tftp 服務器目錄
mkdir /tftpboot
chmod 777 /tftpboot
3.3 配置 tftp 服務
vim /etc/default/tftpd-hpa
修改配置文件為
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"
開啟 tftp 服務
sudo /etc/init.d/xinetd restart
sudo service tftpd-hpa restart
測試
touch /tftpboot/aaa
tftp localhost
get aaa
如果沒有任何錯誤,然後按 q 退出看當前目錄下有沒有 aaa 文件,如果有證明 tftp 服務配置成功
Ubuntu下tftp服務搭建 http://www.linuxidc.com/Linux/2012-08/67933.htm
TFTP服務器配置 http://www.linuxidc.com/Linux/2012-07/64785.htm
Ubuntu Linux配置TFTP下載服務器 http://www.linuxidc.com/Linux/2010-12/30394.htm
Ubuntu 11.10 配置tftp Server http://www.linuxidc.com/Linux/2012-05/60808.htm
Ubuntu 12.04 搭建TFTP服務 http://www.linuxidc.com/Linux/2014-04/100144.htm
Ubuntu 12.04 搭建tftp服務器的安裝、設置、調試 http://www.linuxidc.com/Linux/2014-04/100114.htm
4. 搭建 NFS 服務器
4.1 安裝 NFS 工具
apt-get --force-yes -y install nfs-kernel-server nfs-client nfs-common portmap
4.2 建立 NFS 共享目錄
mkdir -p /nfs
chmod 755 /nfs -R
4.3 配置 NFS 服務
vim /etc/exports增加下面一行
/nfs *(rw,sync,no_root_squash)
4.4 開啟 NFS 服務
service portmap restart
/etc/init.d/nfs-kernel-server restart
4.5 測試
showmount -e localhost
Note:在開發板 ping 一下,如果沒有通,關閉防火牆
更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2