IMPORTANT MESSAGE!
This article was written in 2017 and I no longer use FlashForth. I received the following email from a reader informing me that some information in this article may now be out-of-date:
Yesterday I programmed ATmega328p, but I was unsuccessful until I changed
"efuse:w:0x07:m" to "efuse:w:0xff:m". See ff_uno.st in FF's package:
;.include "m328pdef.inc" ; Tested Fuses: E:0xff H:0xda L:0xff
When I at last managed to flash MCU it turned out it _won't_ communicate
with "screen" at the rate of 9600. Therefore "screen /dev/ttyACM0 38400"
should be used.
I flashed FF5 from February 2019
I did not verify the instructions, but am including them in this (historical) article for anyone who finds this article off of Google. I am happy to update any other errata as it is reported.
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, 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).
$ 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.
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:
sudo gedit /etc/udev/rules.d/10-usbtinyisp.rules
and paste in this snippet:
SUBSYSTEM=="usb", ATTR{idVendor}=="1781", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c9f", GROUP="adm", MODE="0666"
Save the file and restart udev
sudo restart udev
Then try re-running AVRDude.