Unformatted text preview:

Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Program Development Tools IDE vs point toolsTwo tool flavors exist for developing embedded software:-IDEs: (Integrated Development Environments) i.e., AVRStudio, Codewarrior, Elicpse-Point tool environment (Unix/Linux (*nix) centric)vi, gcc, gas, ld, avr-objcopy, avr-objconv, avrdudeBoth have their advantages depending upon the programming environment.We will be using point tool model for several reasons:-you can understand the details of what is going on (nothing is hidden)-the tools are free (free as in freedom and free as in beer)-you can have these tools on your laptop-you get valuable exposure to Linux and programming editorsProgram Development Tools Programming EditorsMany good programming editors exist, but...We will focus on vi...why?...it's the one I know!vi (pronounced “vee eye”, not “vye”)-vi is available on all *nix systems.-vi is fast and stays out of your way-no menus, short commands, no”mouseing”-high beginning threshold (~12 commands)-master the first dozen, then add to your repertoire-vi help sites-http://staff.washington.edu/rells/R110/help_vi.html-http://www.vmunix.com/~gabor/vi.html-http://docs.freebsd.org/44doc/usd/12.vi/paper.html (Joy and Horton)-http://thomer.com/vi/vi.html (fun vi site)When I say vi, I really mean vim. vi must be aliased to vim on Ubuntu.which vi <enter>vi: aliased to vimProgram Development Tools Editor PhilosophyYou will do more programming than you think. Hardware designers now mostly design using design description languages (verilog and vhdl). In other areas, being able to program in shell scripts or PERL is vital.Learn one editor really well. Use it for all your editing tasks. Make sure the editor is available everywhere you will work and that it is configurable, extensible and programmable.-Language sensitive syntax highlighting-Auto completion, and indention-Boilerplate insertion-Compiler supportAn editor needs to stay out of the way of thinking. It becomes an extension of your hand that needs no cognitive attention. You think it and code appears on the screen.Hands never stray far from the home row of keys.Program Development Tools Vi commandsTo begin editing a file:vi opens vivi file_name opens vi on file_nameview filename opens vi in read-only mode on file_nameTo close vi::q quit (it will query you if changes were made):q! quit without saving:x save and exit<shift>zz save and exitWriting a file::w write out current file:w new_name write out current file as new_name:wq write file and quit (like “x” or “<shift>zz)Read in a file::r file_name Read in file_name into current one after the cursorEdit a new file::e file_name Begin editing new file (need to save old one)Program Development Tools Vi commands – ModesInput Mode:Insert text:i insert text just prior to cursorAppend text:a append text just after cursorOpen line:o open a new line below the current oneO open a new line above the current oneReplace: r replace the character under cursorR replace continuously Exit input mode: <esc>Program Development Tools Vi commands – Modes Command mode:In command mode we do everything else.....-moving around in the file-search and replace-yank (copy) and put (paste)-delete-split screensCommand mode entered from input mode by <esc>You enter vi in the command mode.If you get totally confused and are afraid you have messed up the file, hit:<esc>then :q! You will exit insert mode and close the file leaving it unchanged.h j k lProgram Development Tools Vi commandsMoving around in the file:h move one character leftl move one character rightk move one line upj move one line down<ctrl>u move up one page<ctrl>d move down one pagew move forward 1 word (cursor at first character)b move back 1 word (cursor at first character)e move forwards by last letter in word$ move to end of line0 move to beginning of linegg move to top of page, column 1 (home)G move to last line, column 110G move to line 10:n go to line n<ctrl>G tell me where I am (file, line, column)Program Development Tools Vi commands Yank/paste, change, delete, repeat:yy yank current linep paste a line8yy yank next 8 lines (a subsequent paste will paste all 8 lines)x delete character (4x = delete next 4 characters)cw change worddw delete word ( 8dw = delete next 8 words)dd delete current line (line goes in paste buffer)10dd delete next 10 linesJ join next to line to currentu undo (multi-level repeat) (4u = undo last 10 commands)<ctrl>r redo last command. repeat last command (a killer command!)Program Development Tools Vi commands Search and Replace:/pattern search for pattern (forwards)?pattern search for pattern (backwards)n repeat last search:%s/old/new/greplace every occurrence of old with new in entire file% show the matching “()”, “[]” or “{}”* find next occurance of word under cursor# find previous occurance of word under cursorProgram Development Tools Vi commands Multiple screens::sp new_file open split screen with new_file displayed:vsp new_file open vertically split screen with new_file displayed<ctrl>ww move between screens<ctrl>wn split existing window<ctrl>wv split existing window verticallyProgram Development Tools Vi commands Shell and make commands:make compile file specified in Makefile:make program compile, link, and program target :make clean clean up compiler generated files :! <cmd> execute shell command without leaving vi, e.g.:! ls list contents of current directory:! date what is date and


View Full Document

OSU ECE 473 - Program Development Tools

Download Program Development Tools
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 Program Development Tools 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 Program Development Tools 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?