Skip to content

Releases: TG9541/stm8ef

Closing-in to 2.2.21

25 Feb 11:43
c925877
Compare
Choose a tag to compare
Closing-in to 2.2.21 Pre-release
Pre-release
Merge pull request #166 from TG9541/add-wipe

fixes #165 implement WIPE

Fix PICK and VOC, support for W1209 clone w/ Common Anode LED display

18 Feb 19:34
b5e6f44
Compare
Choose a tag to compare

Fix for "PICK is off by one"

Issue #154 deals with an error in the STM8 eForth kernel that was already present in Dr. Ting's initial release: 1 PICK equaled DUP, and 0 PICK was undefined. M.Mahlow reported that bug which, by now, was almost a feature. Some of the code in the library had to be fixed.

Fix for CURRENT patch for VOC extension

Issue #150 deals with an issue of the CURRENT path for the VOC extension. Due to a coincidence it only worked with specific STM8 eForth configurations.

New W1209-CA board configuration

@zcsahok provided a board configuration for W1209 clones with common anode LED displays. Read more about different W1209 clones in the Wiki, and in the issues #153 and #156.

Word ]C! added to lib

The "macro" [ c a ]C! makes using mov addr,#c for initializing peripherals very convenient:

\res MCU: STM8S103
\res export BEEP_CSR

: beep-on [ $A8 BEEP_CSR ]C! ;
: beep-off [ $1F BEEP_CSR ]C! ;

Fix for simulated serial console

19 Jan 21:49
8f56ecc
Compare
Choose a tag to compare
Pre-release

This pre-release fixes a bug in the simulated serial console (both full- and half-duplex).

Manually tested in the following configurations:

Board Console Configuration
W1209-FD 3-wire simulated (TxD:PC5, RxD:PC4)
W1401 2-wire simulated (PD1)
SWIMCOM 2-wire simulated (PD1)
MINDEV 3-wire hardware UART
STM8S003J 2-wire hardware UART
DOUBLECOM simulated 2-wire (PD1), 3-wire hardware UART

VOC, STM8L051F3 Support, Better Console Options

07 Jan 19:12
93d8402
Compare
Choose a tag to compare

VOC for STM8 eForth

Manfred Mahlow contributed the VOC namespace feature which is based on a dictionary extension. The dictionary extension works by patching the STM8 eForth core. This patching is done by loading CURRENT with #require CURRENT in e4thcom or with tools/codeload.py.

Note: patching requires some STM8 eForth core addresses which are board dependent - please make sure that you either set configure the e4thcom search path option for CWD/target or that ./target is a symlink to ./out/<yourBoard>/target (e.g. rm -f target ; ln -s out/<yourBoard>/target target.

First automated test for CURRENT and VOC have been implemented. The following is now part of the tests executed by TRAVIS-CI:

\ compile CURRENT and VOC as a test
COLD

#require CURRENT
#require VOC

#include utils/tester.fs

T{ : a 1 ; -> }T
T{ : b 11 ; -> }T
T{ VOC abc -> }T
T{ abc DEFINITIONS -> }T
T{ : a 2 ; -> }T
T{ : b 22 ; -> }T
T{ FORTH DEFINITIONS -> }T
T{ a b -> 1 11 }T
T{ abc a abc b -> 2 22 }T

codeload.py Improvements

The new option --target-base can be used for setting a base folder instead of CWD for the CWD/target include, e.g. out/CORE.

The Forth source loader codeload.py now supports e4thcom stype transfer level block comments. It's possible to temporarily comment out blocks of code using curly brackets. Comment-to-EOF is now also fully supported (all text from \\ to the EOF is skipped).

Here is a comment example for e4thcom and codeload.py:

{
  never transfer this to the target 
}

\\ 
skip this text,
too

Initial Support for STM8L051F3

The STM8L family has two main groups: the STM8L101x variants (including the upcoming STM8L001J3), and the other STM8L devices, to which also the STM8L051F3 belongs.

The STM8L support added the STM8L051.efr for e4thcom \res mcu, and the stmtldevice.inc for the STM8 eForth core forth.asm.

The interrupt vector numbers for in main.c now come from stm8device.h.

A new generic board folder for STM8L051F3 was added.

See issue #137 for details!

Serial Console Options Improved

Some use-cases, like using the UART for a Modbus interface, require an independent configuration of the UART simulation when used together with the UART (e.g. half duplex on one interface, and full duplex on the other).

The following configuration in a ./<BOARD>/globconfig,inc file provides a 2-wire console on PD1/SWIM, and console independent UART words TX! and ?RX:

        HALF_DUPLEX      = 0    ; Use UART in full duplex mode
        HAS_TXUART       = 1    ; UART TXD, word TX!
        HAS_RXUART       = 1    ; UART RXD, word ?RX
        HAS_RXSIM        = 2    ; Enable RxD via GPIO/TIM4, word ?RXGP
        HAS_TXSIM        = 2    ; Like HAS_RXSIM, word TXGP!, use for console if > HAS_TXUART
        PSIM     = PORTD        ; Port for UART simulation
        PNRX             = 1    ; Port GPIO# for HAS_RXDSIM
        PNTX             = 1    ; Port GPIO# for HAS_TXDSIM

Other Changes

Change to CONTEXT

The core word CONTEXT now always returns the current USRCONTEXT. The NVM/RAM mode dependency that's necessary for linking dictionary changes in RAM to those in NVM memory is now more transparent to the user.

Assembly words with DOXCODE

The core feature DOXCODE for coding assembly words with X as the working register has been exposed as an ALIAS. Using the X register in assembly improves code density.

The following example provides a dense, and relatively fast, CRC-16 computation routine (i.e. not using a 512 bytes table):

\ STM8: CRC-16-ANSI,  polynomial x16 + x15 + x2 + 1
\ refer to github.com/TG9541/stm8ef/blob/master/LICENSE.md

\ reversed implementation ($A001), for Modbus start with "-1" 
#require DOXCODE

  : CRC16 ( n c -- n )
  \ CRC-16-ANSI (seed with -1 for Modbus CRC)
    XOR DOXCODE [
      $A608 ,  \         LD      A,#8
      $54 C,   \ 1$:     SRLW    X
      $2407 ,  \         JRNC    2$
      $01 C,   \         RRWA    X   ; XOR X,#0xA001
      $A801 ,  \         XOR     A,#0x01  
      $01 C,   \         RRWA    X
      $A8A0 ,  \         XOR     A,#0xA0
      $01 C,   \         RRWA    X
      $4A C,   \ 2$:     DEC     A
      $26F3 ,  \         JRNE    1$
    ] ;

\\ Test

#require utils/tester.fs

\ https://www.lammertbies.nl/comm/info/crc-calculation.html
: testCRC -1 58 49 DO I CRC16 LOOP ;

T{ testCRC -> $4B37 }T

Maintainance Release: Better Integration with e4thcom

16 Dec 21:30
d069175
Compare
Choose a tag to compare

#117 Fix search folder order in codeload.py

The search folder order is now in line with e4thcom 0.6.3.

Fixes #118 CONSTANT shouldn't be IMMEDIATE

Thanks to M.Mahlow for reporting.

Fixes #119 IMMEDIATE flag in ALIAS words missing

The auto-generated alias for [COMPILE], and others, were broken.
Thanks to M.Mahlow for reporting.

Fixes #120 ZIP file doesn't support filenames with "?".

The release now also is available as .tgz file.
Note: it's recommended for Linux users to use the new tgz-file.

Minor fix for uCsim

uCsim failed to restore USRBASE after using a number prefix.

  • Assembly code changed to work around a suspected error in POP A,longmem
  • work-around on lib/utils/tester.fs removed

Fixes #125 W1219 BKEY broken

The board key support for the W1219 board was broken. It works nicely now, also with e4thcom.

Other Changes

  • make use of e4thcom 0.6.3 -p option for directory control
  • library fixes from downstream W1209 project #109
  • create CONSTANT words in out/<BOARD>/target for internal variable addresses
  • FORTH.efr no longer supported (use #require for internal CORE variables instead
  • / is a forbidden character in Linux - generated ALIAS filenames now replace it with _

Minor fix for uCsim

26 Nov 21:16
014fcae
Compare
Choose a tag to compare
Minor fix for uCsim Pre-release
Pre-release

uCsim failed to restore USRBASE after using a number prefix.

  • Assembly code changed to work around a suspected error in POP A,longmem
  • work-around on lib/utils/tester.fs removed

Minor changes

24 Nov 22:01
ec994c3
Compare
Choose a tag to compare
Minor changes Pre-release
Pre-release

#117 Fix search folder order in codeload.py

#118 CONSTANT shouldn't be IMMEDIATE

#119 IMMEDIATE flag in ALIAS words missing
e.g.the auto-generated alias for [COMPILE] wast usable

#120 ZIP file doesn't support filenames with "?"
On Linux preferably use the new tgz-file

Just Framework: e4thcom 0.6.3, Target improvement, Lib fix

11 Nov 18:28
Compare
Choose a tag to compare

  • upcoming e4thcom 0.6.3 with -p option for directory control
  • Library fixes from downstream W1209 project #109
  • for internal variable addresses generate CONSTANT words in out/<BOARD>/target
  • FORTH.efr no longer generated by Makefile
  • / is a forbidden character in Linux - generated ALIAS filenames now replace it with _

Framework: Target w/ ALIAS for unlinked words, better \res support

04 Nov 12:44
41f87f6
Compare
Choose a tag to compare

This is mainly framework feature increment:

Folder target used for board specific output

e4thcom source search path includes the folder target (and so does codeload.py). Because STM8 eForth supports many targets, code for projects using a binary release is auto-generated into out/<BOARD>/target folders.

Auto-generated ALIAS for all unlinked words

For all unlinked words of a "board" the Makefile now generates a folder out/<BOARD>/target that contains files with an ALIAS definition each for all unlinked words.

Note that Windows systems may have trouble reading or even generating files with certain characters in the file name (e.g. NAME>). Different solutions are currently being considered. In Linux the same problem exists to a lower extend (with words containing the character /).

It is now recommended for STM8 eForth projects that use a binary release to set a symlink target in the base folder to the folder out/<BOARD>/target.

Auto-generated file FORTH.efr for STM8 eForth core RAM locations

The RAM addresses of internal core variables like 'PROMPT are now exported automatically to the file out/<BOARD>/FORTH.efr.
FORTH.efr contains lines like the following:

0068 equ 'PROMPT \  "'PROMPT" point to prompt word (default .OK)

In e4thcom compatible code this data can be used with the \res meta-statement:

\res MCU: FORTH
\res export 'PROMPT

It is now a recommended for STM8 eForth projects that use a binary release to set a symlink in the base folder to out/<BOARD>/FORTH.efr.

Emulation of e4thcom \res improved

The emulation \res in codeload.py now tests if a word already exists in the dictionary before defining a CONSTANT. The behavior is now as robust as that of #require.

tools folder part of the binary release

The tools folder is now part of the binary release file. An STM8 eForth project that uses the binary release can simply use tools (e.g. codeload.py) from the upstream project.

Note: TG9541/W1209 contains an example implementation.

Usability Improvements, and a Bug Fix

28 Oct 22:07
d41702d
Compare
Choose a tag to compare

CONSTANT and \res e4thcom

e4thcom has the \res MCU: - \res export feature which requires a CONSTANT with distinct compiler/interpreter behavior. Thanks to Mr. Manfred Mahlow for pointing this out, and for providing not only an implementation of CONSTANT, but also the initial version of the STM8S103.efr resource file (which has been extended since then).

MARKER instead of RAMMARK

Mr. Mahlow also contributed a very nice implementation of MARKER which brings the management of temporary vocabularies in RAM to a new level (according to Mr. Mahlow this is a unique STM8 eForth feature!). MARKER now replaces RAMMARK which had issues with the e4thcom #require feature. Thanks!

codeload.py for serial port and uCsim

codeload.py replaces loadserial.py and codeloadTCP.py. It emulates e4thcom!
Travis-CI was the first to use the new script. It should work on Windows, too (but I don't know). If you test it I'd really like to hear from you!

Issue 98: Bug Fix Context Switch for Forth Interrupts

Issue #98 fixes a bad bug (so bad that I really don't understand why it worked initially).

Issue 68: Minor Version Number

Some guys will like this:

hi
STM8eForth 2.2.18
 ok