If you are wondering about which SBC to buy, keep these things in mind:
+ The board *must* support SPI (look at the specs/pinout to find out if it does)
+ It is easier to use a board that supports raspbian/raspberry pi OS
+ Boards often require their own kernel patches which rarely get upstreamed
All of this means that you should try to find a board that is *known* to support SPI on an OS for which there are available images.
It is *not* enough to know that the board itself supports SPI.
Selecting an Operating System
=============================
In theory, any linux based operating system will do.
In practice, many distros are highly limited when it comes to single-board-computers.
SBCs often require specialized kernel patches which are rarely upstreamed.
Additionally, armhf boards (like the le potato) are not supported in most modern distros.
In light of the above facts, it is a good general rule to use a distro aimed at supporting SBCs.
[Armbian](https://www.armbian.com/) is one such distro you might use.
Note that not all armbian images support SPI.
If your SBC supports [Raspbian](https://www.raspberrypi.com/software/) then using it will make your work much easier.
As a bonus, you may refer to the [main guide](spi.md) if the SBC you have supports raspbian, should you get confused with this guide.
Connecting to your Programmer
=============================
Many SBC operating systems enable ssh by default.
If the OS you chose does not enable ssh on first boot, try checking the distro documentation and looking for terms such as 'headless install.'
You will need the IP address of your programmer to continue.
Connecting via ethernet is generally easier than doing so with WiFi.
Check your distro's docs if you wish to connect with WiFi only.
To determine the IP address of your programmer, log in to your AP/Router web interface.
If you're not sure the IP address of your AP, it is likely `192.168.1.1.`
You can determine the correct IP address with `ip r` on a linux machine.
You should see your programmer somewhere on the homepage, depending on your router firmware.
This author recommends using [https://openwrt.org/](https://openwrt.org/) for your router firmware.
SSH to your programmer using the default credentials as specified in your distro's docs.
The IP address is the one determined in the earlier step.
For example:
`ssh root@192.168.0.167`
Finding GPIO Pins
=================
If you have determined that a board supports SPI then the only step left is to
determine the correct location of the SPI pins.
The board will have the pinout in its documentation.
The Le potato board has the same pinout as the raspberry pi so you can refer to the [main SPIC documentation.](spi.md#gpio-pins-on-raspberry-pi-rpi-40-pin)
If your board is not raspberry pi compatible, refer to the [wiring table.](spi.html#soic8dip8wson8-wiring-diagram)
Match each of the categories in the 'signal' column with those in the 'pin' column.
Using this method, you can theoretically use any single board computer with SPI support.
Enabling SPI
============
The modules needed and methods to enable SPI vary based on the SBC you choose.
You should always make sure there is a well documented method for enabling SPI on your SBC before purchasing.
In the case of the *le potato,* SPI is enabled by activating the correct overlays as such (raspbian):
```
sudo ldto enable spicc spicc-spidev
sudo ldto merge spicc spicc-spidev
```
Using Flashrom
==============
Most linux distros will provide flashrom in their default repositories.
```
sudo apt update
sudo apt install flashrom
```
Reading/writing from SPI works respectively as such: