Top Banner
Embedded System Programming Andrew Ho
29

Embedded System Programming

Mar 19, 2016

Download

Documents

minor

Embedded System Programming. Andrew Ho. Agenda. Embedded System Overview Embedded System Developing Programming on Embedded System Q&A. Products with Embedded Systems?. Of 4 billions microprocessors/microcontrollers sold (2002), 95% are for embedded products: – VCRs, DVD players - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Embedded System Programming

Embedded System Programming

Andrew Ho

Page 2: Embedded System Programming

Agenda

• Embedded System Overview• Embedded System Developing• Programming on Embedded System• Q&A

Page 3: Embedded System Programming

Products with Embedded Systems?

• Of 4 billions microprocessors/microcontrollers• sold (2002), 95% are for embedded products:• – VCRs, DVD players• – Cell phone• – Microwave• – Washer• – Camera• – Cars• – Printers, copiers• – ….

Page 4: Embedded System Programming

Why are Embedded Systems Different?

• Dedicated to a specific task or tasks• Rich variety of microprocessors (over 300 types)• Designs are cost-sensitive• May have real-time performance constraints• Often used with Real-Time Operating Systems (RTOS)• Software failure can be life-threatening• May have constraints on power consumption• Operate over a wide-range of environmental conditions• Fewer system resources than a desktop system• All code might be stored in ROM• Require specialized design tools• May need on-chip debugging resources

Page 5: Embedded System Programming

What’s an Embedded System?

• From Wikipedia : An embedded system is a special-purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few pre-defined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, benefiting from economies of scale. • Simple : “A programmable component of subsystem providing some intelligence functions to the system of which it is a part.”

Page 6: Embedded System Programming

What’s an Embedded System?

• This can include:– Any device, or collection of devices, that contain one or more dedicated computers, microprocessors, or microcontrollers.– Microprocessor chips– Programmable logic elements (FPGA, ASIC etc.)– Device(s) may be local - Printer, automobile, etc.– Devices may be distributed - Aircraft, ship, internet appliance.– A PC or workstation may be an embedded system.

Page 7: Embedded System Programming

What’s an Embedded System?

• Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks. Some also have real-time performance constraints that must be met, for reason such as safety and usability; others may have low or no performance requirements, allowing the system hardware to be simplified to reduce costs.

• An embedded system is not always a separate block - very often it is physically built-in to the device it is controlling

• The software written for embedded systems is often called firmware, and is stored in read-only memory or Flash memory chips rather than a disk drive. It often runs with limited computer hardware resources: small or no keyboard, screen, and little memory.

Page 8: Embedded System Programming

Example : ADSL modem router1. Telephone decoupling electronics (for ADSL).2. Multicolour LED (displaying network status).3. Single colour LED (displaying USB status).4. Main processor, a TNETD7300GDU, a member of Texas Instruments' AR7 pr

oduct line.5. JTAG (Joint Test Action Group) test and programming port.6. RAM, a single ESMT M12L64164A 8 MB chip.7. Flash memory, obscured by sticker.8. Power supply regulator.9. Main power supply fuse.10. Power connector.11. Reset button.12. Quartz crystal.13. Ethernet port.14. Ethernet transformer, Delta LF8505.15. KS8721B ethernet PHY transmitter receiver.16. USB port.17. Telephone (RJ11) port.18. Telephone connector fuses.

Page 9: Embedded System Programming
Page 10: Embedded System Programming

Characteristics• No Architectural Link to Standard Platforms• Real-time Constraints

– Time sensitive– Time critical

• May or May Not have OS services available• Power Constraints• Low Fault Tolerance• Often engineered for the highest possible

performance at the lowest cost

Page 11: Embedded System Programming

Microprocessor V.S. Microcontroller

• Microprocessor– An integrated circuit which forms the central processing unit for a computer or embedded controller, but required additional support circuitry to function– MC68000, 80486, Pentium, K6, MicroChip PIC, etc.

• Microcontroller– A microprocessor plus additional peripheral support devices integrated into a single package– Peripheral support devices may include : Serial ports (COM ), Parallel (Ports ), Ethernet ports, A/D&D/A, Interval timers, watchdog timers, event counter/timers, real time clock (RTC)– Other local processors (DSP, numeric coprocessor, peripheral controller)

Page 12: Embedded System Programming

Microprocessor V.S. Microcontroller

Page 13: Embedded System Programming

An Embedded System Example

Page 14: Embedded System Programming

Embedded System Developing• Target system

– The embedded system under development• Host computer

– The standard platform being used to develop the software and link to the target system for debugging

• Cross-development– Using host-based tools to create a code image

running on a different instruction set architecture

Page 15: Embedded System Programming

Development Environment

Page 16: Embedded System Programming

Development Environment• Where to store executable image on target system ?• ROM or FLASH

– Good for final product– Hold the bits permanently after power is turned off– Impractical during the development stage– Reprogramming the ROM or the FLASH memory is time– consuming

• RAM– Cannot used in final product– Lose data almost immediately after power is turned off– Good in development stage– Processor writes to memory simply and quickly

Page 17: Embedded System Programming

Development Environment• How to transfer the image onto the target?

– Image Download• To transfer an executable image from host onto the target system.

– Possible Approaches• Download the image through either a JTAG or BDM interface• Downloading the image over a serial (RS-232) or network

connection• Write the image to EEPROM or Flash

Page 18: Embedded System Programming

Development Lifecycle

Page 19: Embedded System Programming

Design Trade-offs• Target Driven – For special purpose• Consider :

– Implement by H/W or S/W?– Soc ?– Resources?– OS-based?– Cost : Performance ?

Page 20: Embedded System Programming

Considerations• Must be dependable:

– Reliability– Maintainability– Availability– Safety– Security

• Must be efficient:– Energy efficient– Code-size efficient (especially for systems on a chip)– Run-time efficient– Weight efficient– Cost efficient

Page 21: Embedded System Programming

Considerations

• Many ES must meet real-time constraints:– A real-time constraint is called hard, if not me

eting that constraint could result in a catastrophe

– All other time-constraints are called soft

Page 22: Embedded System Programming

Programming on Embedded System

• Difference of programming on ES – Maybe no OS

• Handle all HW by programmer.– Programming and Operating on different

platform• Host/Target• Cross-compiler• Upload and Debug

– I/O interface– Limited Resources– Highly H/W Dependence

Page 23: Embedded System Programming

Programming on Embedded System

• There are MANY architectures of programming an embedded system.– Simple control loop– Interrupt controlled system– Cooperative multitasking (nonpreemptive multitasking

system)– Preemptive multitasking : OS based– Microkernels and exokernels(MIT) : Step up from RT

OS (Real Time OS)– Monolithic kernels (Embedded Linux or Windows CE)

Page 24: Embedded System Programming

Programming on Embedded System

• What kinds of program should be handled?– Boot loader– Operation system– Device drivers– System services– Applications– User Interface– Communication– ………

Page 25: Embedded System Programming

System Developing Steps

• Survey market and requirements• Define the system scale and functions• Define the design specifications• Review and refine the design spec• Division of labor with H/W and S/W

Page 26: Embedded System Programming

System Developing Steps• For S/W :

– Architecture developing– Module design– Implementation– Module testing/verifying– Integration– System testing– System debugging

• For H/W– H/W design (IC design, system design)– H/W simulation– H/W emulation– H/W verification

Page 27: Embedded System Programming

System Developing Steps

• Whole System– System testing/verifying– System debugging– Mass production– System customization

• Developing new features/applications

Page 28: Embedded System Programming

Example

Page 29: Embedded System Programming

Q & A