FlashForth Question: Sending a File

A question recently received from a new FlashForth user:

> The (theoretically) simple thing I'm struggling with is: How do I
> transmit a file for compilation. I google the !/&§" out of it, but
> can't find a solution.
> Working with a linux system, I've tried putty, moserial, minicom and
> more, but none allows me to tranfer a file w/o errors.
> Just working through the terminal works great, jut uploading words is
> not possible. Handshake is on (hard- and soft).
> How do you do that?

My response:

As best as I can figure it, it seems that for some reason FlashForth cannot receive characters while it is processing the previous line of input from the terminal, so some characters are lost if you simply paste a file to the terminal. However, the shell that comes with FlashForth is evidently designed to work around this limitation, waiting for the correct time to send each line. In the FlashForth files there is a directory called shell which contains a python script called ff-shell.py. After you start it, you can use the #send <filename> command to send a file. There are a number of other handy commands in that shell for interacting with FlashForth.

A few caveats about the FlashForth shell:

(1) The script is a python2 script, and you must have the pyserial python library install (the python2 version of it).

(2) #send will try to add the extension “.txt” to whatever filename you give it, which is annoying. I fixed this by commenting out lines 175-176 in the source code.

          if len(args) > 3:
            stopString = args[3]
          # if pathfile.endswith(".txt") == False:
          #   pathfile = pathfile + ".txt"
          line = ""

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s