~fitzsim/lisp-badge

Alternate build method for the Technoblogy Lisp Badge code
repl: Work around apparent randomSeed issue
Use old SPI API on Arduino versions prior to 1.5.8
Add many forward references

refs

build-on-debian
browse  log 

clone

read-only
https://git.sr.ht/~fitzsim/lisp-badge
read/write
git@git.sr.ht:~fitzsim/lisp-badge

You can also use your local clone with git send-email.

Lisp Badge

A handheld computer with a self-contained keyboard and display that you can program in Lisp. For more information see: http://www.technoblogy.com/show?2AEE

Command Line Procedures

Install dependencies

sudo apt install \
	arduino \
	arduino-mk \
	arduino-mighty-1284p \
	gcc-avr \
	avrdude

Build .hex file

make

Burn bootloader using USBasp programmer in 3.3V mode

make \
	ISP_PROG=usbasp \
	AVRDUDE_OPTS="-q -V -B 3" \
	BOOTLOADER_PARENT=. \
	BOOTLOADER_PATH=. \
	BOOTLOADER_FILE="optiboot_atmega1284p.hex" \
	burn_bootloader

The included bootloader, optiboot_atmega1284p.hex, is a customized Optiboot that flashes the Lisp Badge's LED.

Repository https://github.com/marado/arduino-mighty-1284p
Commit aa8f32415372fc7e4b8850c4c05005ff3c1bd825
Patch use-pin-PB7-for-bootloader-led.patch

Build and load lisp-badge.hex using 3.3V FTDI Basic Breakout from Sparkfun

make MONITOR_PORT=/dev/ttyUSB0 upload

This method assumes the bootloader has already been installed.

Build and load lisp-badge.hex using USBasp programmer in 3.3V mode

make ISP_PROG=usbasp ispload

This method can be useful for flashing uLisp if you want to reuse the usbasp for programming the payload, e.g., if you do not have a serial programmer like the Sparkfun one.

Beware though that this method overwrites the bootloader; i.e., it writes uLisp to the board such that uLisp will be run directly after power on.

Without the bootloader to talk to, avrdude won't work, so e.g. issuing:

make MONITOR_PORT=/dev/ttyUSB0 upload

will result in this error condition:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
[...]

To make serial programming work again, you have to reflash the bootloader.

Testing environment

Tested on Debian GNU/Linux ppc64le (aka ppc64el) bullseye/sid, with package versions:

Package Version Package Version
arduino 1.0.5 2:1.0.5+dfsg2-4.1
arduino-mk 1.5.2 1.5.2-2
arduino-mighty-1284p 1 1-3
gcc-avr (provides avr-gcc) 5.4.0 1:5.4.0+Atmel3.6.1-2
avrdude 6.3-20171130 6.3-20171130+svn1429-2+b1