- Tera Term Macro Loop Example
- Tera Term Macro Examples Definition
- Tera Term Macro
- Tera Term Macro Examples Geometry
- Tera Term Macro Examples
- Tera Term Macro File Example
TeraTerm Macro language for dummies. A common use that I have for the wait/sendln pair is to send a series of commands to a machine. For example, when sending a series of commands to a Linux box, it might look something like the following. Hello!I'm looking for a way to make my EEM script more dynamic and automated for my environment. This is what I have - basically I just capture the 4 IPSec peer IP addresses of each neighbor and insert this data into 4 different variables.
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
May the source be with you, but remember the KISS principle ;-) Skepticism and critical thinking is not panacea, but can help to understand the world better |
News | Telnet Clients | Recommended Links | Teraterm Macros | Reference for macrolanguage | Invoking Teraterm from command line | Highlights of enhancements in latest versions |
Teraterm log and replay function | Using different backgound for different servers in Teraterm | SSH | Password-less SSH login | TTSSH | Using Pageant for authentication | |
CygTerm+ | Exceed HostExplorer | Putty | Telnet protocol | Teraterm connect command | LogMeTT | TTPMenu |
Expect | GNU Screen | Tips | Admin Horror Stories | Unix History | Humor | Etc |
Teraterm is a very important program for any Unix system administrator. So even a little time spend to study it and to adopt better configuration brings great dividends. While colors used and size of the screen necessary is highly idiosyncratic, there are still many common themes and problems for which the following tips might be useful:
- Double clicking on .TTL file doesn't always launch macro. You need to associate the correct program with this extension. Sometimes teraterm.exe is associated instead of ttpmacro.exe. That leads to troubles.
- The way Teraterm presents the list of sites to which you connected is OK if this is just a dozen servers, but became troublesome if this is several dozens. It does not allow any hierarchy -- it is a flat list and wrong attempts are also recorded in it. This is a serious drawback in case the list in large.
In the latter case you can extract the list from TERATERM.INI. They are located close to the end of the file, starting with the line [Hosts] andhave the format like that
You can extract them using egrep and then cut them at '=' to extract the DNS names of each server and then convert into connect string. Which allow you to generates as many macros as you you have defined hosts (in simplest case macro is just a one-liner with just connect command) that login to each server you administer. In the simplest form such script can be create using xargs command. Something along the lines
- You can specify initial terminal size, for example 184 x 56 in Setup/Terminal. It makes sense to specify several predefined sized that suit you display size and selected font (full screen size, half-size and quarter-size to allow stacking of terminals, etc). For example:
- Manually editing teraterm.ini actually simpler than finding settings in the menu. Also it allows to change some settings that are not in menu.
- There are limited but useful SCP capabilities. They can be use for downloading a tar ball with your dot files and some config files after you just installed the server.
- You can log you session when using Teraterm. You can specify both Log directory name and logname (which can include strftime(3) marcos; they are the same as in Unix date function, so most sysadmin known them really well). Creating unique log filename for each instance of Teraterm is necessary if you open several terminals
- You can set an automatic timestamping of each log like via LogTimestamp=on . Usually this is not necessary as it complicates cut and paste from the log.
- See Teraterm log and replay function for more information
- If loggin is not defaut setting, you can start Teraterm with /L switch which enables logging. For that you can create a small script file
- /L=<log file>
- Authentication notes. There is a difference between SSH authenticating using 'passphrase' (the default method of authentication in Teraterm distribution) and challenge/response (keyboard interactive). Most SSH servers refuse passphrase authentication. To enable it you need to change in you /etc/ssh/sshd_config file (or equivalent) the following setting
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords noYou can change the default method via Setup/SSH authentication and then selection 'use challenge/response to log in...' (or change DefaultAuthMethod=3 to DefaultAuthMethod=5 in teraterm.ini file)
That makes Teraterm behavior compatible with Putty where this authentication method is a default.
You can use Pageant for authentication
- With a special setting (Setup -> Additional Settings -> Copy & Paste ->DisableMouseRButtonPaste) version 4.58 (but not 4.62) understands Unix-style middle mouse button paste operation.
- Tera Term command has multiple line option, with some very useful but rarely known (for example /R replay option, /M macro file specification)
Options
- <host>
- Host name or IP address or Named pipe.
- <host>:<TCP port#>
- <host> with a TCP port number.
':' is placed between <host> and <TCP port#>. - <host> <TCP port#>
- <host> with a TCP port number.
Space character(s) between <host> and <TCP port#>.
Number just after <host> is interpreted as a port number. - telnet://<host>[:<TCP port#>][/]
- URL style - for telnet handler
TCP port number and '/' at the end are optional.
If TCP port number is omitted, use 23. (TCPPort setting in setup file is ignored.) - /B
- Telnet binary option.
- /BAUD=<baud rate>
- baud rate of serial port. If the baud rate not supported by Tera Term is specified, this option is ignored.
- /C=<serial port#>
- Serial port
- /C=1 COM1
- /C=2 COM2
- /C=3 COM3
- ... ... ...
- /C=256 COM256
- /DUPLICATE
- Internal use(must not specify this option)
- /DS
- Disable displaying the 'New connection' dialog on startup
- /E
- Disable TCPLocalEcho and TCPCRSend option
- /ES
- Enable displaying the 'New connection' dialog on startup
- /F=<setup file>
- Setup file [2]
/F=TERATERM.INI (default)
If this value is not a full path, it is understood as a relative path from ttermpro.exe. - /FD=<file transfer directory>
- File transfer directory [2]
- /H
- Hide title bar.
- /I
- Start Tera Term in iconized state.
- /K=<keyboard setup file>
- Keyboard setup file [2]
/K=KEYBOARD.CNF (default)
If this value is not a full path, it is understood as a relative path from ttermpro.exe. - /KR=<kanji code (receive)>
- Note: Japanese, Korean and UTF-8 mode only
- /KR=SJIS
- /KR=EUC
- /KR=JIS
- /KR=UTF8 UTF-8(Normalization Form C: Windows, Linux)
- /KR=UTF8m UTF-8(Normalization Form D: Mac OS X)
- /KR=KS5601 for Korean mode
- /KT=<kanji code (transmit)>
- Note: Japanese and Korean mode only
- /KT=SJIS
- /KT=EUC
- /KT=JIS
- /KT=UTF8
- /KT=KS5601 for Korean mode
- /L=<log file>
- Start Tera Term with logging. [2]
- /LA=<language>
- Language mode.
- /LA=E English
- /LA=J Japanese
- /LA=K Korean
- /LA=R Russian
- /LA=U UTF-8
- /M=<macro file>
- Start Tera Term with macro. [2]
If this value is not a full path, it is understood as a relative path from ttermpro.exe. - /MN=<multicastname>
- Multicast name for sendmulticast macro command. [2]
- /NOLOG
- Start Tera Term without logging.
- /P=<TCP port#>
- TCP port number
- /R=<replay file>
- Replay file [2]
- /T=<telnet flag>
- /T=1 Enable telnet
- /T=0 Disable telnet
- /TEKICON=<icon name>
- TEK window icon. Could be specify the same value of TEKIcon of setup file.
- /TIMEOUT=<connecting timeout value>
- Could be specified per seconds.
- /V
- Start Tera Term in hidden (invisible) state.
- /VTICON=<icon name>
- VT window icon. Could be specify the same value of VTIcon of setup file.
- /W=<window title>
- Window title [2]
A user should put the window title in quotations by using `' character two times to include the character. - /X=<window position (x)>
- Windows position (horizontal)
- /Y=<window position (y)>
- Windows position (vertical)
- /NAMEDPIPE
- Named pipe(<ServerName>pipe<PipeName>)
- /AUTOWINCLOSE=<flag>
- AutoWinClose
- /AUTOWINCLOSE=on Automatically close the window on disconnection.
- /AUTOWINCLOSE=off Do not close the window on disconnection.
- ;<comment>
- Comment. Should be last in the command line.
Examples
Default values
Following default values are stored in the Tera Term setup file:
Notes
[1] Only if <telnet flag> is 1 (on) and <TCP port#> is 23, Tera Term starts spontaneously sending telnet commands to the host for the option negotiation when the TCP/IP connection is established. In any cases, Tera Term can respond to telnet commands sent by the host.
[2] Quote the multicast name when the name includes the space and `' character. And then, a user should put the window title in quotations by using `' character two times to include the character.
NEWS CONTENTS
- 20141120 : TeraTerm Macro language for dummies (or something like that) ( Oct 21, 2012 , TeraTerm Support Forums )
- 20141120 : Log and replay functions ( Log and replay functions, )
- 20141120 : Vim Control Sequence Example ( Vim Control Sequence Example, )
- 20141120 : Tips on telnet connection with a port other than 23 ( Tips on telnet connection with a port other than 23, )
- 20141120 : Log and replay functions ( Log and replay functions, )
Old News ;-)
Switchboard | |||||
Latest | |||||
Past week | |||||
Past month |
[Nov 20, 2014] TeraTerm Macro language for dummies (or something like that)
Oct 21, 2012 | TeraTerm Support Forums
Location: WisconsinSo I'm attempting to consolidate what I know of the TeraTerm language into a single mega-post. If you have any knowledge that you think would be a valuable addition to this post, feel free to let me know.
Note that this is pretty much just an abridged form of the language reference tied into a somewhat cohesive format. Just because something isn't mentioned here doesn't mean it doesn't exist; check out the official language reference and search the forums to get a handle on some of TeraTerm's more advanced features. This is really not a full-fledged tutorial to take you from the very basics of computer literacy; if you have no prior programming experience this may be challenging to follow.
As a little precursor, if you happen to use Programmer's Notepad as your editor of choice, the NSIS Installer highlighting scheme matches fairly well with this scripting language. Vim users might be able to make use of this highlighting scheme (somewhat outdated, won't have latest keywords).
TeraTerm basics
So to start things off, let's deal with variables.
There are two types of variables: Strings (limited to 255 characters) , and Integers (Limited to ~ +/-2 billion) (want to go bigger?). The type is determined implicitly when the variable is created and cannot be altered afterwards.
Also, since TeraTerm 4.72, there are now arrays of both of these types (limited to 65536 indices per array)
- integerVariable=10 ; An Integer variable
- strVariable='asdf' ; A string variable
- strVariable2='0' ; Still a string variable
- integerVariable='asdf' ; ERROR!!!!!!
- integerVariable=2
- ; A little fun with arrays:
- intdim integerArray 10 ; Create an integer array of size 10
- integerArray[0]=10 ; Assigns the first element of the array to 0
- integerArray[10]=10 ; ERROR!!!!!
- ; It's almost exactly the same for strings, just using strdim instead:
- strdim strArray integerVariable ; Creates a string array that has the size given in integerVariable
- ; Also, by the way, the semicolon (;) is the character that denotes a comment; anything after it in a line has no effect on the running of your script (notice how I used the semicolon in a grammatically correct way in a sentence about semicolons ;-)
But variables by themselves are boring. The real basis of any programming language is the if statement. However an if statement by itself is somewhat boring, so let's go a little further and also show you a wait statement:
- wait 'value = 0' 'ERROR'
- if result=1 then
- ; value = 0 was received on the terminal
- elseif result=2
- ; ERROR was received on the terminal
- endif
The wait statement is one of the more or less unique features of TeraTerm. Essentially, it reads through all of the serial output that hasn't been parsed yet, and when one of the strings in its sensitivity list is found, it sets result to the index of that string and moves on. The documentation for the setsync command has a partial general overview for how TeraTerm internally works.
Note that you can also set a timeout for wait, and it will then only hold up the execution of the script for at most timeout.mtimeout seconds:
- timeout=1
- mtimeout=500 ; Set the timeout for 1.5 seconds
- wait 'Good' 'Bad'
- if result=0 then
- ; Neither good nor bad appeared in the terminal output during the 1.5 seconds
- endif
A nice counterpoint to the 'wait' command is the 'sendln' and 'send' commands. These guys do pretty much what their names suggest: they write stuff back out to the terminal (with sendln adding a newline at the end of its string). A common use that I have for the wait/sendln pair is to send a series of commands to a machine. For example, when sending a series of commands to a Linux box, it might look something like the following:
- wait 'root@localhost#'
- sendln 'command'
- wait 'root@localhost#'
- sendln 'command'
- wait 'root@localhost#'
- sendln 'command'
This ensures that the prior command has finished before you send the next command. The sendkcode command is also occasionally useful in some cases.
Note that the above code is somewhat ugly. If the prompt were to change (say from root@localhost to root@servername), I'd have to manually replace a bunch of lines. Since I'm lazy, the following format is much nicer:
- cmdPrompt='root@localhost'
- wait cmdPrompt
- sendln 'command'
- wait cmdPrompt
- sendln 'command'
- wait cmdPrompt
- sendln 'command'
That looks much nicer.
Looping
Branching is all well and good, but eventually you will want to do something that has some repetition in it. Teraterm has several more or less standard looping constructs
- do while i>0
- i = i - 1
- loop
- do
- i=i-1
- loop while i>0
- for j 1 10
- i=j+i
- next
- until i > 10
- i = i + 1
- enduntil
- while i>0
- i = i - 1
- endwhile
I won't go into too much detail about all of these; TeraTerm probably has more looping constructs than is really healthy, but definitely keep in mind the 'for' loop, and the fact that the 'do while' loop can be done as a pre-test loop or a post-test loop. The 'break' command can also be used to escape from a loop before its condition triggers
Lastly for the basics is TeraTerm's goto command. Some people (especially those experienced with C and who have experienced the nightmares of spaghetti code) view gotos as positively evil and wish they could be nuked from every language in existence. Gotos can do just about anything, but typically not as nicely as one of the above looping structures. About the only place that gotos should really go is in error handling:
- wait 'Good' 'Bad'
- if result=2 goto ERROR
- ; Presumably, a bunch of non-related code goes here
- exit ; Typically, you don't want to execute the error code upon successful completion of the normal code, so this exits before doing that
- :ERROR
- ; Error-handling/messaging code goes here
- exit
TeraTerm and regular expressions
Regular expressions are an interesting creature in and of themselves. An old and relatively well-known quote about regular expressions (regexes) goes something like this:
Quote:
Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems.
Regexes are a double-edged sword that allow you to do stuff with strings that would normally not be possible. Since I don't really want to go into all the nitty gritty, here's a link to wikipedia, as well as afairly-well-laid-out regex tutorial site. Note that TeraTerm has also posted a reference for the regex engine that they use, but that isn't really laid out for learning...
TeraTerm has several commands which use the power of regular expressions (let me know which one's I'm forgetting...):
- waitregex <string1 with regular expression> [<string2 with regular expression> ...]
- strmatch <target string> <string with regular expression>
- strreplace <strvar> <index> <regex> <newstr>
strmatch and strreplace are both relatively normal. You put your regular expression in, and TeraTerm works its magic.
waitregex is a beast that I've seen misused in these forums time and again. In many ways, it is identical to the wait command, just with regular expression support. The large difference is with regular expression matching. Regular expression matching is what happens when a regular expression with parenthesis triggers on a string. The result inside the string is then returned (in normal regular expressions, it is returned as 1, 2, 3, etc, while with TeraTerm, they are stored in the groupmatchstr1, groupmatchstr2,...,groupmatchstr9 variables).
An example is as follows:
- waitregex 'value = ([0-9]+)' 'ERROR'
- if result=1 then
- str2int returnValue groupmatchstr1
- endif
Let's pick the above code fragment apart bit by bit.
First we have '[0-9]+' This regex essentially grabs the largest amount of consecutive characters that fall between 0 and 9. The parenthesis '(...)' are what initiate the grouping. With the parenthesis, the string that was caught by '[0-9]+' gets stored into groupmatchstr1. If the regular expression as a whole was triggered, the result will be one and the if statement will let the str2int command work its magic. The str2int command (and its counterpart, the int2str command) do exactly what their names suggest: convert between string and integer variables.
Thus, if the 'value = 5643' was received on the terminal, this code would set returnValue to 5643
Note that waitregex only works on the first 255 characters of a line, so anything further than that and you're going to have to find another way.
File input and output
My file I/O skills are minimal at best. Anything that you'd care to offer is gladly accepted
Also, don't forget about the ability to use logging commands in some cases (check out loginfo, logopen, logclose, logstart, logpause, and logwrite)
User input and output
Most of the commands used here are described in the Miscellaneous Commands section of the TTL Command Reference.
- messagebox <message> <title>
This is one of the most commonly-used UI-type commands of the macro language. It pops up a window with the title equal to <title>, and the content equal to <message>, with an Ok button at the bottom. Note that code beneath this command won't execute until Ok is clicked.
- yesnobox <message> <title>
This is almost identical to the messagebox, however rather than an Ok button, there's a Yes and a No button. If Yes is clicked, result=1, otherwise result=0
- inputbox <message> <title> [<default>]
The third of the *box commands that I use on a normal basis, this is like the messagebox command, but with an area that the user can type stuff in. That area is populated with <default> when the window first appears, and after the user clicks Ok, the variable 'inputstr' contains the value of that area.
Strings!!!
Fill this section with stuff for commands like sprintf2
Connecting to things other than serial ports and whatnot
I'm really not at all good with TeraTerm in this department. If someone else here has some wisdom to offer, feel free to drop it off here...
Any feedback is appreciated, both for my sake, and for all of the newbies out there. The main goal of this post is to be a one-stop learning reference for people who are just learning the language, as well as to facilitate the general usability of it through simple examples.
Good luck, bon apetit, hasta la vista, whatever. Just go out and make/break something...
Changelog:
10/24/2012 - Added a brief (unverified) description of arrays (I use a slightly older version of TT at work, and primarily use Linux at home currently, so I haven't had a chance to play around with these)
10/31/2012 - Added more formatting/hyperlinks and clarified a few points
Let's keep the suggestions coming!
_________________
If one of my posts helped you out, do me a favor:
Next time anyone asks you for help, go out of your way to help them.
Thanks!
Log and replay functions
You can save the host data to the file if you use Tera Term logging function.
Log to the file
You can log characters received from the host. Execute the [File] Log command to start logging.
Do in the following commands:
- Do [File] Log command.
- 'Tera Term: Log' dialog box will be shown.
Input the saving file name to `File Name:'.
All host data will be written to the file if you check `Binary' option.
KANJI, CR and LF codes are converted to host character code, written to the file if you uncheck `Binary' option. However, the escape sequences are not written to the file.
The host data will append the file if you check `Append' option.
The host data will overwrite the file if you uncheck `Append' option. - Push OK button, 'Tera Term: Log' icon will be shown. And logging will start.
- Push Close or Pause button on the logging dialog box if you finish the logging or temporarily stop. Pause button will change into Start button if you push Pause button, the logging will restart.
To browse log files, which contain escape sequences, it is convenient to use the replay function of Tera Term. To replay a log file.
Replay the log file
Run Tera Term with command line in the following:
Tera Term analyzes the specified log file and understands the escape sequence datas. If so, the contents of log file will be displayed in Tera Term window as if the characters were received from the host. We call this function 'replay log'.
And also, you can also use 'Host:' on the [File] New connection command.
Vim Control Sequence Example
Auto indent can be disabled on pasting from clipboard
Basically, the host application can not recognize the difference between the user input and pasting from clipboard. However, when a user uses the Bracketed Paste Mode as the xterm extension, the application can recognize its difference and a user can change the behavior of pasting from clipboard.
The vim configuration is described below. The following will use xterm's bracketed paste mode to make pasting automatically enable paste mode and insert mode. Also works fine in ~/.vimrc file.
When a user pastes at the normal mode by using the above configuration, the mode will be automatically changed to the insert mode and do the paste. If this behavior is denied, use the below configuration.
Also, refer to the GNU Screen Notice.
The vim editor can automatically recognize the terminal color number, namely the 256 color supporting because the Tera Term 4.83 or later supports the Termcap String Query of xterm. So, a user must properly configure the background setting to draw the highlight color regarding the vim background color.
When the background color is the dark color(i.e, black), specify the dark setting. Also, when the background color is the bright color(i.e, white), specify the light setting.
With above setting, the vim can know the terminal background color. So, if the configuration is mistaken, the highlight color will be indistinct because the text and the background color is almost same.
If the vim automatic recognition of color is stopped, add the set t_RV= entry in the .vimrc file. However, the automatic recognition of mouse type is stopped.
Also, refer to the :help 'background' on the vim editor for details.
Tips on telnet connection with a port other than 23
On the command line, or on the [File] New connection dialog box, you can specify the TCP port number (<TCP port#>) and telnet flag (<telnet flag>) for a TCP/IP connection. If these parameters are omitted in the command line, the default values are taken from the Tera Term setup file.
Only if <telnet flag> is 1 (on) and <TCP port#> is 23, Tera Term starts spontaneously sending telnet commands to the host for the option negotiation when the TCP/IP connection is established.
This particular port number for telnet, 23, can be changed by editing the TelPort line in the [Tera Term] section of setup file like the following:
Log and replay functions
You can save the host data to the file if you use Tera Term logging function.
Log to the file
You can log characters received from the host. Execute the [File] Log command to start logging.
Do in the following commands:
- Do [File] Log command.
- 'Tera Term: Log' dialog box will be shown.
Input the saving file name to `File Name:'.
All host data will be written to the file if you check `Binary' option.
KANJI, CR and LF codes are converted to host character code, written to the file if you uncheck `Binary' option. However, the escape sequences are not written to the file.
The host data will append the file if you check `Append' option.
The host data will overwrite the file if you uncheck `Append' option. - Push OK button, 'Tera Term: Log' icon will be shown. And logging will start.
- Push Close or Pause button on the logging dialog box if you finish the logging or temporarily stop. Pause button will change into Start button if you push Pause button, the logging will restart.
To browse log files, which contain escape sequences, it is convenient to use the replay function of Tera Term. To replay a log file.
Replay the log file
Run Tera Term with command line in the following:
Tera Term analyzes the specified log file and understands the escape sequence datas. If so, the contents of log file will be displayed in Tera Term window as if the characters were received from the host. We call this function 'replay log'.
And also, you can also use 'Host:' on the [File] New connection command.
Recommended Links
Google matched content |
Softpanorama Recommended
Top articles
Sites
Top articles
Sites
Etc
Society
Groupthink :Two Party System as Polyarchy : Corruption of Regulators :Bureaucracies :Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia :Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience :Who Rules America :Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
Quotes
War and Peace: Skeptical Finance : John Kenneth Galbraith :Talleyrand :Oscar Wilde :Otto Von Bismarck :Keynes :George Carlin :Skeptics :Propaganda : SE quotes : Language Design and Programming Quotes :Random IT-related quotes : Somerset Maugham :Marcus Aurelius :Kurt Vonnegut :Eric Hoffer :Winston Churchill :Napoleon Bonaparte :Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis :Political Skeptic Bulletin, 2013 :Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments :Slightly Skeptical Euromaydan Chronicles, June 2014 :Greenspan legacy bulletin, 2008 :Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) :Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 :Inequality Bulletin, 2009 :Financial Humor Bulletin, 2008 :Copyleft Problems Bulletin, 2004 :Financial Humor Bulletin, 2011 :Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult :Political Skeptic Bulletin, 2011 :Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000): the triumph of the US computer engineering :Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds :Larry Wall :John K. Ousterhout : CTSS : Multix OSUnix History : Unix shell history :VI editor :History of pipes concept :Solaris : MS DOS : Programming Languages History :PL/1 : Simula 67 :C :History of GCC development : Scripting Languages :Perl history :OS History : Mail :DNS : SSH : CPU Instruction Sets :SPARC systems 1987-2006 :Norton Commander :Norton Utilities :Norton Ghost :Frontpage history :Malware Defense History :GNU Screen : OSS early history
Classic books:
The Peter Principle : Parkinson Law : 1984 :The Mythical Man-Month : How to Solve It by George Polya :The Art of Computer Programming :The Elements of Programming Style :The Unix Hater’s Handbook :The Jargon file :The True Believer :Programming Pearls :The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society :Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story :The Cuckoo's Egg :IT Slang : C++ Humor : ARE YOU A BBS ADDICT? :The Perl Purity Test :Object oriented programmers of all nations : Financial Humor :Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor :Goldman Sachs related humor :Greenspan humor : C Humor :Scripting Humor :Real Programmers Humor :Web Humor : GPL-related Humor : OFM Humor :Politically Incorrect Humor :IDS Humor : 'Linux Sucks' Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor :Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor :Networking Humor :Shell Humor :Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 :Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor :Education Humor : IBM Humor : Assembler-related Humor :VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not LeastTechnology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2020 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICEThis site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
You can use PayPal to to buy a cup of coffee for authors of this site |
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society.We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.
Last modified:July 28, 2019
NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
- 3Scripts
- 4What about DaVinci TeraTerm Scripts?
- 5What about OMAP-L1 TeraTerm Scripts?
- 6What about using a DLP Pico Projector?
Introduction[edit]
Tera Term is an opensource terminal emulator on MS-Windows commonly used by us developers. Tera Term supports a 'rich' macro language that can help in automating user actions. These scripts usually remain personal - rarely shared.
In this page, I intend to share the basic scripts that can be used to automate common tasks in the Linux PSP release. The scripts were created with intentional hierarchy to maximize reuse (via inclusion) and minimize redundancy across scripts. Currently, these scripts apply to OMAP35x Linux PSP. But, can be extended easily to other platforms.
Needless to say, these scripts are open to enhancements.
How to execute a TeraTerm script?[edit]
Scripts[edit]
File Naming Conventions[edit]
- A file containing common macros - that can be included in other scripts - is prefixed with double underscore e.g.
__common.ttl
- The purpose / functionality of the file can be indicated after a '-' (minus) in the file name e.g.
__uboot-config.ttl
- Name of the container script that you execute is prefixed with name of the board e.g.
omap3evm-boot-ramdisk.ttl
.
__common.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file __common.ttl
- desc Common definitions used across the macros.
- HISTORY
- 2007-11-30 Sanjeev Premi
- Original Version
- DEFINITIONS
- Current Date
getdate CurDate
- Current Time
gettime CurTime
- Title of the Tera Term Window
StrWindowTitle = 'OMAP35x EVM'
- Boot methods
Boot_RAMDISK = 'RAMDISK'Boot_NFS = 'NFS'
- Is Lauterbach used for debug?
UseLauterbach = 0
- Caption prefix
StrCaption = ':::::::::::::::::::::::::::::::::::::::: '
- Dividers
StrEmpty = #13#10StrDivider_1 = '#13#10StrDivider_2 = '-----------------------------------------------------'#13#10StrDivider_3 = '.....................................................'#13#10
- Set position of status dialog box
setdlgpos 10 10
- Set window title
settitle StrWindowTitle
</syntaxhighlight>
__uboot-config-common.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file __uboot-config-common.ttl
- desc Common u-boot related definitions
- HISTORY
- 2007-11-30 Sanjeev Premi
- Original Version
- DEFINITIONS
- The u-boot message to stop autoboot.
MsgAutoboot = 'Hit any key to stop autoboot:'
- The u-boot prompt
PromptUboot = 'OMAP3EVM #'
- EXECUTION
- Disable autoload
wait PromptUbootsendln 'setenv autoload no'
</syntaxhighlight>
__uboot-config-network.ttl[edit]
This file uses dummy values for various macros. They need to be defined with correct values for your platform.
<syntaxhighlight>
- Tera Term Macro
- file __uboot-config-network.ttl
- desc Configure the u-boot network settings.
- HISTORY
- 2007-11-30 Sanjeev Premi
- Original Version
- DEFINITIONS
- Ethernet on EVM
VarMacAddr = 'A1:B1:C1:E1:D1:E1'VarGatewayIP = '192.168.1.1'VarNetMask = '255.255.255.0'
- Server running the TFT Server
VarServerIP = '192.168.1.2'
- Get IP address from DHCP server
CmdDHCP = 'dhcp'
- EXECUTION
- Setup Network
wait PromptUbootsendln 'setenv ethaddr ' VarMacAddr
wait PromptUbootsendln 'setenv gatewayip ' VarGatewayIP
wait PromptUbootsendln 'setenv netmask ' VarNetMask
- Set the IP address of the TFTP Server
wait PromptUbootsendln 'setenv serverip ' VarServerIP
- Get an IP Address
wait PromptUbootsendln CmdDHCP
- Set the IP address of the TFTP Server again.
- (Required on some networks)
wait PromptUbootsendln 'setenv serverip ' VarServerIP
</syntaxhighlight>
__uboot-load-kernel.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file __uboot-load-kernel.ttl
- desc Steps to boot the Linux kernel.
- HISTORY
- 2007-11-30 Sanjeev Premi
- Original Version
- DEFINITIONS
- Name of the boot file
BootFile = 'uImage'
- Boot arguments
BootArgs_RAMDISK = 'console=ttyS0,115200n8 mem=128M root=/dev/ram0 rw initrd=0x81600000,16M ip=dhcp'BootArgs_NFS = 'console=ttyS0,115200n8 mem=128M root=/dev/nfs noinitrd nfsroot=192.168.1.10:/home/user/remote/098,nolock,rsize=1024,wsize=1024 ip=dhcp'
- Boot commands
CmdLoadRamDisk = 'tftpboot 0x81600000 kernel/ramdisk.gz'CmdLoadUimage = 'tftpboot 0x80000000 kernel/uImage'CmdBootm = 'bootm 0x80000000'
- EXECUTION
- General configuration
wait PromptUbootsendln 'setenv bootfile ' BootFile
- Set boot arguments
wait PromptUboot
strcompare VarBootMethod Boot_RAMDISKif result=0 then
endif
strcompare VarBootMethod Boot_NFSif result=0 then
endif
- Print current environment (Just for the record)
wait PromptUbootsendln 'printenv'
- Load RamDisk Image
strcompare VarBootMethod Boot_RAMDISKif result=0 then
endif
- Load uImage
wait PromptUbootsendln CmdLoadUimage
- Boot Linux
wait PromptUbootif UseLauterbach=0 then
elseif UseLauterbach=1 then
endif
</syntaxhighlight>
__kernel-common.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file __kernel-common.ttl
- desc Common kernel related definitions & commands.
- HISTORY
- 2007-11-30 Sanjeev Premi
- Original Version
- DEFINITIONS
- The Linux kernel prompt
PromptLinux = '[root@OMAP3EVM /]# '
- Clear screen
CmdClear = 'clear'
</syntaxhighlight>
__kernel-power.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file __kernel-power.ttl
- desc Common power related definitions and commands.
- HISTORY
- 2008-04-25 Sanjeev Premi
- Original Version
- DEFINITIONS
- Set LCD timeout to 2 secs
CmdFbTimeout = 'echo 2 > /sys/power/fb_timeout_value'
- Different pause durations used in testing
PauseLog = 2PauseNormal = 30PauseSuspendBefore = 5PauseSuspendAfter = 10
- Strings indicating sleep duration
StrSleepNormal = 'Wait for 30 secs'#13#10StrSleepBeforeSuspend = 'Wait for 5 secs'#13#10StrSleepAfterSuspend = 'Wait for 60 secs'#13#10
- Strings indicating actions performed
StrSuspend = 'Attempt Suspend'#13#10StrResume = 'Attempt Resume (send key click)'#13#10
StrViewPowerStates = 'View previous power states'#13#10StrViewDeepestIdleState = 'View the deepest IDLE state'#13#10
StrViewGovernor = 'View current governor'#13#10
StrViewVDD1 = 'View VDD1 OPP'#13#10StrViewVDD2 = 'View VDD2 OPP'#13#10
StrViewClock_MPU_IVA = 'View MPU & IVA clocks'#13#10StrViewClock_VirtVDD = 'View virtual VDD clocks'#13#10
- ----------------------------------------------------------------------------
- CPUIDLE
- ----------------------------------------------------------------------------
- Set deepest IDLE state
CmdShowPowerStates = 'cat /proc/pm_prepwst'
- Show current deepest IDLE state
CmdShowDeepestIdleState = 'cat /sys/power/cpuidle_deepest_state'
- Show status of OMAP clocks
CmdShowClocks = 'cat /proc/omap_clocks'
- Set deepest IDLE state
CmdSetDeepestIdleState_0 = 'echo '0' > /sys/power/cpuidle_deepest_state'CmdSetDeepestIdleState_1 = 'echo '1' > /sys/power/cpuidle_deepest_state'CmdSetDeepestIdleState_2 = 'echo '2' > /sys/power/cpuidle_deepest_state'CmdSetDeepestIdleState_3 = 'echo '3' > /sys/power/cpuidle_deepest_state'CmdSetDeepestIdleState_4 = 'echo '4' > /sys/power/cpuidle_deepest_state'CmdSetDeepestIdleState_5 = 'echo '5' > /sys/power/cpuidle_deepest_state'CmdSetDeepestIdleState_6 = 'echo '6' > /sys/power/cpuidle_deepest_state'
- Put system to 'suspend' state
CmdSuspend = 'echo -n 'mem' > /sys/power/state'
- ----------------------------------------------------------------------------
- CPUFREQ
- ----------------------------------------------------------------------------
- OMAP Clocks
CmdShowAllClocks = 'cat /proc/omap_clocks'CmdShowClock_MPU = 'cat /proc/omap_clocks | grep mpu'CmdShowClock_IVA = 'cat /proc/omap_clocks | grep iva'CmdShowClock_VDDs = 'cat /proc/omap_clocks | grep virt'
- Governor related
CmdShowGovernor = 'cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
CmdSetGovernor_Ondemand = 'echo 'ondemand' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'CmdSetGovernor_Performance = 'echo 'performance' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
- Set OPPs for VDD1
CmdSetVDD1_1 = 'echo '1' > /sys/power/vdd1_opp_value'CmdSetVDD1_2 = 'echo '2' > /sys/power/vdd1_opp_value'CmdSetVDD1_3 = 'echo '3' > /sys/power/vdd1_opp_value'CmdSetVDD1_4 = 'echo '4' > /sys/power/vdd1_opp_value'CmdSetVDD1_5 = 'echo '5' > /sys/power/vdd1_opp_value'
CmdShowVdd1 = 'cat /sys/power/vdd1_opp_value'
- Set OPPs for VDD2
CmdSetVDD2_1 = 'echo '1' > /sys/power/vdd2_opp_value'CmdSetVDD2_2 = 'echo '2' > /sys/power/vdd2_opp_value'
CmdShowVdd2 = 'cat /sys/power/vdd2_opp_value'
</syntaxhighlight>
__test-cpuidle.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file __test-cpuidle.ttl
- desc Unit tests for 'cpuidle' framework.
- HISTORY
- 2008-04-25 Sanjeev Premi
- Original Version
include '__common.ttl'
- DEFINITIONS
- Testcase title
StrDescription = 'UNIT TEST CASES FOR CPUIDLE'#13#10
- Strings indicating deepest idle state
StrDeepestIdleState_0 = 'Deepest Idle State = 0'#13#10StrDeepestIdleState_1 = 'Deepest Idle State = 1'#13#10StrDeepestIdleState_2 = 'Deepest Idle State = 2'#13#10StrDeepestIdleState_3 = 'Deepest Idle State = 3'#13#10StrDeepestIdleState_4 = 'Deepest Idle State = 4'#13#10StrDeepestIdleState_5 = 'Deepest Idle State = 5'#13#10StrDeepestIdleState_6 = 'Deepest Idle State = 6'#13#10StrDeepestIdleState_9 = 'Deepest Idle State = 9 (Incorrect)'#13#10
- Commands for negative testing
CmdSetDeepestIdleState_9 = 'echo '9' > /sys/power/cpuidle_deepest_state'
- EXECUTION
wait PromptLinux
sendln CmdFbTimeoutwait PromptLinux
sendlnwait PromptLinux
- Open log file
logopen 'test-cpuidle.log' 0 0logstart
logwrite StrEmpty
logwrite StrCaptionlogwrite CurDatelogwrite StrEmpty
logwrite StrCaptionlogwrite CurTimelogwrite StrEmpty
pause PauseLogsendlnwait PromptLinux
- C0
StrStateCaption = StrDeepestIdleState_0CmdDeepestIdleState = CmdSetDeepestIdleState_0
call ExecIdleTest
- C1
StrStateCaption = StrDeepestIdleState_1CmdDeepestIdleState = CmdSetDeepestIdleState_1
call ExecIdleTest
- C2
StrStateCaption = StrDeepestIdleState_2CmdDeepestIdleState = CmdSetDeepestIdleState_2
call ExecIdleTest
- C3
StrStateCaption = StrDeepestIdleState_3CmdDeepestIdleState = CmdSetDeepestIdleState_3
call ExecIdleTest
- C4
StrStateCaption = StrDeepestIdleState_4CmdDeepestIdleState = CmdSetDeepestIdleState_4
call ExecIdleTest
- C5
StrStateCaption = StrDeepestIdleState_5CmdDeepestIdleState = CmdSetDeepestIdleState_5
call ExecIdleTest
- C6
StrStateCaption = StrDeepestIdleState_6CmdDeepestIdleState = CmdSetDeepestIdleState_6
call ExecIdleTest
- C9
StrStateCaption = StrDeepestIdleState_9CmdDeepestIdleState = CmdSetDeepestIdleState_9
call ExecIdleTest_N
- Return to C2
sendlnsendlnwait PromptLinux
sendlnsendln CmdSetDeepestIdleState_2wait PromptLinux
- ----------------------------------------------------------------------------
- Close log file
- ----------------------------------------------------------------------------
sendlnwait PromptLinux
pause PauseNormallogclose
exit
- SUBROUTINES
- ExecIdleTest
- Execute the CPUIDLE Tests
msgStatus =
- State caption
strconcat msgstatus StrStateCaptionstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrDivider_2logwrite StrStateCaptionlogwrite StrDivider_2
pause PauseLog
- Set deepest idle state
- (Additional 'newlines' sent just in case first is missed in deeper C states)
sendlnsendlnwait PromptLinuxsendlnsendln CmdDeepestIdleStatewait PromptLinux
pause PauseLog
- View previous power states
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewPowerStateslogwrite StrEmpty
pause PauseLog
strconcat msgstatus StrViewPowerStatesstatusbox msgstatus TitleWindow
sendlnsendlnwait PromptLinuxsendlnsendln CmdShowPowerStateswait PromptLinux
pause PauseLog
- Wait for 'PauseNormal'
- (Additional 'newline' sent just in case first is missed in deeper C states)
strconcat msgstatus StrSleepNormalstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrSleepNormallogwrite StrEmpty
pause PauseNormal
sendlnsendlnwait PromptLinux
pause PauseLog
- View previous power states (again)
- (Additional 'newline' sent just in case first is missed in deeper C states)
strconcat msgstatus StrViewPowerStatesstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewPowerStateslogwrite StrEmpty
pause PauseLog
sendlnsendlnwait PromptLinuxsendlnsendln CmdShowPowerStateswait PromptLinux
pause PauseLog
- Wait for 'PauseSuspendBefore'
- (Additional 'newline' sent just in case first is missed in deeper C states)
strconcat msgstatus StrSleepBeforeSuspendstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrSleepBeforeSuspendlogwrite StrEmpty
pause PauseSuspendBefore
sendlnsendlnwait PromptLinux
pause PauseLog
- Suspend
strconcat msgstatus StrSuspendstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrSuspendlogwrite StrEmpty
pause PauseLog
sendlnsendlnwait PromptLinuxsendlnsendln CmdSuspend
- Wait for 'PauseSuspendAfter'
strconcat msgstatus StrSleepAfterSuspendstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrSleepAfterSuspendlogwrite StrEmpty
pause PauseSuspendAfter
- Resume
strconcat msgstatus StrResumestatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrResumelogwrite StrEmpty
sendlnwait PromptLinux
flushrecv
pause PauseLog
closesbox
return
- SUBROUTINE
- Execute the CPUIDLE Tests (Negative)
- ExecIdleTest_N
msgStatus =
- State caption
strconcat msgstatus StrStateCaptionstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrDivider_2logwrite StrStateCaptionlogwrite StrDivider_2
pause PauseLog
- Set deepest idle state
- (Additional 'newline' sent just in case first is missed in deeper C states)
sendlnsendlnwait PromptLinuxsendlnsendln CmdDeepestIdleStatewait PromptLinux
flushrecv
pause PauseLog
closesbox
return
</syntaxhighlight>
__test-cpufreq.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file __test-cpufreq.ttl
- desc Unit tests for 'cpufreq' framework.
- HISTORY
- 2008-04-25 Sanjeev Premi
- Original Version
include '__common.ttl'
- DEFINITIONS
- Testcase title
StrDescription = 'UNIT TEST CASES FOR CPUFREQ'#13#10
- Strings related to governors
StrGovernorOndemand = 'Set ONDEMAND Governor'#13#10StrGovernorPerformance = 'Set PERFORMANCE Governor'#13#10
- Strings indicating OPPs
StrOppVdd1_1 = 'VDD1 OPP = 1'#13#10StrOppVdd1_2 = 'VDD1 OPP = 2'#13#10StrOppVdd1_3 = 'VDD1 OPP = 3'#13#10StrOppVdd1_4 = 'VDD1 OPP = 4'#13#10StrOppVdd1_5 = 'VDD1 OPP = 5'#13#10
StrOppVdd1_6 = 'VDD1 OPP = 6 (Incorrect)'#13#10
StrOppVdd2_1 = 'VDD2 OPP = 1'#13#10StrOppVdd2_2 = 'VDD2 OPP = 2'#13#10StrOppVdd2_3 = 'VDD2 OPP = 3'#13#10
StrOppVdd2_4 = 'VDD2 OPP = 4 (Incorrect)'#13#10
- Commands for negative testing
CmdSetVDD1_6 = 'echo '6' > /sys/power/vdd1_opp_value'CmdSetVDD2_4 = 'echo '4' > /sys/power/vdd2_opp_value'
- EXECUTION
wait PromptLinux
sendln CmdFbTimeoutwait PromptLinux
sendln CmdClearwait PromptLinux
sendlnwait PromptLinux
- Open log file
logopen 'test-cpufreq.log' 0 0logstart
logwrite StrEmpty
logwrite StrCaptionlogwrite CurDatelogwrite StrEmpty
logwrite StrCaptionlogwrite CurTimelogwrite StrEmpty
pause PauseLogsendln
- Show current governor & switch to 'ondemand' governor
StrStateCaption = StrOppVdd1_1CmdSetVDD1 = CmdSetVDD1_1
call ExecGovernors
- VDD1 - OPP1
StrStateCaption = StrOppVdd1_1CmdSetVDD1 = CmdSetVDD1_1
call ExecFreqTest
- VDD1 - OPP2
StrStateCaption = StrOppVdd1_2CmdSetVDD1 = CmdSetVDD1_2
call ExecFreqTest
- VDD1 - OPP3
StrStateCaption = StrOppVdd1_3CmdSetVDD1 = CmdSetVDD1_3
call ExecFreqTest
- VDD1 - OPP5
- (Do this early so we don't keep MPU in overdrive for long during negative
- tests).
StrStateCaption = StrOppVdd1_5CmdSetVDD1 = CmdSetVDD1_5
call ExecFreqTest
- VDD1 - OPP4
StrStateCaption = StrOppVdd1_4CmdSetVDD1 = CmdSetVDD1_4
call ExecFreqTest
- VDD1 - OPP6 (Negative)
StrStateCaption = StrOppVdd1_6CmdSetVDD1 = CmdSetVDD1_6
call ExecFreqTest_N
- VDD2 - OPP1
StrStateCaption = StrOppVdd2_1CmdSetVDD2 = CmdSetVDD2_1
call ExecFreqTest2
- VDD1 - OPP2
StrStateCaption = StrOppVdd2_2CmdSetVDD2 = CmdSetVDD2_2
call ExecFreqTest2
- VDD1 - OPP3
StrStateCaption = StrOppVdd2_3CmdSetVDD2 = CmdSetVDD2_3
call ExecFreqTest2
- ----------------------------------------------------------------------------
- Close log file
- ----------------------------------------------------------------------------
sendlnwait PromptLinux
pause PauseNormallogclose
exit
- SUBROUTINES
- ExecGovernors
- Execute the CPUFREQ Tests
msgStatus =
- State caption
strconcat msgstatus StrStateCaptionstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrDivider_2logwrite StrStateCaptionlogwrite StrDivider_2
pause PauseLogsendlnwait PromptLinux
- Show current governor
strconcat msgstatus StrViewGovernorstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewGovernorlogwrite StrEmpty
sendln CmdShowGovernorwait PromptLinux
pause PauseLog
- Set 'ondemand' governor
strconcat msgstatus StrGovernorOndemandstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrGovernorOndemandlogwrite StrEmpty
pause PauseLog
sendln CmdSetGovernor_Ondemandwait PromptLinux
- View virtual VDD clocks
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewClock_VirtVDDlogwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowClock_VDDs
pause PauseLog
- View current MPU & IVA clocks
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewClock_MPU_IVAlogwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowClock_MPU
pause PauseLog
sendlnwait PromptLinux
sendln CmdShowClock_IVAwait PromptLinux
pause PauseLog
closesbox
return
- ExecFreqTest
- Execute the CPUFREQ Tests
msgStatus =
- State caption
strconcat msgstatus StrStateCaptionstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrDivider_2logwrite StrStateCaptionlogwrite StrDivider_2
pause PauseLog
- Set VDD1 OPP
sendlnwait PromptLinux
sendln CmdSetVDD1wait PromptLinux
pause PauseLog
- View current VDD1 OPP
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewVDD1logwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowVdd1
pause PauseLog
- View current VDD2 OPP
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewVDD2logwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowVdd2
pause PauseLog
- View virtual VDD clocks
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewClock_VirtVDDlogwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowClock_VDDs
pause PauseLog
- View current MPU & IVA clocks
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewClock_MPU_IVAlogwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowClock_MPU
pause PauseLog
sendlnwait PromptLinux
sendln CmdShowClock_IVAwait PromptLinux
pause PauseLog
- Wait for 'PauseSuspendBefore'
strconcat msgstatus StrSleepBeforeSuspendstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrSleepBeforeSuspendlogwrite StrEmpty
pause PauseSuspendBefore
sendlnwait PromptLinux
pause PauseLog
- Suspend
strconcat msgstatus StrSuspendstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrSuspendlogwrite StrEmpty
pause PauseLog
sendlnsendln CmdSuspend
- Wait for 'PauseSuspendAfter'
strconcat msgstatus StrSleepAfterSuspendstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrSleepAfterSuspendlogwrite StrEmpty
pause PauseSuspendAfter
- Resume
strconcat msgstatus StrResumestatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrCaptionlogwrite StrResumelogwrite StrEmpty
sendlnwait PromptLinux
flushrecv
pause PauseLog
closesbox
return
- ExecFreqTest2
- Execute the CPUFREQ Tests (VDD2)
msgStatus =
- State caption
strconcat msgstatus StrStateCaptionstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrDivider_2logwrite StrStateCaptionlogwrite StrDivider_2
pause PauseLog
- Set VDD2 OPP
sendlnwait PromptLinux
sendln CmdSetVDD2wait PromptLinux
pause PauseLog
- View current VDD1 OPP
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewVDD1logwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowVdd1
pause PauseLog
- View current VDD2 OPP
logwrite StrEmptylogwrite StrCaptionlogwrite StrViewVDD2logwrite StrEmpty
pause PauseLog
sendlnwait PromptLinux
wait PromptLinuxsendln CmdShowVdd2
pause PauseLog
sendlnwait PromptLinux
flushrecv
pause PauseLog
closesbox
return
- SUBROUTINE
- Execute the CPUFREQ Tests (Negative)
- ExecFreqTest_N
msgStatus =
- State caption
strconcat msgstatus StrStateCaptionstatusbox msgstatus TitleWindow
logwrite StrEmptylogwrite StrDivider_2logwrite StrStateCaptionlogwrite StrDivider_2
pause PauseLog
- Set VDD1 OPP
sendlnwait PromptLinux
sendln CmdSetVDD1wait PromptLinux
flushrecv
pause PauseLog
closesbox
return
</syntaxhighlight>
omap3evm-flash-uboot.ttl[edit]
<syntaxhighlight></syntaxhighlight>
omap3evm-boot-ramdisk.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file omap3evm-boot-ramdisk.ttl
- desc Steps to boot the Linux kernel using ramdisk on the OMAP3EVM.
- HISTORY
- 2007-11-30 Sanjeev Premi
- Original Version
include '__common.ttl'
VarBootMethod = Boot_RAMDISK
include '__uboot-config-common.ttl'include '__uboot-config-network.ttl'include '__uboot-load-kernel.ttl'
include '__kernel-common.ttl'include '__kernel-boot.ttl'
</syntaxhighlight>
omap3evm-boot-nfs.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file omap3evm-boot-nfs.ttl
- desc Steps to boot the Linux kernel using NFS on the OMAP3EVM.
- HISTORY
- 2007-11-30 Sanjeev Premi
- Original Version
include '__common.ttl'
VarBootMethod = Boot_NFS
include '__uboot-config-common.ttl'include '__uboot-config-network.ttl'include '__uboot-load-kernel.ttl'
include '__kernel-common.ttl'include '__kernel-boot.ttl'
</syntaxhighlight>
omap3evm-test-power.ttl[edit]
<syntaxhighlight>
- Tera Term Macro
- file omap3evm-test-power.ttl
- desc Steps to execute Power Management test cases on the OMAP3EVM.
- HISTORY
- 2008-04-25 Sanjeev Premi
- Original Version
include '__common.ttl'
include '__kernel-common.ttl'
include '__kernel-power.ttl'
include '__test-cpuidle.ttl'include '__test-cpufreq.ttl'
beeppause 1beeppause 1beep
</syntaxhighlight>
What about DaVinci TeraTerm Scripts?[edit]
Below are a few simple scripts used to boot a DaVinci EVM - obviously you'll need to modify your IP address, kernel name and rootpath appropriately. These examples should serve as a good starting point if you want to create your own scripts.
To run the scripts, simply hit any key during the U-boot countdown to get to the U-boot prompt. Then run 'Macro->Control' and browse to the *.ttl.
DM6446: Crossover Script[edit]
When you don't have a switch/router and need to boot your EVM using TFTP/NFS, you can directly connect your EVM to your laptop with a crossover cable. Here, the Linux host's IP address is set to 192.168.1.100 (modify as needed). To manually set the Linux host's IP address:
- host$ su - Login as root
- host# setup - Setup your network
- Browse to Network Configuration, then choose 'Yes' (to Setup Network)
- Uncheck 'Use dynamic IP configuration' using the spacebar (if needed)
- Tab to 'IP address:' and type 192.168.1.100 and tab (using default values for Netmask, Gateway and Nameserver) to 'OK' and hit Enter. Save your settings when prompted.
- host# /etc/init.d/network restart - Restart your network
- host# ipconfig - Verify that your IP address has been set to 192.168.1.100
Also, note the $(videoargs) setting below (setup for DVSDK 1.30)--if you are using an older DVSDK, simply remove $(videoargs) from the bootargs.
<syntaxhighlight>
- Tera Term Macro
- file dm6446_crossover.ttl
- comments rename serverip, rootpath and bootfile
showtt 0setsync 1
sendln 'setenv serverip 192.168.1.100'waitrecv '#' 1 0
sendln 'setenv ipaddr 192.168.1.101'waitrecv '#' 1 0
sendln 'setenv nfshost $(serverip)'waitrecv '#' 1 0
sendln 'setenv rootpath /home/user/target'waitrecv '#' 1 0
sendln 'setenv videoargs video=davincifb:vid0=720x576x16,2500K:vid1=720x576x16,2500K:osd0=720x576x16,2025K davinci_enc_mngr.ch0_output=COMPOSITE davinci_enc_mngr.ch0_mode=ntsc'waitrecv '#' 1 0
sendln 'setenv bootargs $(videoargs) console=ttyS0,115200n8 noinitrd rw root=/dev/nfs nfsroot=$(nfshost):$(rootpath),nolock ip=$(ipaddr) mem=120M'waitrecv '#' 1 0
sendln 'tftpboot 0x80700000 uImage; bootm'waitrecv '#' 1 0</syntaxhighlight> Note: The use of parenthesis for variable substitution is being deprecated for new U-boot releases - use curly braces {} instead. Check http://www.denx.de/wiki/view/DULG/CommandLineParsing
Are there any DM355 examples?[edit]
Below are 4 macros for each of the boot options on DM355 - TFTP/NAND for kernel and NAND/NFS for file system):
Tera Term Macro Loop Example
<syntaxhighlight>
- Tera Term Macro
- file dm355_tftp_nfs.ttl
- comments rename the serverip, rootpath and bootfile
showtt 0setsync 1
sendln 'setenv serverip xxx.xxx.xxx.xxx'waitrecv '#' 1 0
sendln 'setenv nfshost $(serverip)'waitrecv '#' 1 0
sendln 'setenv rootpath /home/user/target'waitrecv '#' 1 0
sendln 'setenv videoargs video=dm355fb:vid0=720x480x16,2025K@0,0:vid1=720x480x16,2025K@0,0:osd0=720x480,1350K@0,0:osd1=720x480,1350K@0,0waitrecv '#' 1 0
sendln 'setenv bootargs $(videoargs) console=ttyS0,115200n8 root=/dev/nfs rw nfsroot=$(nfshost):$(rootpath) ip=dhcp mem=116M'waitrecv '#' 1 0
sendln 'setenv bootfile uImage'waitrecv '#' 1 0
sendln 'dhcp;bootm'waitrecv '#' 1 0</syntaxhighlight> Note: The use of parenthesis for variable substitution is being deprecated for new U-boot releases - use curly braces {} instead. Check http://www.denx.de/wiki/view/DULG/CommandLineParsing
<syntaxhighlight>
- Tera Term Macro
- file dm355_tftp_nand.ttl
- comments rename the serverip and bootfile
showtt 0setsync 1
sendln 'setenv serverip xxx.xxx.xxx.xxx'waitrecv '#' 1 0
sendln 'setenv videoargs video=dm355fb:vid0=720x480x16,2025K@0,0:vid1=720x480x16,2025K@0,0:osd0=720x480,1350K@0,0:osd1=720x480,1350K@0,0waitrecv '#' 1 0
sendln 'setenv bootargs $(videoargs) console=ttyS0,115200n8 root=/dev/mtdblock3 rw rootfstype=yaffs2 rw ip=dhcp mem=116M'waitrecv '#' 1 0
sendln 'setenv bootfile uImage'waitrecv '#' 1 0
sendln 'dhcp;bootm'waitrecv '#' 1 0</syntaxhighlight> Note: The use of parenthesis for variable substitution is being deprecated for new U-boot releases - use curly braces {} instead. Check http://www.denx.de/wiki/view/DULG/CommandLineParsing
<syntaxhighlight>
- Tera Term Macro
- file dm355_nand_nfs.ttl
- comments rename the serverip and rootpath
showtt 0setsync 1
sendln 'setenv serverip xxx.xxx.xxx.xxx'waitrecv '#' 1 0
sendln 'setenv nfshost $(serverip)'waitrecv '#' 1 0
sendln 'setenv rootpath /home/user/target'waitrecv '#' 1 0
sendln 'setenv videoargs video=dm355fb:vid0=720x480x16,2025K@0,0:vid1=720x480x16,2025K@0,0:osd0=720x480,1350K@0,0:osd1=720x480,1350K@0,0waitrecv '#' 1 0
sendln 'setenv bootargs $(videoargs) console=ttyS0,115200n8 root=/dev/nfs rw nfsroot=$(nfshost):$(rootpath) ip=dhcp mem=116M'waitrecv '#' 1 0
sendln 'nboot 0x80700000 0 0x400000;bootm'waitrecv '#' 1 0</syntaxhighlight> Note: The use of parenthesis for variable substitution is being deprecated for new U-boot releases - use curly braces {} instead. Check http://www.denx.de/wiki/view/DULG/CommandLineParsing
<syntaxhighlight>
- Tera Term Macro
- file dm355_nand_nand.ttl
showtt 0setsync 1
sendln 'setenv videoargs video=dm355fb:vid0=720x480x16,2025K@0,0:vid1=720x480x16,2025K@0,0:osd0=720x480,1350K@0,0:osd1=720x480,1350K@0,0waitrecv '#' 1 0
sendln 'setenv bootargs $(videoargs) console=ttyS0,115200n8 root=/dev/mtdblock3 rw rootfstype=yaffs2 rw ip=dhcp mem=116M'waitrecv '#' 1 0
sendln 'nboot 0x80700000 0 0x400000;bootm'waitrecv '#' 1 0</syntaxhighlight> Note: The use of parenthesis for variable substitution is being deprecated for new U-boot releases - use curly braces {} instead. Check http://www.denx.de/wiki/view/DULG/CommandLineParsing
Are there any DM6467 examples?[edit]
Below is an example ttl script for users with a switch/router. To reiterate one of the advantages of using a ttl script is that you can share boards between team members without wrenching their boot settings.
This ttl script has been tested in the DVSDK 1.40 environment.
Naturally replace the serverip with whatever /sbin/ifconfig shows as your IP address.
<syntaxhighlight>showtt 0setsync 1
sendln 'setenv serverip 158.123.45.678'waitrecv '#' 1 0
Tera Term Macro Examples Definition
sendln 'setenv nfshost $(serverip)'waitrecv '#' 1 0
sendln 'setenv ipaddr dhcp'waitrecv '#' 1 0
sendln 'setenv rootpath /home/user/workdir/filesys_dm6467'waitrecv '#' 1 0
sendln 'setenv bootargs console=ttyS0,115200n8 noinitrd rw root=/dev/nfs nfsroot=$(nfshost):$(rootpath),nolock ip=$(ipaddr) mem=120M davincihd_capture.channel0_numbuffers=4'waitrecv '#' 1 0
sendln 'setenv bootfile uImage.DM6467'waitrecv '#' 1 0
sendln 'dhcp;tftpboot;bootm'waitrecv '#' 1 0</syntaxhighlight>
Here is a DM6467T EVM Teraterm macro file for DVSDK 3.10. The macro provides the following options:
- Booting via static IP or DHCP address for EVM
- Loading kernel via TFTP or Flash
- Loading filesystem via NFS or HDD
<syntaxhighlight>
- Macro for Tera Term
- DM6467T EVM - DVSDK v3.10
- Texas Instruments
- Authors
- Prateek Bansal, Scott Specker
- Uncomment below line if using from command line. Note '/C=1' indicates COM1!! For COM2 use '/C=2'
- connect '/C=1'
- showtt Show TeraTerm window when inputting commands
showtt 1
- Synchronous mode - wait for > before next command is sent
setsync 1
- Disable autoload TFTP when invoking dhcp command to get IP address
sendln 'setenv autoload no'waitrecv '>' 1 0
- Set boot file if booting kernel via TFTP
sendln 'setenv bootfile uImage'waitrecv '>' 1 0
- Video settings for DVSDK 3.10 for DM6467T EVM
sendln 'setenv videocfg vpif_display.ch2_numbuffers=0 vpif_display.ch3_numbuffers=0'waitrecv '>' 1 0
- static ip (You can chose to hardcode the static IP address)
sendln 'setenv ipaddr 192.168.1.111'waitrecv '>' 1 0sendln 'setenv gateway 192.168.1.1'waitrecv '>' 1 0sendln 'setenv netmask 255.255.255.0'waitrecv '>' 1 0sendln 'setenv static_ip $ipaddr:$gateway:$netmask::::off'waitrecv '>' 1 0
- Bootcmd parameters for booting kernel from Flash or via TFTP
sendln 'setenv bootcmd_flash nboot 80700000 0 640000;bootm'waitrecv '>' 1 0sendln 'setenv bootcmd_tftp tftp;bootm'waitrecv '>' 1 0
- Shared NFS directory path
defaultNFSpath='/home/user/workdir/filesys'msg = 'Use Default NFS Path Address: 'strconcat msg defaultNFSpathyesnobox msg 'DaVinci Setup'if result then sendln 'setenv nfspath /home/user/workdir/filesys' waitrecv '>' 1 0else inputbox 'Enter NFS Path:' 'DaVinci Setup'
sendln 'setenv nfspath ' inputstr waitrecv '>' 1 0reboorooendif
- Boot with Static IP address or DHCP configuration for DM6467 EVM
yesnobox 'Boot Static or Dynamic? [Yes=Static, No=Dynamic(dhcp)]' 'DaVinci Setup'if result then sendln 'setenv myip $static_ip' waitrecv '>' 1 0else sendln 'dhcp' waitrecv '>' 1 0 sendln 'setenv myip dhcp' waitrecv '>' 1 0endif
- TFTP Server and NFS host IP Address - for loading uImage and NFS directory
defaultServerip='192.168.1.102'msg = 'Use Default TFTP Server IP Address: 'strconcat msg defaultServeripyesnobox msg 'DaVinci Setup'if result then sendln 'setenv serverip ' defaultServerip waitrecv '>' 1 0else inputbox 'Enter Server IP Address:' 'DaVinci Setup' sendln 'setenv serverip ' inputstr waitrecv '>' 1 0endif
- Set NFS host address same as serverip
sendln 'setenv nfshost $serverip'waitrecv '>' 1 0
- Boot HDD or NFS filesystem
yesnobox 'Boot using Root from HDD or NFS? (Yes=HDD, No=NFS)' 'DaVinci Setup'if result then sendln 'setenv bootargs_hdd mem=76M console=ttyS0,115200n8 noinitrd ip=$myip root=/dev/hda1' waitrecv '>' 1 0 sendln 'setenv bootargs $bootargs_hdd $videocfg' waitrecv '>' 1 0else sendln 'setenv bootargs_nfs mem=76M console=ttyS0,115200n8 noinitrd rw ip=$myip root=/dev/nfs nfsroot=$nfshost:$nfspath,nolock' waitrecv '>' 1 0 sendln 'set bootargs $bootargs_nfs $videocfg' waitrecv '>' 1 0endif
- Boot kernel from Flash or via TFTP
yesnobox 'Boot Kernel from Flash or via TFTP? (Yes=Flash, No=TFTP)' 'DaVinci Setup'if result then sendln 'set bootcmd $bootcmd_flash' waitrecv '>' 1 0else sendln 'set bootcmd $bootcmd_tftp' waitrecv '>' 1 0endif
- Save environment variables
yesnobox 'Save uboot environment variables?' 'DaVinci Setup'if result then sendln 'saveenv' waitrecv '>' 1 0endif
- Boot linux or go to uboot prompt
yesnobox 'Boot Linux now?' 'DaVinci Setup'if result then
else setdlgpos 200 200 msg='Use the 'boot' command when you want to boot the DVEVM' ;statusbox 'Message' 'Title' statusbox msg 'Boot later...' pause 2 closesboxendif
showtt 1</syntaxhighlight>
Note: The use of parenthesis for variable substitution is being deprecated for new U-boot releases - use curly braces {} instead. Check http://www.denx.de/wiki/view/DULG/CommandLineParsing
What about OMAP-L1 TeraTerm Scripts?[edit]
Are there any OMAPL137 examples?[edit]
Below is an example ttl script for users with a switch/router and NFS server. To reiterate one of the advantages of using a ttl script is that you can share boards between team members without wrenching their boot settings.
This ttl script has been tested in the SDK 1.00.00.10 environment and all directories and filenames match the default installation procedure as listed in the Installing the Software for OMAP-L137
Note: for OMAPL137 you must set the delay as mentioned in the What is a TeraTerm INI? section
- Replace the serverip with whatever /sbin/ifconfig shows as your IP address.
- Replace the useracct with the name you use to login to your Linux PC.
<syntaxhighlight>
- Keep the VT window open while executing macro
showtt 1
- Set the synchronous mode
setsync 1
- Set the title to make easier identification between boards
settitle 'OMAPL137'
- set tftp server ip address
sendln 'setenv serverip 192.168.1.89' ;CHANGE 192.168.1.89 TO MATCH YOUR CONFIGURATION!!!
- set nfs server ip address
sendln 'setenv nfshost ${serverip}'
- set nfs rootpath
sendln 'setenv rootpath /home/<useracct>/workdir/filesys' ;CHANGE <useracct> TO MATCH YOUR CONFIGURATION!!!
- set kernel command line argument
sendln 'setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=${nfshost}:${rootpath},nolock mem=32M'
- choose kernel image file name
sendln 'setenv bootfile uImage'
- obtain the IP via dhcp server and boot the board!
sendln 'dhcp;bootm'
- end of macro file
</syntaxhighlight>
The script below works with an USB pendrive that should meet the requirements below. Check the <LSP_02.20_OMAP-L137_User_Guide.pdf> and this topic for additional details.
- U-boot must be rebuilt with USB support enabled.
- The 2GB USB pendrive must be connected to USB0 only and contain two partitions:
- the first partition must be of type FAT16 or FAT32 and contains the uImage (Linux Kernel) file in the root directory
- the second partition must be of type ext2 or ext3 and contains the target filesystem (the same contents of /home/<useracct>/workdir/filesys)
<syntaxhighlight>
- Keep the VT window open while executing macro
showtt 1
- Set the synchronous mode
setsync 1
- needed because of the slower operations usb start and fatload
PromptUboot = 'U-Boot > '
- Set the title to make easier identification between boards
settitle 'OMAPL137'
- check if USB is alive and which devices are on
sendln 'usb start'wait PromptUboot
- load the kernel image to memory
sendln 'fatload usb 0:1 0xC0700000 uimage'wait PromptUboot
- set kernel command line argument
sendln 'setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=dhcp root=/dev/sda2 rootfstype=ext2 mem=32M' ;USB BOOT
- choose kernel image file name
sendln 'setenv bootfile uImage'
- boot the board!
sendln 'bootm'
- end of macro file
</syntaxhighlight>
Note: The command usb start sometimes hangs on the message scanning bus for storage devices.... If this happens to you, stop the macro from executing, reset the board and reload the script file.
The script below works with a linux kernel in SPI and a MMC/SD card that contains the root filesystem
- The SPI Flash should be pre-loaded with a linux kernel located at address 0x1e0000 (Primus U-boot is not able to initialize and load a kernel from the SD card). The production boards will have the kernel preloaded. For additional details on how to do this, please check this topic and section 5.4.2 of the <LSP_02.20_OMAP-L137_User_Guide.pdf>
- The last parameter of the sf read command must be equal or greater than the size of the linux kernel image.
<syntaxhighlight>
- Keep the VT window open while executing macro
showtt 1
- Set the synchronous mode
setsync 1
- Set the title to make easier identification between boards
settitle 'OMAPL137'
- needed because of the slower SPI Flash operations
PromptUboot = 'U-Boot > '
- set kernel command line argument
sendln 'setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=dhcp root=/dev/mmcblk0p1 rootfstype=ext2 mem=32M' ;MMC/SD BOOT
Tera Term Macro
- select the SPI Flash memory
sendln 'sf probe 0'wait PromptUboot
- load kernel image to RAM address 0xc0700000...
sendln 'sf read 0xc0700000 0x1e0000 0x220000'wait PromptUboot
- ...and boot the board!
sendln 'bootm'
- end of macro file
</syntaxhighlight>
Are there any OMAPL138 examples?[edit]
Below is an example ttl script for users with a switch/router and NFS server. To reiterate one of the advantages of using a ttl script is that you can share boards between team members without wrenching their boot settings.
This ttl script has been tested in the SDK 1.00.00.08 environment and all directories and filenames match the default installation procedure as listed in the GSG: Installing the Software for OMAP-L1
<syntaxhighlight>
- Keep the VT window open while executing macro
showtt 1
- Set the synchronous mode
setsync 1
- Set the title to make easier identification between boards
settitle 'OMAPL138'
- The timeout between lines is 1 second
- timeout = 1
- set tftp server ip address
sendln 'setenv serverip 192.168.1.89' ;CHANGE 192.168.1.89 TO MATCH YOUR CONFIGURATION!!!
- set nfs server ip address
sendln 'setenv nfshost ${serverip}'
- set nfs rootpath
sendln 'setenv rootpath /home/<useracct>/workdir/filesys' ;CHANGE <useracct> TO MATCH YOUR CONFIGURATION!!!
- set kernel command line argument
sendln 'setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=${nfshost}:${rootpath},nolock mem=32M'
- choose kernel image file name
sendln 'setenv bootfile uImage'
- obtain the IP via dhcp server and boot the board!
sendln 'dhcp;bootm'
- end of macro file
</syntaxhighlight>
What about using a DLP Pico Projector?[edit]
Beagle example[edit]
<syntaxhighlight>
- Tera Term script for using DLP Pico Projector as display on Beagle
- File system on partition 2 of SD card - you may need to modify the DSS based on your kernel
- The first bootargs are for 2.6.28, and second set for 2.6.29
setsync 1
sendln 'mmcinit'waitrecv '#' 1 0
sendln 'setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait omap-dss.def_disp=dvi omapfb.video_mode=640x480MR-16@60 omapfb.vram=4M,4M,4M mem=80M'
- sendln 'setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait omapdss.def_disp=dvi omapfb.mode=dvi
- 640x480MR-16@60 omapfb.vram=0:4M,1:4M,2:4M mem=80M'
waitrecv '#' 1 0
sendln 'setenv bootcmd mmcinit;fatload mmc 0 80300000 uImage;bootm 80300000'waitrecv '#' 1 0
</syntaxhighlight>
Tera Term Macro Examples Geometry
What is a TeraTerm INI?[edit]
When TeraTerm starts, it runs TERATERM.INI to setup the console. Once you have set your serial terminal to the correct baude rate (via 'Setup->Serial') on COM1 (via 'Setup->General->Default Port'), you can save the setup via 'Setup->Save Setup.' Save this setup in the TeraTerm Installation directory by overwriting TERATERM.INI. Now your TeraTerm will be setup correctly every time you start it.
To run the above scripts, you may need to add a line delay of 100ms (otherwise the lines can become concatenated) by setting the Transmit delay to 100 ms/line (via 'Setup->Serial'). You'll probably want to save this modification in TERATERM.INI to avoid having to modify it every time you start TeraTerm.
Tera Term Macro Examples
{{
Please post only comments related to the article Teraterm Scripts here. | Keystone=
Please post only comments related to the article Teraterm Scripts here. | C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Teraterm Scripts here. | DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Teraterm Scripts here. | MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Teraterm Scripts here. | OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Teraterm Scripts here. | OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Teraterm Scripts here. | MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Teraterm Scripts here. | For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Teraterm Scripts here. }} |
Tera Term Macro File Example
Links | |||
|
