Enable SPI ports


how can I enable SPI (/dev/spidev…) on orange-pi-zero and up-board (UP^2) platforms?

Many thanks.

Hi @spinarr, for those devices, how does enabling work in other OS? As quickly checked, for the OrangePi it is a similar mechanism as the Raspberry Pi with a armbianEnv.txt file on the boot partition? I think if so, we don’t yet support that, but will open an issue for our internal issue tracker to discuss and add.

For the UP^2, does it have those /dev/spidev... devices available if you connect to the host OS? If it already has, then you might just need to set the service you use privileged: true and it should show up inside the containers too, as per our documentation Interacting with Hardware.

Hi @imrehg,

  • orange pi zero armbianEnv.txt

overlays=usbhost2 usbhost3 spi-spidev uart1 uart2

  • up2

SPI devices are not available


For the OrangePi, where have you put this file? Is it on the resin-boot partition of the SD card? (in the running system / host OSit’s /mnt/boot/).

Also, would not add anything extra except what you need (i.e. no rootdev, rootfstype, etc… as that can mess with the system)

We are checking with our team whether this is supported by balenaOS.

For UP^2, checking with our team, maybe the kernel modules are not compiled in, but need to check on a device.

  • opi zero

This file is present when using armbian distro.
Using balenaOS is not present.

  • up2

Using ubilinux/ubuntu distro SPI needs to be enabled:

we are checking on both accounts with our device support team, and will get back to you with more info.

@spinarr currently the armbianEnv.txt for overlay support is only an armbian feature that they have built. We plan to add this functionality to balenaOS, but currently not being worked on. Hopefully we can find some engineering resources soon to work on this or someone from the community will pick up the task. it will be incredibly useful to have :slight_smile:

On the UPboard SPI, we have created an issue to track it here https://github.com/balena-os/balena-up-board/issues/74 so if you are interested, add your finding there and our team can work on getting it working :slight_smile:


Is it also possible to create issue for OPI Zero board?
How does community know about the task?

I will check UPboard SPI issue.

We have one tracking internally, but I will add a corresponding one on this repo https://github.com/balena-os/balena-allwinner and we can track it there as well.

Issue for the OPI zero here: https://github.com/balena-os/balena-allwinner/issues/78