Chapter 1 -- Introduction

Download Report

Transcript Chapter 1 -- Introduction

Teaching Microprocessor Systems
Design Using a SoC and Embedded Linux
Platform
Yann-Hang Lee and Aung Oo
Computer Science and Engineering Department
Arizona State University
[email protected]
Real-time Embedded System Lab, ASU
WCAE_05_ 1
Microprocessor System Course
 A typical Computer Engineering course (core)
 Organization of microprocessor systems (8 or 16-bit
microcontrollers, such as 8051, HC11, HC12, etc.)
 Input/Output interfaces and peripherals
 Programmable timer
 Serial (UART) and parallel ports
 Data acquisition (A/D and D/A)
 ROM monitor to provide a simple execution and
debugging environment
 Assembly programming
 Single execution thread with ISRs
Real-time Embedded System Lab, ASU
WCAE_05_ 2
Emerging Embedded Systems
5
ARM920T
JTAG
ARM9TDMI
4
UART1
8
UART2
Bootstr
ap
Bus
I Cache D Cache Arbiter
1
I/O pads
RTC
2
 Abundant I/O interfaces:
 human interfaces, multimedia,
networking, and inter-IC/device
communication.
MMU
INTC
Timer
WatchDog
PWM
25
LCDC
92
EIM &
SDRAMC
AIPI#1
AHB
AIPI#2
USBd
7
MS/SD
6
A/D
20
BTA
13
CSPI
SSI/I2S
I2C
DMA
(11 chnl)
CSI
Bus
CTL
eSRAM
(128KB
)
MM
A
I/O pads
 SoC-based platforms
 one or more processor cores
 memory-address mapped I/O IP
blocks
 Intel PXA, Motorola Dragonball,
TI OMAP
5
6
2
14
GPIO
SIM
DPLL
x2
6
5
Real-time Embedded System Lab, ASU
WCAE_05_ 3
Emerging Embedded Systems
 I/O programming
using high-level
languages
SDRAM
Flash memory
(for booting)
 For portability,
modularity, and
readability.
 Appropriate use of
programming
languages and
software structures
Mouse
(serial interface)
(USB
interface)
LCD
Keyboard
(PS2 serial
interface)
Dragonball
MX1
GPIO to
digital/analog
converter
Development board
 Operating systems on
Serial EPROM
(SPI interface)
Touch panel
CMOS video
sensor
Serial EPROM
(I2C interface)
target boards
Real-time Embedded System Lab, ASU
WCAE_05_ 4
A New Course on Microprocessor Systems
 Course Objectives: to develop
 an understanding for using a CPU core in system-level design.
 the ability to integrate CPU core with various interface units.
 the skills for programming and debugging I/O operations to manage
peripherals for embedded applications.
 Major topics covered:
 Introduction and review of ISA and assembly language (4 lectures)
 C programming for embedded systems (2 lectures)
 Interrupts and I/O multiplexing (2 lectures)
 Parallel I/O interface and signal handshaking (1 lecture)
 Timers and counters (2 lectures)
 Serial communication: UART, SPI, and I2C (4 lectures)
 LCD interfaces (3 lectures)
 Transducers and sensors, touch panels, A/D-D/A converters (3
lectures)
 Memory devices, SRAM, SDRAM, and flash memory(3 lectures)
 Buses, access arbitration, timing, and bus protocols (2 lectures)
Real-time Embedded System Lab, ASU
WCAE_05_ 5
Development Platforms
 Hardware
 Freescale’s MXLADS (with Dragonball MXL processor)
 Peripherals:
 serial mouse, LCD, magnetic card reader, buzzer
 EEPROM, digital potentiometer, ADC
Serial port
Power Supply
Multi-ICE probe
BlueTooth RF
I/F
Memory
Extension
slot
LCD/Touch
Panel
Camera
I/F
Real-time Embedded System Lab, ASU
WCAE_05_ 6
Development Platforms
 Software
 ARM SDT 2.02u (assembler, compiler, and ARMulator)
 Linux tool chain from MontaVista
Host PC
workstation
ARM elf
GDB
gcc
debugger
crosscompiler
MontaVista IDE
Applications
GDB Server
cygwin
Embedded Linux
Windows
DB MX1 ADS board
support package
Target
MXLADS
Real-time Embedded System Lab, ASU
WCAE_05_ 7
Development Projects
 Introduction project
 programming environment on a target development board.
 Mixed C/C++ and assembly programming, calling conversion,
instruction count measurement
 Software to manage interfaces and peripherals
 IO space as a part of kernel space
 programs must run as kernel tasks
 Develop loadable kernel modules as device
drivers
 Invoked by device file calls (open, close, read, write, and
ioctl)
 Students don’t have much experience with Linux kernel or
system programming
Real-time Embedded System Lab, ASU
WCAE_05_ 8
A Pseudo Device Driver
 To exercise kernel I/O address space and interrupts
Register signal handler with
task structure
Task structure for
the user process
Device driver
module with
registered
IRQ handlers
Application code
Register user process
for signaling and
read/write to IO’s
….
sig handler
sig mask
sig pending
….
memorymapped IO’s
buffers
Core
Kernel
Signal Handler(s)
Asynchronous
signals
IRQs
User Space
interrupts
Kernel Space
Real-time Embedded System Lab, ASU
WCAE_05_ 9
Sample Projects
 Midi file player
 a driver to control PWM as a tone generator
 a blocking call which returns once the play duration is over
(interruptible_sleep_on and timer interrupt)
 a main program to parse an input midi file and to invoke the
driver for each note (frequency and duration)
 Magnetic card reader
 a card reader driver (bit streams input from general-purpose
IO pins)
 the ISR-driven approach for block data transfer (bit banging)
and signal handlers
 a driver for serial port (ioctl to configure UART)
 a main program to read card information and send to serial
port
Real-time Embedded System Lab, ASU
WCAE_05_ 10
Evaluation
 Survey at the end of Fall 2004
 Summary in 5 categories
C Programming skill improved
Strongly
Disagree
Use Linux/Development Tools
effectively
Strongly
Disagree
Strongly
Disagree
Strongly
Agree
Disagree
Understand Architecture/Schematics
Neutral
Disagree
Disagree
Strongly
Agree
Strongly
Agree
Neutral
Neutral
Agree
Agree
Can write drivers to manage interfaces
and peripherals
Strongly
Disagree
Disagree
Agree
Motivated to work in embedded
Systems
Strongly
Disagree
Strongly
Agree
Disagree
Agree
Neutral
Strongly
Agree
Agree
Neutral
Real-time Embedded System Lab, ASU
WCAE_05_ 11
Conclusion
 Re-tool the existing microprocessor system
course
 SoC platform
 High-level language programming
 IO management as a part of operating system
 Didn’t abandon assembly language
 to explain processor execution model
 to interact with programs of multiple languages
 to determine the tradeoffs of selecting a proper language
 No textbook, manuals and data sheets are more
than 2000 pages
Real-time Embedded System Lab, ASU
WCAE_05_ 12
Acknowledgement
 NSF EIA program
 Motorola Dragonball University Program
 Embedded System Consortium (ASU, Intel, and
Motorola)
Real-time Embedded System Lab, ASU
WCAE_05_ 13