Originally published on Github. Some code samples can be found there too.
There is an STM32 project for Arduino. Follow the installation instructions from the project wiki.
First you need to flash forth. You can use a USB-UART dongle.
Before use, install:
sudo pip install pyserial.
Set BOOT0 jumper to 1.
STM32 PA9 --- RX UART-USB PA10 --- TX
Get the flash file from mecrisp-stellaris.
mecrisp-stellaris-2.3.9b/stm32f103-ra/*.binincludes register allocator optimizations
mecrisp-stellaris-2.3.9b/stm32f103/*.binis smaller, but without optimizations.
./stm32loader.py -p /dev/ttyUSB0 -e -v -w mecrisp-stellaris-stm32f103.bin
picocom can do the job:
picocom -b 115200 --imap lfcrlf /dev/ttyUSB0
folie is more comfortable.
You can get it from the GitHub releases page.
A lot of Forth code can be found in this repository.
See here for a list of directories.
Most important now is suf which will allow programming the microcontroller without USB-UART connector.
Now you should be able to connect to the microcontroller directly with USB.
f-common.fs comes a lot of code thay may not be necessary, e.g. the display
driver and fonts. These can be removed. Read the article about cornerstones.