【大学课件】CS4101 嵌入式系统概论Design and Development.ppt
CS4101 嵌入式系統概論Design and Development,http:/,Recap,More and more physical things will be augmented or embedded with computingThings become“smarter”Computing becomes ubiquitousAn embedded system is a system that is embedded with programmable computers for specific applications of that systemWhy embedded systems?Faster,more flexible development at lower costMore complex functionalities,http:/,Suppose You Have a Product Idea,To develop a device that can record,for each day,the number of stairs that the user has climbed up or downFrom this number,we can then calculate the amount of CO2 saved and calories burnedLet us call this device stair counterHow to start from here?,http:/,Typical Design Flow,requirements,specification,architecture,componentdevelopment,systemintegration,Top-downdesign,Bottom-updesign,Real design often iterative,http:/,Requirements,Plain language description of what the user wants and expects to gete.g.to develop a device that can record,for each day,the number of stairs that the user has climbed up or downDescribe how the end product is usedby the userMay be developed in several ways:talking directly to customerstalking to marketing representativesproviding prototypes to users for comment,http:/,Requirements,Often need to know target customers and business modelStair counter as an add-on of cell phoneStair counter as a consumer productStair counter as a gift,http:/,Requirements,Functional requirements:Internals as a black box and describe only the outputs as a function of input;Show number of stairs climbed up or downShow amount of CO2 savedDo not count in other casesNon-functional requirements:Performance,reliability,etc.Size,weight,etc.Power consumptionCost,Describe“WHAT”,not“HOW”,http:/,Requirements Form,http:/,Specification,More precise,usually quantitative description of the system:Should not imply a particular architectureList assumptionse.g.,update screen 0.25 sec after eachstep,error rate 95%,cost$300May include functional and non-functional elementsMay be executable or may be in mathematical form for proofse.g.UML(Unified Modeling Language),http:/,Architecture Design,What major components satisfy the specification?HOWNeed to know what are availableHardware components:CPUs,peripherals,etc.e.g.MSP430 CPU,3-axis accelerometerSoftware components:Major programs and their operationse.g.no OS,accelerometer driver,LCD driverMust take into account functional and non-functional specifications,http:/,Design Considerations,Environment which the embedded system is inExternal and internal stimulus sources that interact with the embedded system I/OActions and events caused by stimulusElements of the embedded system that could be affected by the stimulusDesired system responses to the stimulus,which reflects one or more system requirements algorithm/workflowHow the system responses can be measures,http:/,Component Development,Actual implementation of individualhardware and software componentsMust spend time architecting the system before you start codingSome components are ready-made,some can be modified from existing designs,others are to be designed from scratche.g.MSP430 CPU,3-axis accelerometerGood surveys help,http:/,System Integration,Put together the componentsMany bugs appear only at this stageRequire good interface definition fromthe startHave a plan for integrating components to uncover bugs quickly,test as much functionality as early as possible test and verification,http:/,System Development,Now that you have better idea of the requirements,specifications,and architecture of the stair counterHow to proceed to develop the components and integrate the system?But,Real hardware?Programming environment?,http:/,Development Environment,Host:a computer running programming tools for developmentTarget:the HW on which code will runAfter program is written,compiled,assembled and linked,it is transferred to the target,Host system,Target system,X86,MSP430,http:/,What If Real HW Not Available?,Development board:Before real hardware is built,software can be developed and tested using development boardsDevelopment boards usually have the same CPU as the end product and provide many IO peripherals for the developed software to useas if it were running on thereal end productTools for program developmentIntegrated Development Environment(IDE):cross compiler,linker,loader,OS and related libraries and packages,http:/,Cross Compiler,Runs on host but generates code for targetTarget usually have different architecture from host.Hence compiler on host has to produce binary instructions that will be understood by target,http:/,Development Process,Process for creating instructions that are built on host but meant for the targetTools are compatible with each other a toolchainBinutils:as,ldGlibc:C runtime LibGCC:C/C+compiler,http:/,Linker/Locators,For computers:Linker:creates an image file to be run on hostLoader:loads image file into memory during run-timeFor embedded systems:Locater:creates a file,containing binary image or other format,that will be copied onto target,which run on its own(not through loader)It needs exact addresses beforehandCertain parts of program need in ROM and some in RAMNormally done by dividing program in segments Locator needs to be told where in memory to place segments,http:/,Summary,Development of a system usually involves:Requirement,specification,architecture design,component development,system integration,test and validationDevelopment environment of an embedded system often includesDevelopment host with toolchain:cross compiler,linker/loader,library,emulatorDevelopment board,http:/,