How to setup your A314

This is an updated version that also cover A314 v1.2
Original post published 22 Februari 2020 - 23:09

In this tutorial I will use an A500+ rev. 8a motherboard with WorkBench 2.1 as reference.
I will try to make it mostly a bullet to bullet post, to keep it as short and clear as possible

Setting up your hardware.

First thing to do is to make sure your computer sees the extra memory that A314 will share with your Amiga, and make sure that the RTC gets dectected. The amount of extra memory you will retrieve from the A314 depends on your motherboard revision, and jumper settings.

Below you can the most common A314 setups without any motherboard modifications made:

A314 Motherboard JMP2 JMP3 JMPB3 / RAS0 JMPB3 / RAS1 Shared RAM
v1.1 rev. 5 set open* N/A N/A slow/ranger*
  rev. 6a set** open     slow/ranger**
  rev. 8a open set     chip
v1.2 rev. 5 set N/A open* set* slow/ranger*
  rev. 6a set**   open set slow/ranger**
  rev. 8a open   set set chip

With these setups for rev. 5, and rev. 6a you will NOT be able to use the PiAudio, RemoterWB or the VideoPlayer - these features requires shared chip ram.
A note for those of you that happen to have rev. 3, set the A314 jumpers in the same way as for rev. 5. However, as far as I know there is no way to get chip instead of slow/ranger RAM.

Modifying rev. 5 and rev. 6a motherboards to to get the desired RAM */**

On rev. 5 you have to disable the on-board chip RAM by cutting the trace between the two lower pads for JP3, and solder a 10K pull-up resistor from the middle pad of JP3 to VCC.

A500 rev. 5 - Agnus 8371 with disabled on-board chip RAM, and 10K pull-up.

Depending on version, change jumpers acordingly:
A314 v1.1 - change JMP3 from open to: set*.
A314 v1.2 - change JMPB3/RAS0 from open to: set*, and JMPB3/RAS1 from set to: open*.
The on-board memory is now "moved" to the A314 and makes it shared chip* RAM instead.

On rev. 6a you have to cut the trace between the two lower pads on JP2 located at the top of the KickStart chip. It would be adviceable to add three pin headers to the pads, so you can restore your Amiga to its origianl state if needed. If adding the pin headers you can simply add a jumper on the upper two pins to perform your mod, otherwise you have to make a solder bridge between them.

A500 rev. 6a - Agnus 8372 with 512kB chip RAM, motherboard chip mod for A314.

A314 v1.1 or A314 v1.2 - change JMP2 from set to: open**
This adds 512kB chip** RAM instead of the slow/ranger RAM.

If you already have made the chip RAM mod, as I had, JP2 does not care** if open or set.

A500 rev. 6a - Agnus 8372 with 512kB chip RAM, classic motherboard chip mod.

Hook up A314 to INT2

To improve the speed of the SPI communication, you should hook up INT2 from the A314 to INT2 on the Amiga's ODD CIA (A) pin 21, see images below - this is optional, however it will improve the speed of small SPI transfers and give you a better user experience.

Check your hardware setup

After you have installed your A314 card, boot up your Amiga with Workbench of your choice, or use Amiga Test Kit. I used the Avail command in AmigaShell to confirm that I got more memory, and Time in the WorkBench/Prefs/ folder to set and save the Date and Time, see image below. Note that the save button will be greyed out if the RTC is not present.

If everything looks OK, you can now proceed with the setup of your Raspberry Pi. It is recommended to use model 3B or 3B+, but older and slower 2B model also works with an added wifi dongle. However, model 4 should be used with care. Because it consumes more power and dissipate more heat it could damage your Amiga. You may consider adding some kind of cooling, and use a modern power supply with a extra power rail for the Pi/A314.

Installing latest Rasbian.

Download latest Raspbian image: raspberrypi.org
Restore image to SD-card with the tool of your choice.
I am sure you know how to work your google-fu šŸ˜‰

Connect your Raspberry Pi to a monitor, keyboard and mouse.
Start Raspberry Pi, and complete the setup wizard.

To enable SPI (Serial Peripheral Interface) and SSH (Secure SHell), go to Menu and click:
    > Preferences > RaspberryPi Configuration
In the new window click the tab <interfaces> and check the following:
    SPI <Enable>
    SSH <Enable> (optional).
Click the tab <System> and check:
    Boot <To CLI>

Setting up the Raspberry Pi to work with your A314 expansion card.

The following steps shall be done from the Linux terminal. This can be done directly on the Raspberry Pi, or from another computer via SSH. If you want to copy and paste from this document, you need to use <ctrl+shift+v> to paste into the terminal.

First we should upgrade the system so all its components is up to date:
        sudo apt update
        sudo apt upgrade

    You will be asked: "Do you want to continue? [Y/n]"
    Press <y>, and hit <enter>. Be patient, this will most likely take very long time...

Note if you use Rasbian Lite, you might have to install two additional packages for python3:
        sudo apt install python3-dev python3-distutils

To get correct SPI frequency, and to set SPI_CS_HIGH flag, edit config.txt:
        sudo nano /boot/config.txt
At the bottom of the file paste:
        core_freq_min
        dtoverlay=spi-a314
    Save and exit by pressing <ctrl+x>, then press <y>, and hit <enter>.

To set the max SPI buffer size, edit cmdline.txt:
        sudo nano /boot/cmdline.txt
At the end of the line paste:
        spidev.bufsiz=65536
    (please note that it says spidev.bufsiz, the 'e' is missing on purpose!)
    Save and exit by pressing <ctrl+x>, then press <y>, and hit <enter>.

Install Docker to help you build your files:
        sudo curl -sSL https://get.docker.com | sh
    This can take some time...
Allow user pi to run Docker:
        sudo usermod -aG docker pi
Restart Raspberry Pi to get Docker up and runing:
        sudo shutdown -r now

To be able to install the software for A314 you have to clone the repository from GitHub:
        git clone https://github.com/niklasekstrom/a314.git

Go to Software directory:
        cd a314/Software
Set the build script as executable:
        sudo chmod +x rpi_docker_build.sh
Build software for both the Amiga and Pi:
        ./rpi_docker_build.sh
    This can take some time...
Install software for Pi:
        sudo make install

Make a314d executable:
        sudo chmod +x /opt/a314/a314d
Enable and add a314d to startup:
        sudo systemctl daemon-reload
        sudo systemctl enable a314d
        sudo systemctl start a314d

Create the directory a314shared for PiDisk:
        mkdir /home/pi/a314shared
    I'm assuming you are using the default user pi from the Raspbian installation;
    If not, then you can change this path in the file /etc/opt/a314/a314fs.conf.

To be able to use PiAudio you have to create asound.conf that will configure
ALSA (Advanced Linux Sound Architecture) to send audio to your Amiga:
        sudo nano /etc/alsa/conf.d/asound.conf
Paste the text below into the empty file:
        pcm.!amiga {
            type plug
            slave {
                pcm pipe
                format s8
                rate 18000
                channels 2
            }
            hint {
                description "Play audio to Amiga using A314"
            }
        }
        pcm.pipe {
            type file
            format raw
            file "/tmp/piaudio_pipe"
            slave.pcm null
        }

    Save and exit by pressing <ctrl+x>, then press <y>, and hit <enter>.

Create a empty .asoundrc to prevent asound.conf to be overwritten by other instances:
        touch /home/pi/.asoundrc
Change permission to read only:
        chmod a-w /home/pi/.asoundrc

Install mpg123 for mp3 playback:
        sudo apt install mpg123
To make it easier to "play all" with mpg123, you have to create an executable bash file.
To do this, first log in as super user (su):
        sudo su
Create the "play all" bash script for mpg123.
Copy and paste all text below, and hit <enter>:
        echo '#\!/bin/sh' > /usr/local/bin/playmusic
        echo 'mpg123 -a amiga ./Music/*.mp3' >> /usr/local/bin/playmusic

Make the bash script executable for all users:
        chmod a+x /usr/local/bin/playmusic
    Press <ctrl+d> to exit su (super user) promt.

The SANA-II device driver and its configuration is only needed if you are going to access internet directly via a WB application, ohterwise the RPi will solve most of your connectivity. If you are going to use the driver you have to edit rc.local:
        sudo nano /etc/rc.local
Paste the following lines before <exit 0> near the end of the file:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i wlan0 -o tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i tap0 -o wlan0 -j ACCEPT

    Save and exit by pressing <ctrl+x>, then press <y>, and hit <enter>.

Setting up Pure-FTPd - for easy file transfers to the Raspberry Pi.

Install the Pure-FTPd server:
        sudo apt install pure-ftpd
Create a new user group:
        sudo groupadd ftpgroup
Create a new user that has NO login privilege and NO home directory:
        sudo useradd ftpuser -g ftpgroup -s /sbin/nologin -d /dev/null
Set ownership for the folder a314shared/ and Music/:
        sudo chown pi:ftpgroup /home/pi/a314shared/
        sudo chown pi:ftpgroup /home/pi/Music/

Create file Umask, and setup permissions for files and folders:
        sudo nano /etc/pure-ftpd/conf/Umask
Set permissions for folder:file to 666:774, by adding the following line to the empty file:
        111 003
    Save and exit by pressing <ctrl+x>, then press <y>, and hit <enter>
Add user pi to group ftpgroup, and make folder writable for ftpgroup:
        sudo usermod -a -G ftpgroup pi
        sudo chmod g+w /home/pi/a314shared/
        sudo chmod g+w /home/pi/Music/

Create a pure-ftp user - replace <user> with a name of your choice - and map it to ftpuser, ftpgroup, and setup home directory:
        sudo pure-pw useradd <user> -u ftpuser -g ftpgroup -d /home/pi/ -m
Create data base:
        sudo pure-pw mkdb
Define the authentication method:
        sudo ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/60puredb
Restart Pure FTPd with new settings:
        sudo service pure-ftpd restart
More info can be found at: pureftp.org

Setting up your Amiga WorkBench HD/floppy.

In the a314/Software/bin directory there are a number of files that should be copied to your Amiga WorkBench directories, this can be done in different ways, preferably via UAE.

a314/Software/bin/a314.device to DEVS:
a314/Software/bin/a314eth.device to DEVS:
a314/Software/bin/a314fs to L:
a314/Software/bin/pi to C:
a314/Software/bin/piaudio to C:
a314/Software/bin/remote-mouse to C:
a314/Software/bin/remotewb to C:
a314/Software/bin/videoplayer to C:
a314/Software/a314fs/a314fs-mountlist to DEVS:
     You could also append the content of a314fs-mountlist to DEVS:MountList.
     This is done easiest by copying the MountList file to the a314shared/ folder,
     and then edited with nano via SSH:
          sudo nano /home/pi/s314shared/MountList
     Append this text at the end of MoutList:
          PI0: FileSystem = l:a314fs
               Device = a314.device
               Unit = 0
               Surfaces = 1
               BlocksPerTrack = 10
               Reserved = 2
               LowCyl = 0
               HighCyl = 100
               StackSize = 1000
               Mount = 1
               DosType = 0x33313400
           #

        Save and exit by pressing <ctrl+x>, then press <y>, and hit <enter>.
    Replace the old MountList in DEVS: on your Amiga with the newly edited one.

If you want to use the SANA-II device driver to access internet via WB, you first need to install a TCP/IP stack called RoadShow - it is possible to use another TCP/IP stack, but they might create other directories than specified below, or need other kinds of setup. After the installation you need to copy the folowing A314 files to the directories created by RoadShow:
a314/Software/ethernet/amiga-config/A314Eth to DEVS:NetInterfaces/
a314/Software/ethernet/amiga-config/routes to DEVS:Internet/
a314/Software/ethernet/amiga-config/name_resolution to DEVS:Internet/

Note that if you clone the Git repo on Windows then Git may change the line endings of that file to CRLF instead of just LF (depending on your Git settings),
and the Amiga mount command cannot handle that, so you may have to open the file in some editor that allows you to change the line endings back to just LF.

Optional - Add Audio Filter Switch (AFS) to C: for bettter audio playback:
Dowload AFSwitch from aminet.net, extract AFSwitch.lha and copy:
afs to C:

    How AFSwitch works.
    AFS D ........ Disable audio filter/LED
    AFS E ........ Enable audio filter/LED
    AFS S ........ simply Switch the current state of audio filter/LED
    AFS H or ? ... small help text

Editing startup-sequences.

Edit SYS:S/User-Startup by adding the following lines:
        ;Mount A314 filesystem
        ;with a314fs-mountlist (if not used remove this and next line)
        Mount Pi0: FROM DEVS:a314fs-mountlist

        ;with MountList (if not used remove this and next line)
        Mount Pi0:

        ;Starts remote-mouse service for connected bluetooth mouse
        RUN >NIL: C:remote-mouse

Edit SYS:S/Shell-Startup by adding the following lines:
        ;Starts A314 piaudio service
        RUN >NIL: piaudio
        ;AFS disable filter (if not used remove this and next line)
        AFS D

        ;Alias for A314
        Alias reboot pi sudo reboot
        Alias shutdown pi sudo shutdown now
        Alias mp3list pi ls ./Music/
        Alias mp3 pi mpg123 -a amiga "./Music/[]"
        Alias mp3all pi bash playmusic

Power off your Amiga and put your Raspberry Pi int the A314 socket.
Start your Amiga, now you should be up and running with the basics!

Please stay tuned for more tips and trix! šŸ™‚

Meanwhile check out these links:
Take a look at my other posts regarding A314 @CrowStudio
Join the A314 discussion @discord
A314 @GitHub
A314 - The RPi co-processor Official thread @EAB

Spread the love

11 thoughts on “How to setup your A314

    • Thanks! šŸ™‚
      Unfortunately I cannot do that at the moment. I know that the A314-team have talked about this as a coming feature at the GitHub repository. However, it is not very hard to make the installation and setup – you have a great guide to follow! šŸ˜‰
      Have you bought a card yet?

      Best regards/Daniel

    • As the documentation over at raspberrypi.org says – “Minimum value of core_freq used for dynamic frequency clocking.”
      So no need to worry about that! šŸ˜‰

  1. Hi, this is the type of guide that is ideal for me with my limited knowledge of Linux, would it be possible to update this on how to build and configure the a314eth.device please.

    I’m using a version 1.1 A314 board, on an A500 with 1mb chip and 8mb fastram with OS 3.1 with a Pi 3b+ board connected

    • Hi Alasdair!

      I will make one for sure, a bit much going on right now though!
      Please come and visit us at the discord channel, link can be found at the bottom of the post above šŸ˜‰

      Best regards/Daniel

    • If you follow thn setup of the SANA-II device driver on your RPI, installing the RoadShow TCP/IP stack and the a314eth.device on your Amiga you can.
      You can also use the WiFi indirect to download files on your RPi, and then transfer them to your Amiga via Pi0: (PiDisk:)
      Hope this answered your question šŸ™‚

Leave a Reply to Daniel Cancel reply

Your email address will not be published. Required fields are marked *