980 likes | 1.04k Views
嵌入式系統 Embedded System. 楊昌益. Embedded Linux 的系統建置. 需要 Red Hat Linux 9 PC 已有 Windows XP 作業系統 先安裝 VMware 再從 VMware Workstation 中安裝 Linux 9. 安裝 Toolchain 及 Linux 套件 #cd /usr/local #mkdir arm 放入 CD “Linux for Creator-S3C2410” Copy CD 之 source/cross-2.95.3.tar.bz2 至 /usr/local/arm
E N D
Embedded Linux的系統建置 • 需要Red Hat Linux 9 • PC已有Windows XP作業系統 • 先安裝VMware • 再從VMware Workstation中安裝Linux 9
安裝Toolchain及Linux套件 • #cd /usr/local • #mkdir arm • 放入CD “Linux for Creator-S3C2410” • Copy CD之source/cross-2.95.3.tar.bz2至/usr/local/arm • #cd /usr/local/arm • #bzip2 –dc cross-2.95.2.tar.bz2 | tar xf – • Modify /etc/bashrc
Close terminal • Open another terminal • #env (to check the PATH) • 主選單→系統設定→新增移除應用程式 • 程式開發→核心開發+X軟體開發
安裝Linux Kernel • #cd /usr/src • #mkdir creator • #cd creator • #mkdir nfs • #cd nfs • #mkdir s3c2410 • #cd /usr/src/creator • #mkdir s3c2410
Copy linux-2.4.18.tar.gz、patch-2.4.18-rmk7.gz、patch-2.4.18-rmk7-sw18、patch2.4.18-creator2410.tar.gz from CD “Linux for Creator-S3C2410” to /usr/src/creator/s3c2410 • #cd /usr/src/creator/s3c2410 • #tar –zxvf linux-2.4.18.tar.gz • #gzip –dc patch-2.4.18-rmk7 | (cd linux; patch –p1) • #gzip –dc patch-2.4.18-rmk7-sw18 | (cd linux; patch –p1) • #tar –zxvf patch-2.4.18-creator2410.tar.gz
Compile Linux Kernel Image • #cd /usr/src/creator/s3c2410/linux • #make mrproper • #make menuconfig
輸入”arch/arm/def-configs/create-2410-ramdisk”→<OK>→<Exit>→<Yes>輸入”arch/arm/def-configs/create-2410-ramdisk”→<OK>→<Exit>→<Yes> • #make dep • #make clean • #make zImage • #cd /usr/src/creator/nfs/s3c2410 • #cp /usr/src/creator/s3c2410/linux/arch/arm/boot/zImage zImage_ram • #cp /image/ex2_2418_Creator2410 from CD “Linux for Creator-S3C2410” to /usr/src/creator/nfs/s3c2410
Samba Server安裝 • Linux PC ↔Windows PC(讀取檔案) • Linux PC安裝Samba • 主選單→系統設定→新增移除應用程式 • 伺服器→伺服器設定工具→詳細資料
#mkdir –p /usr/src/creator/nfs/s3c2410 • 主選單→系統設定→伺服器設定→服務
Modify /etc/samba/smb.conf 1. [global] workgroup = PC電腦名稱 security = share 2. [tmp]和下面四行被mark掉的,將它打開 3. 加入 [Creator] copy = tmp path = /usr/src/creator
主選單→系統設定→伺服器設定→服務 • smb→停止→重新啟動 • #netconfig • 設定IP, subnet mask, gateway • #service network restart
Download Image • Download to Target’s RAM • J19 pin的1、2腳connect • J3 pin空接 • Connect ICE with PC and Target board • 將Linux Host端之Hard disk變成Windows Host端之網路磁碟機 • Double click “Domingo for Linux” in Windows • Open Project→New Project→OK
Click “Config PCM” →Import→Select ”creator_s3c2410.pcm”to open→OK→[Input New Project Name] dialog, Please input project name: s3c2410→OK • Config→OS Support→Linux(2410) • Debug→Connect • Debug→LoadModule→Select “zImage_ram” to open
Modify pc to 0x32000000 • Windows Host端,open ASCII Terminal (set the baud rate to 115200, N, 8, 1 and No flow control) • Back to Domingo fo linux and press “go”
Download to Target’s NAND Flash • Modify head-s3c2410.s in /usr/src/creator/s3c2410/linux/arch/arm/boot/compressed
#cd /usr/src/creator/s3c2410/linux • #make zImage • #cd /usr/src/creator/nfs/s3c2410 • #cp /usr/src/creator/s3c2410/linux/arch/arm/boot/zImage zImage_nand • 將Linux Host端之Hard disk變成Windows Host端之網路磁碟機 • Double click “Domingo for Linux” in Windows • Open Project→New project→OK
OK→ Please input project name: s3c2410_nand→OK • Config→OS Support→Linux(2410) • Debug→Connect • Config→Program Flash
關掉Target board電源,拔掉ICE • J19 pin的2、3腳connect • J3 pin短路 • 開啟Target board電源,從Windows的ASCII Terminal看結果
Mother board: • 2M byte Flash memort • 16M SDRAM • 4x4 keyboard • 128x128 LCD • USB device port (1.1) • UARTx2 • CODEC • CF card socket • CMOS Camera • JTAG connector
Master daughter board: • Samsung S3C4510 • Samsung S3C2410 + touch panel • ARM922T-EPXAI • Slave daughter board: • TI DSP5502 • FPGA XC2S • FPGA EPIC6 • Bluebooth
S3C2410 • Features: • 1.8V for Core • 1.8V/2.5V/3.3V for Memory • 3.3V for I/O • 16KB for I-cache, 16KB for D-cache • External memory controller • LCD controller with 1-ch LCD-dedicated DMA • 4-ch DMAs with external request pins • 30ch UART /2-ch SPI
1-ch mulit-master IIC-bus/1-ch IIS-bus controller • SD interface (1.0)/MMC protocol (2.11) • 2-port USB host/1-port USB device • 4-ch PWM timer/1-ch internal timer • Watch dog timer • 117-bit GPIO/24-ch external interrupt source • Power control
8-ch 10-bit ADC and Touch screen interface • RTC • On-chip clock generator with PLL
Creator的模組與應用程式 • Creator-S3C2410支援的模組 • Serial (ˇ) • Ethernet (ˇ) • LED (ˇ) • DIP (ˇ) • 7-segment LED (ˇ) • Key PAD (ˇ) • LCD (ˇ) • CCM (ˇ) • CODEC (ˇ) • CF • RTC • USB
先將書本所附之CD中的程式copy到Linux PC端的/usr/src/creator/s3c2410 (假設在driver目錄下) • #cp –dfpR driver/* /usr/src/creator/s3c2410 • #cd /usr/src/creator/s3c2410/linux • #make menuconfig • Loadable module support→ Enable loadable module support→ type “y”to select →<Exit> • Character devices →Creator-s3c2410 LCD support →type “m” →Creator-s3c2410 CODEC support →type “m” →<Exit> →<Exit> →Select <Yes>
Modify Config.in in usr/src/creator/s3c2410/linux/drivers/char
Modify Makefile in /usr/src/creator/s3c2410/linux/drivers/char
#make dep • #make clean • #make zImage • #make modules • #make modules_install • #cd ../user/creator-s3c2410-demo • #make
#cd /usr/src/creator/nfs/s3c2410 • #cp /usr/src/creator/s3c2410/linux/arch/arm/boot/zImage zImage_ram • #cp /usr/src/creator/s3c2410/lib/modules/2.4.18-rmk7-sw18/kernel/drivers/char/creator-s3c2410-lcd.o . • 同動作,copy creator-s3c2410-cmos.o creator-s3c2410-codec.o 到此目錄 • #cp /usr/src/creator/s3c2410/usr/creator-s3c2410-demo/demo-creator-s3c2410 .