This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

This is a Serial Transfer utility for DM6467T (and others) <-> Host Computer (PC tested)

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.

 

 

lrzsz_dm6467t.tar.gz
  • Oh, yes.  A couple problems that someone ELSE might be able to fix:

    1) During upload (lsz), there's a continuous stream of bad packets.  The upload works, but only at something around 20% throughput efficiency.

    2) Transferred files are always forced to uppercase filenames.  Yes, I have 30? years DOS/WIN experience.  Is this a feature of zmodem?  Can it be fixed?  Or is it in hyperterminal to which we don't have source?  (EDIT: It seems on my laptop, a newer version of HyperTerminal works with lrz to download files to the target and preserve the text case of the filename.  However, upload from lsz to HyperTerminal still gives all uppercase.  So, perhaps there IS a solution, by modifying lsz somewhere and using the newer HyperTerminal.)

    Thanks,

    Helmut

  • MORE:  On HyperTerminal connection properties, when setting 115200 8N1, be sure to select "None" for handshake, not "Hardware".

  • This is hilarious.  The 20% throughput speed was because lsz is default sending continuous status info out stderr, which defaults to the same channel as stdout, which is the channel over which the transfer is happening.  Hyperterm views these interlaced status messages as bad packets, which they are.  Redirecting or eliminating this stderr output fixes the problem.  Throughput is now about 72% at 921,600 baud.  I wish it were closer to 95%, but I'll settle for 72%... for now.

    EXAMPLE ONE, tell lsz to be quiet and not send status to stderr.  This should speed up some as well because the time isn't spent writing to stderr file every packet

    lsz -q filename

    EXAMPLE TWO, redirect stderr to a file.

    lsz filename 2>upload.out

    EXAMPLE THREE, the best of both worlds.  Don't spend time writing status to file every packet, but if an error does arise, save it

    lsz -q filename 2>upload.out

    EXAMPLE FOUR, upload all my desired files.

    lsz -q wildcard*.ext 2>upload.out