lsz/lrz programs for serial transfer to/from console of embedded system (DM6467T)
ATTACHMENT contains README file with all the same text as this post.
PROBLEM: I can't believe there was not already a set of utilities for doing this on
the DM6467T EVM or other embedded system supported by the TI E2E forum. Perhaps this
can now be that set of utilities. Your welcome. -Helmut Forren
SUMMARY: These programs are very far from perfect, but they accomplish what I needed.
On my DM6467T EVM derived custom board, I needed to get captured video images off of
the board and onto a PC, and I also needed to get program updates from the PC to the
board. All of this needed to be done by another group of folks, remote from me, who
do not have a linux host with atftpd and therefore could not use the network connect-
ion for these purposes. During development, I need to email them revised programs
and they need to email back to me image captures.
USAGE: Note that I have only tested the -Z switch, zmodem protocol. Also, the program
works great with HyperTerminal on the host PC. It doesn't work so well with TeraTerm,
which suggests to me some shortcoming in TeraTerm. The command "lsz --help" or "lrz
--help" will display program usage info.
UPLOAD FROM TARGET TO HOST:
1) Load HyperTerminal and configure connection for appropriate comm port, at 115200
baud, 8N1 (8 data bits, no parity, one stop bit).
2) Connect HyperTerminal to target. If successful, then while target boots, a console
boot log should be seen on HyperTerminal. If already booted, try pressing enter on
HyperTerminal to see the target's response. If necessary, log in with username "root"
and no password (just hit enter).
3) Select HyperTerminal menu options Transfer / Receive File... Browse to a standard
upload folder on the host PC. Select receiving protocol "Zmodem with Crash Recovery".
Then do NOT press "Receive". Instead, press "Close" to save these settings and close
the window.
4) Next, on the target console, change to the appropriate folder. For example, you
may have a folder /opt/companyname, so type the command "cd /opt/companyname". (Do
I have to tell you to replace companyname with our acronym?) Your prompt should
come back to read "root@dm646yt-evm:/opt/companyname#".
5) Again on the target console, type the command "lsz -Z filename", where "filename"
is replaced appropriately. To upload all captured images of type TIF, use the
command "lsz -Z *.tif". The lsz command should start the transfer, and HyperTerminal
should automatically recognize this fact and begin receipt on its side. Currently,
there is some kind of bug and recurring bad packets occur. But the transfer works
nevertheless. Also, it's irritating, but the file comes in with an all uppercase
filename. Anyway, when the transfer is complete, look for the filename in the upload
folder on the host PC. (If the filename has spaces in it, surround it with double
quotes.)
DOWNLOAD FROM HOST TO TARGET:
1) Load HyperTerminal and configure connection for appropriate comm port, at 115200
baud, 8N1 (8 data bits, no parity, one stop bit).
2) Connect HyperTerminal to target. If successful, then while target boots, a console
boot log should be seen on HyperTerminal. If already booted, try pressing enter on
HyperTerminal to see the target's response. If necessary, log in with username "root"
and no password (just hit enter).
3) Next, on the target console, change to the appropriate folder. For example, you
may have a folder /opt/companyname, so type the command "cd /opt/companyname". (Do
I have to tell you to replace companyname with our acronym?) Your prompt should
come back to read "root@dm646yt-evm:/opt/companyname#".
4) Again on the target console, type the command "lrz -Z". This will put the program
into receive mode, where it will wait until HyperTerminal sends something. You'll see
"z waiting to receive." and other text with funny chars on the console.
3) Select HyperTerminal menu options Transfer / Send File... Browse to the appropriate
folder and file on the host PC, then select the file to be downloaded. Unlike the upload
where you can upload multiple files at once, you can only download one file at a time.
I believe this is because HyperTerminal isn't structured to allow what would be possible
otherwise with the zmodem protocol. After selecting a file, select the protocol "Zmodem
with Crash Recovery". Then press the Send button. The send should progress automatically.
4) Most likely, your transferred file had some lower case letters in the name. But this
transfer forces them all to upper case. In some situations, it's important to have this
casing correct, so you should rename the file appropriately. For example, use the
console command "mv FILENAME FileName".
5) If you just downloaded a program, you have to marke it executable. For example, use
the console command "chmod +x FileName". If you make something executable that's not
a program, there's little if any harm, so don't sweat it.
BUILD: Even though I have 25+ years familiarity with makefiles, I'm no makefile expert.
It seems on the forum that many other DaVinci developers aren't either. The whole make
situation has been very frustrating to many. In order to get my custom application
working, I started with the encodedecode build environment and adapted it slightly to
work for me. In the end, my own custom program is in a folder beneath dm6467 folder,
parallel to where the encodedecode folder used to be. In the same way, the two folders
of this source code, "lrz" and "lsz", are intended to be put parallel with the encodedecode
demo. Then, when you run a higher level make, it will make not only the encodedecode
program, but also the lrz and lsz programs. This parallelism indeed goes so far as to
have both lrz and lsz being linked with parent folder (the dm6467 folder itself) files
demo.o and others. Code inside lrz.c and lsz.c provide a global that demo.c wants. There
are also includes of demo.h and others. (If you restructure this build environment, you
can remove those. They're all in one place near the top.) Anyway, hopefully, this can
give you a pain free build experience.
LICENSE: This stuff is derived from lrzsz by multiple persons, apparently most recently
by Uwe Ohse. See the GNU license info in the source code.