embedded system design - esc.incheon.ac.kresc.incheon.ac.kr/~kcm/epc6071/lab_03.pdf · jaeyong...

18
Embedded System Design Lab 3 Serial Communication w/ Embedded Systems Jaeyong Chung System-on-chips (SoC) Laboratory Incheon National University

Upload: nguyendien

Post on 23-May-2018

217 views

Category:

Documents


1 download

TRANSCRIPT

Jaeyong Chung

Robust Systems Laboratory

Incheon National University

Embedded System Design

Lab 3 Serial Communication w/ Embedded Systems

Jaeyong Chung

System-on-chips (SoC) Laboratory

Incheon National University

Outline

Setup and use Minicom which is a serial terminal

program.

Transfer files between target board and the Host PC

using Minicom.

Chung EPC6071 2

I/O with Embedded Systems

Embedded Systems don’t have keyboards and large

displays usually. Then how we can provide inputs to

cpu and monitor outputs?

Chung EPC6071 3

CPU 8251

status

(8 bit)

data

(8 bit)

serial

port

xmit/

rcv 8251 CPU

serial

port

Introduction

Hybus 320 board

Broadcom PXA320 SoC with Xscale core

http://www.marvell.com/application-processors/pxa-family/

Chung EPC6071 4

PXA32x Block diagram

Hybus 320 Board

Minicom

A linux program installed on host PC to interact with

target board through serial connection

Requires several basic setups including speed, parity,

and flow control

A messages from target board pass through serial

cable and arrive at serial port of host PC

Minicom reads the messages at the port, and

displays them on the window in which minicom is

executing

The commands that are typed In the window are

delivered to target board passing through the serial

port and the serial cable

Chung EPC6071 5

Exercise

Write a simple c program

Cross-compile it for your target board

Setup minicom for your target board

Transfer the program to your board via zmodem

Run it

Notes

320 toolchain : $ wget http://esc.Incheon.ac.kr/~chung/epc6071/bsp/320/toolchain-4.1.1.tar.gz

Chung EPC6071 6

Serial Cable Connection

Connect the RS-232 port of the Serial Cable to the COM port of

the host PC, and the other side to the DEBUG of the target

board.

Chung EPC6071 7

Serial Cable (COM port) Connection

Connect to host

Installation of Minicom

Chung EPC6071 8

$ sudo –i $ apt-get update

Installation of Minicom

Use linux installer (apt-get) to install Minicom

Chung EPC6071 9

$ apt-get install minicom

Setting Up Minicom

Run minicom and setup the serial port

Chung EPC6071 10

$ minicom -s

Setting Up Minicom

Change the serial device name Select the Port that the Serial Cable is Connected to by

Typing “A-Serial Device”.

/dev/ttyUSB0

Chung EPC6071 11

Setting Up Minicom

Change the communication parameters

(Bps/Par/Bits) as follows: Type “E-bps/Par/Bits” to Set

Bps to 38400

Data bit to 8

Stop bit to 1

Parity to No

Chung EPC6071 12

Setting Up Minicom

Flow Control Type “F-Hardware Flow Control” to Set to No

Type “G-Software Flow Control” to Set to No

Type Enter to Select

Chung EPC6071 13

Setting Up Minicom

Save setup as default Type Esc and Select “Save setup as dfl” at the Main Menu

Select “Exit” to Finish Setup

Chung EPC6071 14

Minicom as the Console of the Target Board

From now on, the host window running minicom

becomes the console of embedded linux on the

target board

Chung EPC6071 15

Sending Files to Target Board

In target board, type “rz” and then press “ctrl+a” and

press “s”

Chung EPC6071 16

Sending Files to Target Board

Use “Space” to select files and select [okay] to start

to transfer

Chung EPC6071 17

Homework 1

Write a simple program that performs arithmetic

operations

Make it complex enough so that it can show your original

work

Obtain the ARM assembly codes associated with the

program using gcc –S

Explain the ARM assembly codes, especially the part

of performing the arithmetic operations

Due: lab4

Chung EPC6071 18