• =?UTF-8?Q?CH32X035_FORTH_=E2=80=94_a_small_FORTH_for_WCH_RISC-V_MCU?=

    From Lu Hui@luhux@foxmail.com to comp.lang.forth on Sat Oct 3 11:22:02 2026
    From Newsgroup: comp.lang.forth

    Hi all,

    A small STC FORTH I wrote for the CH32X035:

    rCo Runs in ~16 KiB FLASH, interactive REPL over USB CDC ACM
    rCo Includes a minimal USB device stack (CDC ACM) written in assembly
    rCo Tail-call optimization, cooperative multitasking


    https://github.com/ebreak/ch32x035-forth
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Terry Porter@techman001@eternal-september.org to comp.lang.forth on Mon Oct 5 07:23:49 2026
    From Newsgroup: comp.lang.forth

    On 2026-10-03, Lu Hui <luhux@foxmail.com> wrote:
    Hi all,

    A small STC FORTH I wrote for the CH32X035:

    rCo Runs in ~16 KiB FLASH, interactive REPL over USB CDC ACM
    rCo Includes a minimal USB device stack (CDC ACM) written in assembly
    rCo Tail-call optimization, cooperative multitasking


    https://github.com/ebreak/ch32x035-forth

    Nice work, as a STM32 based embedded Forth user since 2014 it's fantastic
    to see Forth support for other brands.

    The CH32X035 looks very capable but due to the limited flash of 63Kb I can't see it being very useful (as is) to an electronics developer wanting to use
    it in a project because there is no peripheral support and no room for any.

    I've worked around this issue with a PC based system that allows
    CMSIS-SVD syntax in the source, which is intercepted on upload to the
    MCU and replaced with absolute addresses. The source stays programmer
    friendly and the upload speaks 'magic numbers' to the MCU. There is no flash penality either, as all the peripheral information lives on the PC and not
    the target MCU.

    My system relies on the manufacturer SVD file to do this automatically
    but I don't see any similar 'System View Description' for the CH* range of chips? I'm a westerner who doesn't read Chinese, so perhaps I've just missed
    it ?

    An embedded Forth with no peripheral support is just too hard to use,
    and results in the users being forced to make up all their own peripheral syntax with the resultant errors and inability to share source not to mention it is a massive time sink.

    This is why I had to develop my own system. Basically it's much like C, in terms of easy development, but it's also interactive being Forth.

    I think this is one reason why Forth is unpopular in embedded these days,
    which is a shame as AI loves embedded Forth, but hates embedded
    C because it's a context killer due to the C 'compile,test,edit,repeat' cycle.

    This is a really simplified flowchart of my old system named 'FURS' https://tinyurl.com/czrcm6c6

    Cheers,
    Terry
    --
    Designer and maintainer of
    https://mecrisp-stellaris-folkdoc.sourceforge.io/ since 2014

    Designer and Maintainer of The Bluepill Diagnostics V1.6 (2019)
    --- Synchronet 3.22a-Linux NewsLink 1.2