Fetching latest commit…
Cannot retrieve the latest commit at this time.


Serial USB driver for Forth - see http://jeelabs.org/2016/06/standalone-usb-firmware/


  • generic - many boards, see eBay - PA12 high enables USB (sort of)
  • hotcbo - HotMCU Core Board 1xx see Haoyu - PF10 low enables USB
  • hytiny - Hy-TinySTM103T, see Haoyu - PA0 low enables USB
  • maplemini - LeafLabs Maple Mini etc, see eBay - PB9 pulsed high enables USB
  • olimexino - LeafLabs Maple and similar, see Olimex - PC12 low enables USB
  • olip103 - Olimex STM32 P103 board Olimex - PC11 low enables USB
  • port103z - Port103Z, see WaveShare - PA3 low enables USB

Note: generic and hytiny have now been combined into a single common image, which checks the board type at run time and adjusts the USB control pin accordingly.

The .hex and .bin files can be used to flash a board from scratch. These include the g6u/board.fs and g6u/core.fs code, with drivers and libraries - i.e. batteries included!

To upload using Folie and a SerPlus, enter the following command:

!u path/to/usb-common.hex

Or, even simpler, you can upload directly from the last version on GitHub:

!u https://raw.githubusercontent.com/jeelabs/embello/master/explore/1608-forth/suf/usb-common.hex

Be sure to refer to the actual raw file contents, not the GitHub page itself!


The f-*.fs files are used to create these images. Here is an example transcript of loading the f-common.fs file into Folie, while connected to an F103-based Blue Pill:

$ folie
Folie v2.11
Select the serial port:
  1: /dev/cu.Bluetooth-Incoming-Port
  2: /dev/cu.usbmodem32212431
  3: /dev/cu.usbmodem3430DC31
  4: /dev/cu.usbmodemC92AED31
Enter '!help' for additional help, or ctrl-d to quit.
[connected to /dev/cu.usbmodemC92AED31]
!s f-common.fs
1> f-common.fs 3: Erase block at  00005000  from Flash
1> f-common.fs 4: Erase block at  00005400  from Flash
Erase block at  00005800  from Flash
Erase block at  0000B800  from Flash
Finished. Reset �Mecrisp-Stellaris RA 2.3.6 for STM32F103 by Matthias Koch
1> f-common.fs 11: Redefine init.  ok.
1> f-common.fs 35: ( usb end: ) 000063D0  ok.
1> f-common.fs 36: Redefine eraseflash.  ok.
5> board.fs 5: ( board start: ) 00006400  ok.
5> board.fs 36: Redefine init.  ok.
5> board.fs 45: 64 KB <g6u> 32212433 ram/flash: 19108 27648 free  ok.
18> core.fs 5: ( core start: ) 00009400  ok.
18> core.fs 14: 64 KB <g6u> 32212433 ram/flash: 16792 17408 free  ok.
1> f-common.fs 41: hexdump

As you can see, the hex dump is generated as last step in this process and can be copied manually to the usb-common.hex file. Note that on the next reset, the serial connection will be dropped and the board will start listening on its USB interface. To prevent this, enter $5000 eraseflashfrom - this will remove all the above code again.