Rick Carlino

Lead software developer and co-founding member @ Farmbot, Inc.

Co-founder @ Fox.Build Makerspace, St. Charles, IL.

Reddit Twitter GitHub LinkedIn Stack Overflow Email Updates

FlashForth Installation: Arduino UNO on Linux and Mac

May 26 2017

Installing FlashForth

FlashForth runs on bare metal Arduino. It does not use the Arduino bootloader that comes with most Arduino boards. You will not be able to install it using the Arduino IDE. Once you have an Arduino Uno (SEE: Amazon), There are two options to get a chip that runs FlashForth.

Option 1: Buy a Chip from the Author

The author of FlashForth sells AVR chips that already have FlashForth installed. If you don’t have an AVR programmer, or want to support opensource authors, this is a great option. Details are available on the official support page.

Option 2: Burn a Chip Yourself

Because FlashForth does not use the standard Arduino bootloader, you must buy an AVR Programmer and install AVR dude.

Download the Firmware

Once you are finished with the install, download ff_uno.hex from the official source code repository. This is the image that you will burn onto the chip using AVRDude.

Burn the Image

Attach the programmer to the Arduino as shown:

Then run the code shown below.
The instructions assume you are using a Pocket AVR Programmer (USBTiny).

1
2
$ cd DIRECTORY_WHERE_YOU_DOWNLOADED_FF_UNO_HEX
$ sudo avrdude -c usbtiny -p m328p -e -u -U flash:w:ff_uno.hex:i -U efuse:w:0x07:m -U hfuse:w:0xda:m -U lfuse:w:0xff:m

NOTE: If you aren’t using a Pocket AVR Programmer change the -c usbtiny flag below to something more appropriate. Running avrdude -c ? will print a list of all programmer types available. Find yours in the list and change the flag accordingly.

You should see something like the message below. If you do not see the message, please leave a comment so that I may keep an ongoing list of common installation errors.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: reading input file "ff_uno.hex"
avrdude: writing flash (32542 bytes):
# ...Many other messages...
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude done. Thank you.

Start Using FORTH Over Serial

You now have FlashForth installed! You will need a terminal client to start writing code. The simplest solution is to type screen /dev/ttyUSB0 9600 or, for some brands, screen /dev/ttyACM0 9600.

You should now see a FlashForth interpreter, such as the one below:

To verify installation, try typing enter a few times or inputting the command words as I have done in the screenshot above.

PROBLEM: It Doesn’t See My Board (Linux)

Some Linux users (in my case, Linux Mint) will hit the following issue when burning an image:

avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

To fix the problem, create a configuration file as root:

1
sudo gedit /etc/udev/rules.d/10-usbtinyisp.rules

and paste in this snippet:

1
SUBSYSTEM=="usb", ATTR{idVendor}=="1781", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c9f", GROUP="adm", MODE="0666"

Save the file and restart udev

1
sudo restart udev

Then try re-running AVRDude.

(C) 2017 Rick Carlino