creator pxa270 experiment environment overview

43
Creator PXA270 experiment environment overview D O C Num ber RM -033-04-101 D O C Version V1.00 R elease D ate 2007-01-18 M odule N am e C reator PX A 270 experim ent environm ent overview Platform C reator X S cale-PX A 270 C ategory N on-O S em bedded program ming D ifficulty Basic Experim ent tim e Lecture 30 m inutes O peration 20 m inutes Key W ord XSCALE, PXA270, CREATO R , N on-O S, Cygw in, D om ingo, Toolchain Author M icrotim e Com puter Inc. http//w w w.m icrotim e.com .tw

Upload: arch

Post on 05-Feb-2016

60 views

Category:

Documents


0 download

DESCRIPTION

Creator PXA270 experiment environment overview. 實習規範. 目的 規格 關聯 背景需求 設備需求. 目的. 針對在 Creator XScale-PXA270 平台進行嵌入式微處理器實驗時 , 所需要配合之實驗系統架構及實驗環境做一介紹. 規格. 實驗系統架構說明 Cygwin 安裝與設定 Toolchains 安裝與設定 TFTP 伺服器安裝與設定 Terminal 安裝與設定 Creator XScale-PXA270 實驗平台安裝與設定 U-Boot 監督程式安裝與設定 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Creator PXA270 experiment environment overview

Creator PXA270 experiment environment overview

DOC Number : RM-033-04-101

DOC Version : V1.00

Release Date : 2007-01-18

Module Name : Creator PXA270 experiment environment overview

Platform : Creator XScale-PXA270

Category : Non-OS embedded programming

Difficulty : Basic

Experiment time : Lecture : 30 minutes

Operation : 20 minutes

Key Word : XSCALE, PXA270, CREATOR, Non-OS, Cygwin, Domingo, Toolchain

Author : Microtime Computer Inc. http:/ /www.microtime.com.tw

Page 2: Creator PXA270 experiment environment overview

實習規範

目的 規格 關聯 背景需求 設備需求

Page 3: Creator PXA270 experiment environment overview

33

目的

針對在 Creator XScale-PXA270 平台進行嵌入式微處理器實驗時 , 所需要配合之實驗系統架構及實驗環境做一介紹

Page 4: Creator PXA270 experiment environment overview

44

規格 實驗系統架構說明 Cygwin 安裝與設定 Toolchains 安裝與設定 TFTP 伺服器安裝與設定 Terminal 安裝與設定 Creator XScale-PXA270 實驗平台安裝與設定 U-Boot 監督程式安裝與設定 JTAG Debugger 安裝與設定 原始碼程式編組譯整合操作示範 下載及執行實驗程式碼整合操作示範 JTAG 除錯整合操作示範

Page 5: Creator PXA270 experiment environment overview

55

相依性 - 技術背景 - 設備需求 關聯

None 背景需求

具 C 語言程式設計基礎 稍具微處理器系統硬體設計基礎

設備需求 H/W requirements :

PC Host, COM port Creator XCsale-PXA270 Development Kit JTAG-ICE (Recommended) Ethernet port, Hub (Optional)

S/W requirements : Linux environment : Cygwin 1.3.18 Toolchain : GCC 2.95.3 Domingo debugger (Recommended) TFTP server : TFTPD (Optional)

Page 6: Creator PXA270 experiment environment overview

實習系統概論

簡介 系統架構 電路架構 程式流程

Page 7: Creator PXA270 experiment environment overview

77

系統架構 : 實體

CN

17 U

9

U15

G

BBBB

U1BB

CN6

U8

J2

CN8

J1

1 2 3 4 5 6

7 8 9 101112

AB

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

Eth

ern

et

A

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

C

POWERFAULT DATA ALARM

JTAG-ICE

HUB

5V DC

Printer Cable

Ethernet Cable

RS-232 Null modem Cable

Creator PXA270

Main Board

PowerSW

Optionalfor Debug Use

Hyper-TerminalIn U-Boot

CygwinIn Console

Optionalfor Ethernet Download

Ethernet CableJTAG Cable

110V AC

5V Cable

Base Board

SOM Board

PC-HOST

Page 8: Creator PXA270 experiment environment overview

88

系統架構 : 功能

arm-elf-gcc...

arm-elf-gcc...

PC-Host

SourceCode

Images

Hyper-Terminal TFTPD

Dimingo IDE

Peripherals

U-Boot

XScale-PXA270 JTAG-ICE

Linux like environment for Windows Debugger

ARM-Toolchain

Cygwin

PC-Terminal TFTP Server

Windows

Boot-Loader

RS232 COM Ethernet

Creator XScale-PXA270 Development board

Page 9: Creator PXA270 experiment environment overview

99

程式流程main

HUHU 功能展示(call process)

Creator系統板初始化

process

HUHU 功能展示(call

DEMO_ HUHU)

Creator掃瞄機制初始化

i = 8

DEMO_ HUHU

huhu = 1i = 0

依 huhu 點亮LED (D9 .. D15)

huhu << 1delay 125ms

i = i - 1

Y

N

Page 10: Creator PXA270 experiment environment overview

基礎知識

系統運作說明 實驗程式目錄架構說明 U-Boot 常用命令介紹 Creator XScale-PXA270

實驗平台介紹

Page 11: Creator PXA270 experiment environment overview

1111

系統運作說明

PC-Host : 與 target board 作區別,可安裝研發軟體工具 提供編譯和除錯環境

Cygwin : 在 Windows 上提供 UNIX 環境的程式集合 可以編寫出 win32 介面或是 GUI 應用程式

Toolchains : 集合發展嵌入式系統的工具和 C 函數庫

Page 12: Creator PXA270 experiment environment overview

1212

系統運作說明 TFTP 伺服器 :

TFTP 是一個傳輸文件的簡單協議,以 UDP 來實現 根據 TFTP 能為客戶端提供檔案服務

Hyper-Terminal : Windows 內建應用程式,可使用纜線或網路連線到其他電腦 作為 target board 簡單的人機界面

Creator XScale-PXA270 實驗平台 : 目標板可執行 Xscale 程式碼 提供各種輸出入界面

Page 13: Creator PXA270 experiment environment overview

1313

系統運作說明

U-Boot : 嵌入式系統所用的 Boot loader 用來啟動作業系統 , 應用程式以及接受命令

Domingo debugger 及 JTAG-ICE : Domingo 提供整合除錯之人機界面 JTAG-ICE 扮演 Domingo 與目標板 CPU 之實體

界面 , 為 boundary scan 加速引擎之所在

Page 14: Creator PXA270 experiment environment overview

1414

實驗程式目錄架構說明

Page 15: Creator PXA270 experiment environment overview

1515

U-Boot 常用命令介紹 Printenv Setenv saveenv loadb loady Tftp md mm nm mw cp cmp macaddr

protect erase Run go Bootm Bootp help ping Usb Kgo flinfo Nfs Pinit

Page 16: Creator PXA270 experiment environment overview

1616

Creator XScale-PXA270 實驗平台

JH2

JH2

8888

COMPACT FLASH

CN

17

JH1

CN10

CN

2CN

3

CN

7

CN

23

JH2

U9

CN5

U13

U15

CN18

G

CN16CN17CN20

CN

19

B

B

B

B

U1

B

B

CN6

CN13CN12CN24

CN

4U8

J2

CN11

CN8

CO

MPA

CT FL

ASH

CN14

J1

D5

XScale-270

SDRA

M

SDRA

M

MP2

MP1

1 2

31

2

SOM-PXA270TP1

TP2

D1 D2 D3 D4

S1 S2

CAMERA

LCD

JTAG

AD

CN21 D6MIC LINE HEADPHONE

S3RESET Create XScale-PXA270

PMIC KeyPad

SIM

MS

CF

COM2

COM1

IrDA

Ethernet

USB-Device USB-Host

S2 ~ S174X4 Key Pad

128 X 128LCD Module

D5 ~ D87-Segment

S19SYS_RST

S1DIP_SW

LED : D9 ~ D16

J8+5V

J65V DC_IN

S18Power SW

JP13CMOS Camera

FFUART

STUART

Page 17: Creator PXA270 experiment environment overview

1717

Creator XScale-PXA270 實驗平台

128x128LCM

4 X 4Keypad

S1

CN

17 U

9

U15

G

BBBB

U1BB

CN6

U8

J2

CN8

J1

LED8888

Creator PXA270Main Board

PowerSW

Ethernet Cable

110V AC

Base Board

SOM Board

Optional for Ethernet Download

5V Cable

RS-232 Null Cable

5V DC Adaptor

J6

Optional for J TAG-ICE

Optional for TFT-LCD

Page 18: Creator PXA270 experiment environment overview

基礎實驗之配備建置 PC Host 端基本配備建置 Cygwin 及 ARM_ELF Toolchain 設置 Creator XScale-PXA270 硬體平台設置 實驗程式原始碼設置 基礎實驗之系統環境建置 Domingo, JTAG-ICE 及 Creator XScale-PXA270 整合除錯環境建置 U-Boot 監督程式安裝與設定 原始碼程式編組譯整合操作示範 下載及執行實驗程式碼整合操作示範 JTAG 除錯整合操作示範

Page 19: Creator PXA270 experiment environment overview

1919

基礎實驗配備建置程序關係圖

PC Host 端基本配備建置

Cygwin 及 GCCToolchain 設置

基礎實驗之系統環境建置

Creator XScale-PXA270硬體平台設置

Domingo , JTAG-ICECreator XScale-PXA270整合除錯環境建置

U-Boot 監督程式安裝與設定

JTAG 除錯整合操作示範

原始碼程式編組譯整合操作示範

利用 U-Boot 自 PC 端經網路下載檔案

利用 U-Boot 自 PC 端經 RS-232 下載檔案

下載及執行實驗程式碼整合操作示範

基礎環境建置 4.2.1

4.2.3 4.2.5

4.2.2 4.2.10

4.2.8

4.2.9

4.2.11

4.2.124.2.64.2.7

U-Boot 燒錄 JTAG 整合除錯 基礎實驗操作

基礎實驗配備建置程序關係圖

實驗程式原始碼設置

4.2.4

Page 20: Creator PXA270 experiment environment overview

2020

PC Host 端基本配備建置

1 2 3 4 5 6

7 8 9101112

AB

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

Eth

erne

t

A

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

C

HUB

Ethernet Cable

RS-232 Null Cable

Optionalfor Ethernet Download

Ethernet Cable

PC-HOST

TFTP-Server

Hyper-Terminal

Optionalfor Ethernet Download

Page 21: Creator PXA270 experiment environment overview

2121

Cygwin 及 GCC Toolchain 設置

Page 22: Creator PXA270 experiment environment overview

2222

Creator XScale-PXA270 硬體平台設置

CN

17 U9

U15

G

BBBB

U1BB

CN6

U8

J2

CN8

J1

Creator PXA270Main Board

PowerSW

Ethernet Cable

110V AC

Base Board

SOM Board

Optional for Ethernet Download

5V Cable

RS-232 Null Cable

5V DC Adaptor

J6

Optional for JTAG-ICE

Optional for TFT-LCD

Page 23: Creator PXA270 experiment environment overview

2323

實驗程式原始碼設置

以進行 RM-033-04-200 單元實習為例

先解壓縮 RM-033-04-101.ZIP 到 \Cygwin\usr\var

再解壓縮 RM-033-04-200.ZIP 到 \Cygwin\usr\var

RM-033-04-101.ZIP RM-033-04-200.ZIP

Page 24: Creator PXA270 experiment environment overview

2424

基礎實驗之系統環境建置

CN

17 U

9

U15

G

BBBB

U1BB

CN6

U8

J2

CN8

J1

1 2 3 4 5 6

7 8 9 101112

AB

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

Eth

ern

et

A

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

C

POWERFAULT DATA ALARM

JTAG-ICE

HUB

5V DC

Printer Cable

Ethernet Cable

RS-232 Null modem Cable

Creator PXA270

Main Board

PowerSW

Optionalfor Debug Use

Hyper-TerminalIn U-Boot

CygwinIn Console

Optionalfor Ethernet Download

Ethernet CableJTAG Cable

110V AC

5V Cable

Base Board

SOM Board

PC-HOST

Page 25: Creator PXA270 experiment environment overview

2525

Domingo, JTAG-ICE 及 Creator XScale-PXA270 整合除錯環境建置

CN

17 U

9

U15

G

BBBB

U1BB

CN6

U8

J2

CN8

J1

1 2 3 4 5 6

7 8 9101112

AB

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

Eth

erne

t

A

12x

6x

8x

2x

9x

3x

10x

4x

11x

5x

7x

1x

C

POWERFAULT DATA ALARM

JTAG-ICE

HUB

5V DC

Printer Cable

Ethernet Cable

RS-232 Null Cable

Creator PXA270Main Board

PowerSW

Hyper-Terminal

Cygwin ARM Toolchain

Ethernet CableJTAG Cable

110V AC

5V Cable

Base Board

SOM Board

PC-HOST

Optional for Ethernet downloadDomingo

Page 26: Creator PXA270 experiment environment overview

2626

U-Boot 監督程式安裝與設定

利用 Domingo 啟動 u-boot Creator XScale-PXA270 硬體平台設置 Domingo 整合除錯環境建置 利用 Domingo 下載 / 執行 u-boot .bin 進入 u-boot 命令模式

Page 27: Creator PXA270 experiment environment overview

2727

U-Boot 監督程式安裝與設定 (cont.)

利用 u-boot 命令燒寫 u-boot 至 Flash ROM 設定 u-boot 的環境變數

setenv ipaddr ; setenv serverip ; saveenv 利用 tftp 下載 u-boot.bin

複製 u-boot.bin 檔到 c:\tftpd_read tftp a0000000 u-boot.bin

燒寫 Flash ROM Protect off ; erase ; cp.b

重開 Creator 實驗板 , u-boot 會自行啟動 講師實作展示 3 min

Page 28: Creator PXA270 experiment environment overview

2828

利用 U-Boot 自 PC 端經網路下載檔案

下載 lab.bin 到實驗板位址 0xA0000000 為例 完成 <4.2.5> 基礎實驗之系統環境建置 複製 lab.bin 檔到 c:\tfpd_read 目錄 設定 Host 及 Xscale 板之 IP address

u-boot$setenv ipaddr <board_ip> u-boot$setenv serverip <host_ip>

將 lab.bin 載入 Xscale 板位址 0xA0000000 u-boot$tftp a0000000 lab.bin

講師實作展示 2 min

Page 29: Creator PXA270 experiment environment overview

2929

利用 U-Boot 自 PC 端經 RS-232 下載檔案

下載 lab.bin 到實驗板位址 0xA0000000 為例 完成 <4.2.5> 基礎實驗之系統環境建置 令 u-boot 進入 ymodem 接收狀態

u-boot$loady a0000000

操作終端機執行傳送檔案 , 通訊協定選用 Ymodem 即可

講師實作展示 2 min

Page 30: Creator PXA270 experiment environment overview

3030

原始碼程式編組譯整合操作示範

完成 <4.2.5> 基礎實驗之系統環境建置 在 Cygwin 環境中進入實習目錄

以 RM-033-04-200 實習單元為例 cd usr/var/microtim_lab/lab_pxa270/prj/rm-033-04-200/

build/gnu/2953

編組譯 RM-033-04-200 產生目的碼 lab.bin make clean; make

學員實作 2 min

Page 31: Creator PXA270 experiment environment overview

3131

下載及執行實驗程式碼整合操作示範

建議採 JTAG-ICE 方式較為理想 下載效率以及除錯支援較完整

採用 U-Boot 下載 lab.bin 到實驗板記憶體位址 0xA0000000 並執行為例

參照 <4.2.8> 利用 U-Boot 自 PC 端經網路 , 或 <4.2.9> 經 RS-232 下載檔案

利用 u-boot 命令 go a0000000 執行之 此時實驗板執行先前下載之程式

Page 32: Creator PXA270 experiment environment overview

3232

JTAG 除錯整合操作示範 完成 <4.2.5> 基礎實驗之系統環境建置 完成 <4.2.6> Domingo 整合除錯環境建置 IDE 整合除錯環境介紹 以 RM-033-04-101 實習單元為例 , 載入含 elf 除錯資訊

之目的檔 lab.axf 瀏覽原始碼檔案 瀏覽系統資源 : reg, mem, break points, … 執行程式碼 : reset, step, free go, stop, … 學員實作 5 min

Page 33: Creator PXA270 experiment environment overview

Creator PXA270 硬體檢測

應用軟體 利用 Diag 進行驗證

Cretaor PXA270 測試 實作

Page 34: Creator PXA270 experiment environment overview

3434

應用軟體

u-boot.bin

diag

RT-953-033-29_Creator_PXA270_All-App.tar.gz

rootfs.jffs2.pxa270-20061031-1014uImage.pxa270.linux-2.6.15.3-20061031-1009

zImage.pxa270.linux-2.6.15.3-20061031-1009

TFTPD.exe

解壓縮

Page 35: Creator PXA270 experiment environment overview

3535

利用 Diag 進行驗證Test Prog V1.2 0:Next_Menu 1:Base SDRAM 2:Base Flah 3:Base MAC_IC 4:Base PC_CARD 5:Base CPLD 6:Base GPIO 7:Base TFT_LCD 8:Main Flash 9:Main CF A:Main EEPROM B:Main LED_SW C:Main USB

Input Test Num : _

1.測試 SOM-PXA270 SDRAM2.測試 SOM-PXA270 FLASH3.測試 Create-PXA270 MAC IC (u10)4.測試 Create-PXA270 CF Card (CN14)

5.測試 Create-PXA270 CPLD (u9)6.測試 Create-PXA270 GPIO (s1-2 D1-4)7.測試 Create-PXA270 TFT LCD (CN2)8.測試 Creator 板 FLASH9.測試 Creator 板 CF Card (j4)A.測試 Creator 板 EEPROM (u13)B.測試 Creator 板 LED&SW (s1 D9 ~ 16)C.測試 Creator 板 USB

Page 36: Creator PXA270 experiment environment overview

3636

利用 Diag 進行驗證 (cont.)

Test Prog V1.2 0:Next_Menu 1:Main LCD 2:Main CCM 3:MTBT-C1 4:RFID Input Test Num : _

1.測試 Creator 板 LCD 2.測試 Creator 板 CMOS (jp13)

Page 37: Creator PXA270 experiment environment overview

3737

恢復出貨設置 u-boot 利用 Doming 載入 / 執行 u-boot.bin

Option P; 0x3f80000 Goto Main/Address 0x3f80000

Page 38: Creator PXA270 experiment environment overview

3838

恢復出貨設置 u-boot (cont.)

利用 u-boot 命令燒寫 u-boot.binu-boot.bin

U-BOOT

128K

768K

3.5M

15M

0000 - 0000

0002 - 0000

0004 - 0000

0010 - 0000

0048 - 0000

0138 - 0000

01FF - FFFF

U-BOOT Parameter

diag_ram.bin

Diagnostic Program

uImage.bin

Linux Kernelrootfs.jffs2.pxa270

Linux File Sysetm

Reserved

128K

u-boot $ setenv ipaddr xxx.xxx.xxxu-boot $ setenv serverip zzz.zzz.zzzu-boot $ tftp a0000000 u-boot.binu-boot $ protect off 0 3ffffu-boot $ erase 0 3ffffu-boot $ cp.b a0000000 0 40000

Page 39: Creator PXA270 experiment environment overview

3939

恢復出貨設置 diag

利用 u-boot 命令燒寫 diag_ram.binu-boot.bin

U-BOOT

128K

768K

3.5M

15M

0000 - 0000

0002 - 0000

0004 - 0000

0010 - 0000

0048 - 0000

0138 - 0000

01FF - FFFF

U-BOOT Parameter

diag_ram.bin

Diagnostic Program

uImage.bin

Linux Kernelrootfs.jffs2.pxa270

Linux File Sysetm

Reserved

128K

u-boot $ setenv ipaddr 10.0.0.70u-boot $ setenv serverip 10.0.0.40u-boot $ tftp a0000000 diag_ram.binu-boot $ protect off 40000 fffffu-boot $ erase 40000 fffffu-boot $ cp.b a0000000 40000 100000

Target IP 10.0.0.70PC IP 10.0.0.40

Page 40: Creator PXA270 experiment environment overview

4040

恢復出貨設置 (cont.)

利用 u-boot 命令燒寫 Linux Kernelu-boot.bin

U-BOOT

128K

768K

3.5M

15M

0000 - 0000

0002 - 0000

0004 - 0000

0010 - 0000

0048 - 0000

0138 - 0000

01FF - FFFF

U-BOOT Parameter

diag_ram.bin

Diagnostic Program

uImage.bin

Linux Kernelrootfs.jffs2.pxa270

Linux File Sysetm

Reserved

128K

u-boot $ setenv ipaddr 10.0.0.70u-boot $ setenv serverip 10.0.0.40u-boot $ tftp a0000000 uImage.pxa270. linux-2.6.15.3-yyyymmdd-hhmmu-boot $ protect off 100000 47ffffu-boot $ erase 100000 47ffffu-boot $ cp.b a0000000 100000 480000

★ yyyymmdd-hhmm 代表編譯好的時間日期 ( Creator Xscase PXA270 V1.04 CD 中 RT-953-033-29_Creator_PXA270_All-App.tar.gz 解壓縮後得到 uImage.pxa270.linux-2.6.15.3-20061031-1009 ) 建議修改為較短名稱

Target IP 10.0.0.70PC IP 10.0.0.40

Page 41: Creator PXA270 experiment environment overview

4141

恢復出貨設置 (cont.)

利用 u-boot 命令燒寫 Linux filesystemu-boot.bin

U-BOOT

128K

768K

3.5M

15M

0000 - 0000

0002 - 0000

0004 - 0000

0010 - 0000

0048 - 0000

0138 - 0000

01FF - FFFF

U-BOOT Parameter

diag_ram.bin

Diagnostic Program

uImage.bin

Linux Kernelrootfs.jffs2.pxa270

Linux File Sysetm

Reserved

128K

u-boot $ setenv ipaddr 10.0.0.70u-boot $ setenv serverip 10.0.0.40u-boot $ tftp a0000000 rootfs.jffs2. pxa270.linux-yyyymmdd-hhmmu-boot $ protect off 100000 47ffffu-boot $ erase 100000 47ffffu-boot $ cp.b a0000000 100000 480000

★ yyyymmdd-hhmm 代表編譯好的時間日期 ( Creator Xscase PXA270 V1.04 CD 中 RT-953-033-29_Creator_PXA270_All-App.tar.gz 解壓縮後得到 rootfs.jffs2.pxa270-20061031-1014 ) 建議修改為較短名稱

Target IP 10.0.0.70PC IP 10.0.0.40

Page 42: Creator PXA270 experiment environment overview

4242

Linux 執行應用程式驗證

驗證LED/DIP_SWCCM-(Image)CODEC

cd /lib/modules/2.6.15.3/ insmod creator-pxa270-cmos.koinsmod creator-pxa270-lcd.koinsmod creator-pxa270-codec.kocd /opt/microtime/creator-pxa270-demo./creator-pxa270-demo

驗證MTLCD

cd /opt/microtime/minigui_application /same

./same

相關文件 : RT-953-033-22相關文件 : RT-953-033-24

Page 43: Creator PXA270 experiment environment overview

Q & A