In this guide, I explain how I set up the piStorm, beginning from a fresh board (with just the pins and pi header soldered onto it) until it starts up the Kickstart “insert disk” screen. This is not the only way to do things, and necessarily not the best way, it’s my way 🙂
Use the official Raspberry Pi Imager or a third party tool like BalenaEtcher to write the Lite version of Raspberry Pi OS to a SD-card and start up the pi
Using raspi-config, set wifi-credentials (System Options) and activate SSH (Interface Options).
(everything except the basic installation can be done without network connectivity, but it is easier to do it over SSH than at the terminal)
sudo su - apt -y update apt -y upgrade
Updating will take about 10 minutes. Usually a reboot is recommended here, but in this case not necessary, so continue with the section below and install some packages and test the GPIOs.
Install required packages
apt -y install git apt -y install libsdl2-dev apt -y install openocd exit
Testing your Pi’s GPIO pins
Testing your Pi’s GPIO pins. This MUST be run disconnected from the PiStorm, just power up the Pi with USB and do it outside the Amiga entirely.
Info from https://www.raspberrypi.org/forums/viewtopic.php?t=180505
sudo apt -y install pigpio wget http://abyz.me.uk/rpi/pigpio/code/gpiotest.zip unzip gpiotest.zip sudo pigpiod ./gpiotest
Get and build piStorm software
git clone https://github.com/captain-amygdala/pistorm.git cd pistorm make
Optional step, get and build wip-crap development version
Only build the emulator for use/test later on – skip the CPLD update for now and do that when the wip-crap build is going to be used.
piStorm – experimental stuff wip-crap
Shut down the pi
This is as far as you get without the piStorm connected, so it’s time to shut down the pi and then stuff it away until you get your piStorm (- shutdown and continue as below if you already have it).
‘pigpiod’ (for testing the GPIOs) above keeps the pi waiting for 90 sec if not killed before shutdown.
sudo killall -9 pigpiod sudo halt -p
Update CPLD bitstream
Shut down the pi, take a look 20 pixels above :), disconnect power and connect the piStorm adapter to the GPIO
Connect power and let the pi start, check network connectivity or re-setup if necessary.
Build the program to test access to chip RAM
cd pistorm chmod +x ./build_buptest.sh ./build_buptest.sh
chmod +x nprog_240.sh ./nprog_240.sh
chmod +x nprog.sh ./nprog.sh
Expected output (nprog.sh for EPM240):
Installing the piStorm in the Amiga
Shut down the pi, disconnect everything and separate the adapter from it.
Replace the CPU in the Amiga with the adapter board (the Pi connector should be on the left side). Align both rows of pins with the CPU socket, then, without any pressure on the board, move the adapter up and down (front and back) on the socket to feel the point in which the pins are centered in the socket.
Check that all pins go into the socket an press it down until it bottoms.
Mount the pi on the adapter with the USB port facing towards you, and the HDMI connector on the right side.
Connect the HDMI output and a keyboard.
Starting the emulator
Power on the Amiga, the pi will be powered and boot up (the output from the Amiga will be just a black screen (or any other single-colored screen, I usually get a red one before the emulator starts) until the CPU emulator is started).
Login as ‘pi’ and change directory to ‘pistorm’.
Initial check – can the piStorm read and write to the CHIP RAM ?
In case of any error, check that the piStorm adapter is pressed down firmly in the CPU-socket. It should be pressed down so it bottoms (plastic on the pins touching the socket). Once fixed, re-run buptest. Repeat until zero errors are reported.
Start the emulator
Expected output (untouched default.cfg in pistorm directory). If the kickstart file (kick.rom) for softkicking is not found it defaults to using the KS on the mainboard.
On my test computer (A500 r6) it falls back to the 3.1.4 ROM:
From here on, you can use the Amiga as any other floppy-only Amiga. I will document the features (kickstart switch, RAM, hard drive, RTG) in another post to keep these at readable length.
Autostart the emulator on system boot – the simple method
In /etc/rc.local, add before the “exit 0” line:
cd /home/pi/pistorm/ && sudo ./emulator&
Autostart the emulator on system boot – advanced method
The CPU-emulator will be started a lot earlier if adding it as a systemd service.
Become root (the ugly way):
sudo su -
Create the file “pistorm.service” in /lib/systemd/system:
[Unit] Description=Start piStorm 68k emulator After=local-fs.target [Service] ExecStart=/home/pi/start-emulator.sh [Install] WantedBy=local-fs.target
Create the file “start-emulator.sh” in /home/pi:
#!/bin/sh cd /home/pi/pistorm/ sudo ./emulator exit 0
Make “start-emulator.sh” executable:
chmod 755 /home/pi/start-emulator.sh
Reload/regenerate systemd configuration files:
Enable the automatic start of the CPU-emulator:
systemctl enable pistorm.service
Now, in case you need to restart the emulator (and Amiga as well), this can be done without having to find the ’emulator’ process:
systemctl restart pistorm