.. index:: zeptocom, zeptoforth,chrome,vimb.ack/nack,zeptocom.js local > :ref:`What's New ?` < .. _zeptocom: .. Created zeptocom.rst: Tue 5 Jul 2022 18:34:36 AEST .. Full Path: /home/tp/mecrisp-unofficial-doc/zeptocom.rst .. Author Copyright 2022 by t.j.porter .. Made by /home/tp/projects/scripts/makerst.sh -->/usr/local/bin/makerst .. license: MIT, please see COPYING Zeptocom ======== Zeptocom 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/ Readme ------ zeptocom.js is a web Forth serial terminal, which currently supports zeptoforth, Mecrisp, STM8 eForth, and ESP32Forth. It currently works with Chrome and newer versions of Chromium (even though I have got a report that Chromium does not properly handle serial ports on FreeBSD), and it should work with Opera and Edge. On all of the supported platforms it makes use of handshaking to control mass uploads of data. It also provides the option to select the newline format used by the terminal, which defaults to CRLF on zeptoforth and ESP32Forth and to LF on Mecrisp and STM8 eForth. zeptocom.js provides edit areas in which one can edit and append code for upload, either as wholes or (when selected) as parts to the target. It supports multiple tabs, so one can have multiple edit areas at once; note that the edit area related functionality always applies to the current edit area. It also supports expanding any #include lines in an edit area within the edit area itself. zeptocom.js provides a history mechanism for use with line input; this can be accessed with both the up and down arrows within the line input as well as a drop down menu at the right-hand side of the line input. It also supports history completion within the line input; this is carried out by use of the tab key within the line input, which completes the word being entered to the shortest word equal to or greater in length to the word being entered or, or if multiple longer words exist, the shortest common substring. zeptocom.js provides the option to strip any uploaded data to the target of initial whitespace, blank lines, and line comments to speed up upload. Note that it does not strip ( or ) comments or \\ comments after any non-whitespace content due to the complexities of mixing such with strings, where such should not be stripped out. zeptocom.js provides the ability to #include content that is uploaded by any means, whether from the REPL line, from a file, from an edit area, or from another included file. This also applies when expanding content within an edit area. Note that the path of an included file will be relative to the current working directory, and if none is set the user will be prompted to select one. zeptocom.js provides the capability to automatically replace symbols in uploaded content and content expanded within an edit area. Symbol files, which are specified either via the global symbol file or via #symbols lines within uploaded or expanded content. Symbol files have a file format shown by the following, for example: \ Here are some symbols for the STM32F407 :: RCC_Base $40023800 RCC_APB1ENR $40023840 RCC_APB2ENR $40023844 RCC_APB1LPENR $40023860 RCC_APB2LPENR $40023864 RCC_APB1ENR_USART2EN 17 bit RCC_APB1ENR_USART3EN 18 bit RCC_APB1ENR_UART4EN 19 bit RCC_APB1ENR_UART5EN 20 bit RCC_APB2ENR_USART1EN 4 bit RCC_APB2ENR_USART6EN 5 bit RCC_APB1LPENR_USART2LPEN 17 bit RCC_APB1LPENR_USART3LPEN 18 bit RCC_APB1LPENR_UART4LPEN 19 bit RCC_APB1LPENR_UART5LPEN 20 bit RCC_APB2LPENR_USART1LPEN 4 bit RCC_APB2LPENR_USART6LPEN 5 bit \\ by itself specifies a comment, blank lines and whitespace are ignored (except within a symbol mapping's value), and symbol mappings are defined by a symbol separated by whitespace from a symbol mapping's value. If a symbol file containig the above is loaded, the following: :: RCC_APB2ENR_USART1EN RCC_APB2ENR bis! will expand automatically to: :: 4 bit $40023844 bis! on uploading. Note that symbols defined this way do not take up precious dictionary space on the target, so are useful for things such as, say, defining the mappings for the entire CMSIS for a target, for which there certainly would not be enough space for such to be loaded on-target. Note that #symbols can be used like #include to define local symbols within content being uploaded, or within individual included files, that override the global symbols. Also ntoe that symbol files can themselves include files; one could use #symbols within them, but there lies dragons as one would be replacing content within the symbols file itself. Cloud Operation --------------- In Google Chrome Browser just browse to https://tabemann.github.io/zeptocomjs/zeptocom.html and select your Zeptoforth options. If you have a connected serial/usb :ref:`supported Forth system` it will open a working terminal. Local Operation --------------- If you don't want to rely on the Cloud. .. warning:: zeptocom.js will not run as a file in a browser for Javascript security reasons. Place zeptocom.js in your forth project directory :: ~/home/user/forth-projects/zeptocom.js Then run the following in that directory. This is a simple and easy Python Web sever. :: ~/home/user/forth-projects/python3.7 -m http.server Browsing to the following URL will show zeptocom.js ready to be run on your Chrome browser locally. :: http://0.0.0.0:8000/ Screenpics ---------- The non Opensource Google Chrome is **not** available for FreeBSD so I can't show you any working pics, with that in mind the following screenpics are only partially working they cannot connect to to a local MCU. VimB ^^^^ Via the awesome browser *VIMB* https://fanglingsu.github.io/vimb/ via remote X Windows from a Intel NUC running FreeBSD 12.3. VimB uses Webkit the same as Chromium for FreeBSD. Any JS enabled browser can view the program at least. .. image:: pics/zeptocom/zeptocom-on-vimb.jpg Chromium ^^^^^^^^ Via remote X Windows from a Intel NUC running FreeBSD 12.3. While mostly working, *Zeptocom* could not find a connected USB Mecrisp-Stellaris device on /dev/ttyU0 although the scanning window popped up and seemed to be working. This device connected fine with Picocom for the same user. .. image:: pics/zeptocom/zeptocom-on-chromium.jpg Background ---------- Travis built *ZeptoCom* for his Forth, *Zeptoforth* but kindly also added support for other Forths. Features -------- I'm only listing the features I can test, but as the Chrome Browser is not available for FreeBSD, I can't test it fully. Fortunately \*bsd Forth users have always had plenty of other :ref:`alternatives`. OS Support (Flow Control) ------------------------- :ref:`Upload source flow control` is the **most vital part** of any Forth terminal. All on-chip Forths compile your source code on-the-chip, so some kind of flow control is needed and this is menu selectable in the *ZeptoCom* UI. Travis recognised that Windows users don't have a *decent* 'Forth Terminal' so *ZeptoCom* will run on Windows as well. That's right, Windows users, you longer have to use the criminally slow and painful 200ms *line delay* method of flow control with Forth! In fact *ZeptoCom* will run on any OS that has the Chrome Browser installed and working. There is nothing else needed as *ZeptoCom* can be run *JUST* by browsing this link https://tabemann.github.io/zeptocomjs/zeptocom.html and if you use Chrome, you can connect to a Forth board or chip via the serial port on your PC. If you have a USB serial link, then just select the virtual com port using the *ZeptoCom* UI. This makes *ZeptoCom* much **like STM32CubeIDE in that with only a web connection you can edit files and upload them to your Forth project !** .. _zeptocom-supported-forths: Supported Forths ---------------- Supported as in *flow control Type* ============== ================= Forth Flow Control Type ============== ================= Zeptoforth Ack/Nack Mecrisp* 'OK' STM8 'OK' ESP32 'OK' FlashForth 'OK' ============== ================= ... updated: 9th Jan 2023.