DOC PREVIEW
MIT 16 070 - Developing Software for Embedded Systems

This preview shows page 1-2-3-4-5-6 out of 19 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Developing Software for Embedded Systems*3/7/01 Lecture #12 16.070• Handyboards have been distributed -- Welcome to theworld of programming embedded systems!•Embedded system– Computer hardware, software, other parts designed toperform a specific function– Component within larger system - in cars, air/spacecraft• Embedded software in almost every electronic device– Watches, VCRs, cellular phones, microwaves, thermostats– In US, ~8 µprocessor-based devices for every person• Each embedded system is unique, with specializedhardware and specialized software*Reference: “Programming Embedded Systems,” by Michael Barr, in A/A LibraryDeveloping Software for Embedded Systems• Steps involved in preparing embedded software similar togeneral programming– Follow five steps in Software Design Process– Use Spiral Model– Decide on programming language (C)– Know capabilities/limitations of processor/compiler• Main difference is that target hardware platform is unique– Leads to additional software complexity– Software Engineer must be aware of software build processEmbedded Software Development ProcessHost•Development Platform•General Purpose•More capable processor•More memory•Different I/O•Capable OS•Development Tools-Editor-Compiler-DebuggerTarget•Embedded Hardware Platform•Special purpose•Limited processor, memory, I/O•Stripped down OS/kernal•No development tools•Software Development is performed on a Host computer–Compiler, Assembler, Linker, Locator, Debugger–Produces executable binary image that will run on Target Embedded SystemComm LinkProgramming Embedded Systems• Embedded Systems Programming requires a more complex softwarebuild process– Target hardware platform consists of• Target hardware (processor, memory, I/O)• Runtime environment (Operating System/Kernel)– Target hardware platform contains only what is needed for finaldeployment– Target hardware platform does not contain development tools (editor,compiler, debugger)• Target hardware platform is different from development platform– Development platform, called the Host Computer, is typically a general-purpose computer– Host computer runs compiler, assembler, linker, locator to create a binaryimage that will run on the Target embedded systemProcess for Developing Embedded Software• To develop software for a General Purpose Computer– Create source file– Type in C code– Build: compile and link– Execute: load and run• To develop software for an embedded system– Create source file (on Host)– Type in C code (on Host)– Compile/Assemble: translate into machine code (on Host)– Link: combine all object files and libraries, resolve all symbols (on Host)– Locate: assign memory addresses to code and data (on Host)– Download: copy executable image into Target processor memory– Execute: reset Target processorCompiling Embedded Systems• Compiler translates program written in human-readable language intomachine language– Source Code --> Object file– Object file is binary file that contains set of machine-languageinstructions (opcodes) and data resulting from language translationprocess• Machine-language instructions are specific to a particular processor• Can the host computer’s compiler be used to compile a program to runon the target computer?•A Native-compiler runs on a computer platform and produces code forthat same computer platform•A Cross-compiler runs on one computer platform and produces codefor another computer platformAssemblers/Interpreters for Embedded Systems• In some cases, a compiler is not used–Assembler performs one-to-one translation from human-readableassembly language mnemonics to equivalent machine-languageopcodes–Interpreter constantly runs and interprets source code as a set ofdirectives» Performs syntax checking as program is typed in» Result is slow performance - can be ~1000x slower than an equivalentcompiled language» Interactive capability provides more feedback -- easier to learnHandyboard Interpreter• Handyboard runs a C interpreter called Interactive C– C code is compiled into custom language– Custom language is interpreted by p-code– In interactive mode, syntax checked in IC console window» E.g., To clear HB screen, type in following line:printf (“\n”);Linking Embedded Systems• The Linker combines object files (from compiler) andresolves variable and function references– Source code may be contained in >1 file, which must becombined– Resolve variables which may be referenced in one file anddefined in another file– Resolve calls to library functions, like sqrt– May include operating system• Linker creates a “relocatable” version of the program– Program is complete, except no memory addresses assignedLocating Embedded Systems•A Locator is the tool that performs the conversion fromrelocatable program to executable binary image• The Locator assigns physical memory addresses to codeand data sections within the relocatable program• The Locator produces a binary memory image that can beloaded into the target ROM• In contrast, On General Purpose Computers, the operatingsystem assigns the addresses at load timeDownloading and Executing Your Program• Once a program has been successfully compiled, linked,and located, it must be moved to the target platform• Download the binary image to the embedded system– Executable binary image is transferred and loaded into amemory device on target board• Can be loaded into ROM via a device programmer, which“burns” a chip that is then re-inserted into the embeddedsystem• Handyboard must be put into bootstrap download mode first,then data can be transferred via serial port into memory• Your program will then execute when you reset theprocessor, or apply power to the embedded systemReview Process for Developing Embedded Software• To develop software for an embedded system– Create source file (on Host)– Type in C code (on Host)– Compile/Assemble: translate into machine code (on Host)– Link: combine all object files and libraries, resolve all symbols (on Host)– Locate: assign memory addresses to code and data (on Host)– Download: copy executable image into Target processor memory– Execute: reset Target processorProcess for Developing Handyboard Software• To develop software for the Handyboard– Create source file (on Host)– Type in C code (on Host)– Download file:» Compile:


View Full Document

MIT 16 070 - Developing Software for Embedded Systems

Documents in this Course
optim

optim

20 pages

Load more
Download Developing Software for Embedded Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Developing Software for Embedded Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Developing Software for Embedded Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?