> What’s New ? <

Serial Terminal: Software

Organised with my preferred Forth Serial Terminals first.

e4thcom-0.6.1

E4thcom, Copyright (C) 2013-2017 Manfred Mahlow and licensed under the GP. https://wiki.forth-ev.de/doku.php/en:projects:e4thcom#e4thcom-061 is my preferred serial terminal for Mecrisp-Sterllaris for the following reasons:-
  • Advantages

    • Strips comments from the source code
    • Conditional and unconditional uploading of source code via # require directives.I can’t stress how important this one feature is as it allows all the forth code dependencies in your project to be automatically uploaded to the target in the order you specify.
    • 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 hierachy
  • Disadvantages
    • Linux only

Operating system availability

E4thcom is supplied as a binary release for:-

  1. Linux
  2. Raspberry Pi

If you have FreeBsd like I do, then you can use it via a RaspberryPI or Linux Emulation (not tried).

Get the binary release for this URl: https://wiki.forth-ev.de/lib/exe/fetch.php/projects:e4thcom:e4thcom-0.6.1.tar.gz

Get the e4thcom-0.6.1 PDF User Manual here.

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

Folie 2.14

The “Forth Live Explorer” is a serial terminal interface for Mecrisp Forth. This Serial Terminal is written by JeeLabs using the GO programming language. Folie is my second choice right now, and given how it is progressing, I’m sure its only a matter of time before Folie is the choice for Mecrisp-Stellaris.

  • Tested on a FreeBSD 11.1 system.

https://github.com/jeelabs/folie/releases

Advantages:-

  • Standalone ready to run binaries with zero dependencies are available for every OS :-
Os Filename Size (MB)
Arm folie-arm.gz 1.98
FreeBSD folie-freebsd64.gz 2.13
Linux32 folie-linux.gz 2
Linux64 folie-linux64.gz 2.12
MacOS folie-macos64.gz 2.23
Windows32 folie-windows.exe.gz 1.88
Windows64 folie-windows64.exe.gz 2

Note

The files above also contain various Images to upload to the STM32 target via the inbuilt STM32F Bootloader.

  • Uses “include” directives for fetching and uploading dependent Forth files in the sequence desired (nested). e4thcom uses “#r(equire)” which isn’t a common Forth method.
  • Has Command Line History
  • No 32 character file limit like e4thcom, and I find it amazing how often I exceed that limit.
  • Neat and tidy terminal output
  • Comes with various Mecrisp-Stellaris images which are uploaded via the inbuilt Bootloader in every STM32F.

Note

Make sure that

  • can also connect to a telnet socket or to ssh, launched as a subprocess
  • throttling: each line waits for an “ok.” prompt before sending the next one
  • firmware uploads: allows erasing an STM32F1 chip and uploading new firmware using the bootloader. I couldn’t get this to work on my test F103 board which does work with this serial bootloader: http://cholla.mmto.org/stm32/stm32loader.py using the following command
./bootloader.py -p /dev/cuaU16 -evw mecrisp-stellaris-stm32f103.bin

Reading data from mecrisp-stellaris-stm32f103.bin
Bootloader version 0x22
Chip id 0x410, STM32F1, performance, medium-density
Writing 20352 bytes to start address 0x8000000
Write 256 bytes at 0x8000000
Write 256 bytes at 0x8000100
Write 256 bytes at 0x8000200
..

Read 256 bytes at 0x8004F00
Verification OK

Disadvantages (at present)

  • Inbuilt bootloader doesn’t work for me
  • Folie can’t tell if a file has been previously uploaded so it can ignore the reload and subsequent redefines like E4thcom does.
  • ”!ls” produces a messy wide screen listing on my FreeBSD machine, which makes it hard finding files as opposed to a one file per line listing.

Logging

Logging Folie is easily done in Unix like so:-
folie-freebsd64 -r -p "/dev/cuaU16" | tee follie.log

JeeLabs is a active and interesting embedded Forth site, and well worth the visit: http://jeelabs.org

Forth Explorer

Forth Exlorer was a quick hack especially for Mecrisp-Stellaris by K.Foltman and is similar to e4thcom, but lacks the vital Forth file #include facilities and others. Forth Explorer is now unsupported.

  • 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 !

  • Disadvantages
    • No way to automatically upload dependent files as E4thcom does.

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 files.

Picocom

  • Advantages

  • Disadvantages

    • 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
    • No way to automatically upload dependent files as E4thcom does.

To connect Picocom it is run this way :-

picocom -b 115200 /dev/cuaU0 --imap lfcrlf,crcrlf --omap delbs,crlf --send-cmd "ascii-xfr -s -l200"
Command Description
picocom excutable
-b 115200 baud rate of 115200
/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