Skip to content
Thomas edited this page Apr 14, 2020 · 10 revisions

Installation

The stm8ef-modbus repository uses a Makefile to load a STM8 eForth release binary package. For executing the make targets a Posix environment (e.g. Linux, Windows10 WSL) is required (including a Python installation), but since the project uses Travis-CI for build and test automation the minimal development environment is a web browser. A containerized build chain is provided, which contains all tool dependencies except the STM8 flash utility stm8flash.

The releases folder in this repository contains a binary release that can be flashed to the C0135 relay board (e.g. with stm8flash -c stlinkv2 -p stm8s103f3 -s flash -w out/C0135/C0135-forth.ihx).

Building the binary can be done with the following steps:

  • SDCC is a tool dependency - building in a containerized environment (tg9541/docker-sdcc) also works
  • clone the repository in a Linux environment
  • run make to
    • fetch upstream dependencies,
    • build a STM8 eForth with a local board folder (default: C135)
    • flash STM8 eForth (refer to discussion in issue #12)
    • load to transfer and compile the Forth code starting with C0135/board.fs

How to get a serial Forth console interface is explained here.

Local control logic for automation can be coded in Forth. The STM8 eForth primer provides a gentle introduction to interactive programming. The C0135 board page shows some embedded control examples for local automation can also be used with a MODBUS master (e.g. set parameters in holding register).

Working with the code

Please be aware that the following folder contain upstream code that shouldn't be changed:

├── docs
├── lib
├── mcu
├── out
└── tools

In order to update upstream dependencies, run make clean.

Other make targets are:

    make clean
    make depend
    make target
    make flash
    make load
Clone this wiki locally