How add I2S, I2C, SPI ports to DietPi OS? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
INSERT
Posts: 1
Joined: Mon Jun 15, 2020 1:15 am

How add I2S, I2C, SPI ports to DietPi OS?

Post by INSERT »

Hi All!

I have Nanopi NEO PLUS2, and i can't using ports in there. I see only UART ports...

Somebody help me?
User avatar
MichaIng
Site Admin
Posts: 3106
Joined: Sat Nov 18, 2017 6:21 pm

Re: How add I2S, I2C, SPI ports to DietPi OS?

Post by MichaIng »

Did you find the dtoverlays that are required to enable those?

Edit /boot/armbianEnv.txt
To overlays= line add any of i2c0, i2c1, spi-spidev, ... (space separated)
Check out /boot/dtb/allwinner/overlay/README.sun50i-h5-overlays for a full list and explanation about available overlays.
m9aertner
Posts: 2
Joined: Fri Jan 01, 2021 9:58 pm

Re: How add I2S, I2C, SPI ports to DietPi OS?

Post by m9aertner »

Thank you for that pointer to the "overlays".

I got myself a small "NanoPI NEO" and found that there's no sound output with the stock install (current DietPI).
Initially, I used "dietpi-config", Audio Options, Sound Card and set that to "h3-analogue", but that was not enough.

Following your hint, I added "analog-codec" to /boot/armbianEnv.txt overlays, and presto ... it comes up!

Code: Select all

$ uname -a
Linux DietPi 5.9.14-sunxi #20.11.3 SMP Fri Dec 11 20:31:12 CET 2020 armv7l GNU/Linux

$ cat /proc/asound/cards
--- no soundcards ---

# Make sure "analog-codec" is listed in "overlays"
# Cf. /boot/dtb-5.9.14-sunxi/overlay/README.sun8i-h3-overlays
$ grep overlays /boot/armbianEnv.txt
overlays=usbhost1 usbhost2 analog-codec

# reboot
$ shutdown -r now

# Now the "Sound Card" is present:
$ cat /proc/asound/cards
 0 [Codec          ]: H3_Audio_Codec - H3 Audio Codec
                      H3 Audio Codec

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 [CDC PCM Codec-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

# Play something ...
$ aplay /usr/share/sounds/alsa/Rear_Left.wav

User avatar
MichaIng
Site Admin
Posts: 3106
Joined: Sat Nov 18, 2017 6:21 pm

Re: How add I2S, I2C, SPI ports to DietPi OS?

Post by MichaIng »

Many thanks for the info. Looks like we need to add this overlay in case of all Armbian-based H3 SoC images, when onboard sound is selected.
Post Reply