> What’s New ? <

Serial Terminal: Software

Serial terminal software requires Serial Terminal Hardware

_images/terminal-window.jpg

Note

Organised with what I think are the easiest/best new user Forth Serial Terminals first.

Advanced Unix Users

You will want SWDCOM which uses SWD for the REPL making it independent of mcu clock speed and incredibly fast with built in flow control.

Zeptocom

Zeptocom.js is a web Forth serial terminal which only works on the Chrome Browser and those browsers which use the Chrome proprietary engine, which is mainly the following OS’s :

  • Windows

  • Linux

  • Mac

Features

  • Tabs for editing different files

  • Auto Indentation (to save you time)

  • History recall

  • Previous command completion

  • Code Stripping. Forths ignore your comments and blank lines by default, but if you can strip them before you upload the source, then uploads will be faster. The Source is not affected if this option is used.

  • Auto Timeout for if the Forth Board locks up while loading suicidal source code.

Note

Try it out for yourself as this list will probably be out of date as Travis often adds new features

Homepage

https://github.com/tabemann/zeptocomjs/

e4thcom

E4thcom is supplied as a binary release for:-

Note

If you have *BSD, then you can use it via a RaspberryPI.

Problems ?

Copyright (C) 2013-2020 Manfred Mahlow. https://wiki.forth-ev.de/doku.php/en:projects:e4thcom

  • Advantages
    • Strips comments from the source code

    • Conditional and unconditional uploading of source code via #require or #include directives.

    • Files already uploaded with “#r” or “#require” will be ignored if they are uploaded again (via a Dictionary check) , preventing Word redefinition memory wastage.

    • If uploading is aborted with an error message, typing #edit [Enter] or #e [Enter] at the terminal will open the uploaded file with the cursor placed in the line that raised the error.

    • One can create a file in your editor with the #edit [Enter] or #e [Enter at the terminal. the dotfile ~/.e4thcom-0.6.1 needs to know about your editor.

    • Mecrisp-Stellaris plug-in for upload flow control and error handling.This means that without any flow control, uploading will be as fast as possible, no delays!

    • Editable command line buffer with history and tab selection (/index) No more re-typing commands

    • Predefined code path searching for libraries and mcu. A neat and organised file project hierarchy

  • Disadvantages
    • Linux only but there is also a windows clone (see Escom below)

Warning

While #require or #include directives are handy, if used in your source they will make it non standard, and those without this (linux only) terminal won’t able to use your sources. Therefore I recommend only making one main file with a list of all the includes with none in your source files.

Get E4thcom

Get the release tarball from this url: https://wiki.forth-ev.de/doku.php/en:projects:e4thcom

Using E4thcom

File Structure

Start E4thcom in your project directory, and make sure that any libraries are located in lib/ in that directory. E4thsom will search the project directory and the lib/ directory when you instruct it to require any files. See the E4thcom doc in the release for more information.

Set your editor in .e4thcom-0.6.1 which should be located in your home directory after copying it there from the release tarball.

Starting e4thcom on a RaspberryPi

Note

Be sure to use your serial port device when connecting to Mecrisp-Stellaris.

Note

For Mecrisp-Stellaris the option -t mecrisp-st must be used. The -t mecrisp option will only work as long as no resource files are used.

e4thcom -t mecrisp-st -d ttyUSB0 -b B115200

Logging

Logging e4thcom is easily done in Unix like so:-

e4thcom -t mecrisp-st -d ttyUSB0 -b B115200  | tee e4thcom.log

Picocom

Problems ?

  • Advantages

  • Disadvantages (note: Picocom is a excellent, stable and easy to use terminal)

    • Can be painfully slow to upload files as the line delay must be set to the maximum required delay, which also slows down short and fast Forth command uploads.

    • Uploads comments which must then be discarded by the Forth system

Warning

Picocom will fail if you try to paste sourcefile contents, use the “<ctrl> A S” file upload facility instead. The problem is that it will just send the input as fast as possible via the serial port. See problems ? above.

Picocom, no handshaking, END OF LINE DELAY of 200ms

picocom -b 115200 /dev/cuaU0 --imap lfcrlf,crcrlf --omap delbs,crlf --send-cmd "ascii-xfr -s -l200"

Picocom, 460800 Baud hardware rts/cts handshaking, no END OF LINE DELAY, no double spacing of received data

picocom -f h -b 460800 /dev/cuaU0 --omap delbs,crlf --send-cmd "ascii-xfr -s"

Picocom Shell Script with xterm title

xterm -geometry 108x75+1+1 -fs 10 -title 'Picocom 460800, RTSCTS, /dev/cuaU0 | <ctrl> AQ to exit ' -e picocom -f h -b 460800 /dev/cuaU0 --omap delbs,crlf --send-cmd "ascii-xfr -s" &

Picocom Command Line details

Command

Description

picocom

excutable

-b 115200

baud rate of 115200

-f h

hardware rts/cts handshaking

/dev/cuaU0

the PC serial device, yours may differ

–imap lfcrlf,crcrlf

input char mapping

–omap delbs,crlf

output char mapping

–send-cmd “ascii-xfr -s -l200

200mS line delay to give the compiler time when uploading files

Some useful Picocom Commands

Action

Description

Notes

quit

<ctrl> A Q

upload a file

<ctrl> A S

this command has TAB completion

screenshot

_images/picocom.jpg

Forth Explorer

Problems ?

Forth Exlorer was a quick hack especially for Mecrisp-Stellaris by K.Foltman. Forth Explorer is now unsupported. There are quite a few similar Python based terminal emulators available now.

  • Advantages
    • No end of line delay needed: FE waits for the ‘ok’ emitted by Mecrisp-Stellaris before sending the next line.Uploading Forth programs doesn’t get any faster than this.

    • Previous Command Recall: up arrow recalls previous commands from your session for reuse, a BIG timesaver, and FE now saves this between sessions so when you use FE next time, commands used in earlier sessions are still available with the up arrow.

    • Error checking: will stop on the most errors, alerting you to that “;” you forgot ;-) including :-
      • Not Found

      • Redefine

      • Unterminated string constant

      • Structures don’t match

    • Audible Error Alert: FE now plays configurable sound bites on successful file upload or failure :
      • file error audible alert

      • file completion audible alert

    • Comment stripping to speed things up.

    • Dumb Terminal Mode, switch between Smart and Dumb terminal on the fly !

Note

FE Dependencies

  • Python

  • py-serial

  • sox

  • a couple of wav files to play for completed and error uploads, (set these in FE itself).

FE commands

Note: See the GNU Readline manual for all available commands

Description

Notes

python fe.py /dev/cuaU1

starts the FE terminal emulator in Smart mode

Ctrl + D

quit FE, (only in Smart mode)

!S <file> or Ctrl+R

upload a file, defaults to last file

!T or Ctrl+T

switch to a dumb TTY mode

Ctrl+X

switch back to Smart Terminal mode

Download the Forth Explorer (FE) tarball with sound byte files.

GnuScreen

Problems ?

https://www.gnu.org/software/screen/

GnuScreen was my serial terminal of choice as of September 2018. As of 2020 I used SWDCOM exclusively.

Both these options require some recompiling and admin unix skills.

See also

If you have problems uploading your sourcefiles please see this link