No SPI Device is shown under /dev/spi*

Hi,
i am trying to glow led using SPI on jetson nano development kit(a02) i have followed
JETSON NANO EXPANSION HEADER to do initial setup.

same issue is posted on forum https://forums.developer.nvidia.com/t/spi-troubles/197105

solution was to run sudo modprobe spidev after reboot.
i did the same thing and run ls /dev/spi* still i am not to see spidevice under /dev Directory ,it says No such file or directory.

Thanks.

What’s the version.
Did you run jeston-io to configure the SPI PINs?

Hi,
sorry i didn’t get your question,which version you want to know ?
yes i have ran jetson-io to configure SPI PIns and configured SPI1 (19, 21, 23, 24, 26) .
i have connected D0 pin of ws2812B RGB with SPI1 MOSI pin (pin no 19 a02 board),supply Vcc (pin 2) and GROUND (pin 6).
To blink RGB light i am using neopixel_spi_simpletest.py after running python file on CLI i am getting error saying No Module name board.
to resolve this error i followed issue 43,
after installing Adafruit blinka library forcefully still getting the same error.
is there any way to resolve this error and blink RGB lights using SPI.
Thanks.

Check the BSP version by below command.

cat /etc/nv_tegra_release

Thanks for the Quick Response,
cat /etc/nv_tegra_release :
R32 (release), REVISION: 6.1, GCID: 27863751, BOARD: t210ref, EABI: aarch64, DATE: Mon Jul 26 19:20:30 UTC 2021

That’s weird, didn’t you have any device tree modification?

what changes do i need to configure into dtb file can you please suggest me.

With default system image should be able generate /dev/spidev*.* after modeprobe
And jetson-io only for the PIN configure for the functionality.

thank you, now i am able to see spidevice under /dev.

steps that i followed to work ws2812B with jetson nano board using spi interface.
Install Pip3 if not already installed:
sudo apt-get install python3-pip

Reboot

Install Adafruit-Blinka 5.8.0:
pip3 install Adafruit-Blinka

Enable SPI on Jetson Nano:
sudo /opt/nvidia/jetson-io/jetson-io.py

Select Configure 40-pin expansion header at the bottom.

Select spi1 (19, 21, 23, 24, 26) and then select Back

Finally select Save and reboot to reconfigure pins. This will create a config file and reboot the Jetson Nano.

After the Nano boots up again, verify you have the SPI devices with the command:
ls /dev/spi*
if it doesnt show any spidevice then try sudo modprobe spidev

Then, we need to set user permissions. In order to use the Jetson GPIO Library, the correct user permissions/groups must be set first. Start by creating a new gpio user group:

sudo groupadd -f -r gpio
sudo usermod -a -G gpio username

Clone the Repo and copy the rules:

cd ~
git clone GitHub - NVIDIA/jetson-gpio: A Python library that enables the use of Jetson's GPIOs
sudo cp ~/jetson-gpio/lib/python/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d

This section was originally written for releases before JetPack 4.3. For JetPack 4.3, the udev rules are in: /lib/udev/rulesd/60-jetson-gpio-common.rules. This should mean that you don’t have to copy the file anymore with JetPack 4.3 and above.

Also, it appears as if the default is for users to be included in the gpio group. You can check this by:
$ groups

Clone the Repo and copy the rules:

cd ~
git clone GitHub - NVIDIA/jetson-gpio: A Python library that enables the use of Jetson's GPIOs
sudo cp ~/jetson-gpio/lib/python/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d

This section was originally written for releases before JetPack 4.3. For JetPack 4.3, the udev rules are in: /lib/udev/rulesd/60-jetson-gpio-common.rules. This should mean that you don’t have to copy the file anymore with JetPack 4.3 and above.

Also, it appears as if the default is for users to be included in the gpio group. You can check this by:
$ groups
Reboot

Update just in case if a library is missing:
sudo pip3 install --upgrade adafruit_blinka

Install CircuitPython NeoPixel_SPI library;:

pip3 install adafruit-circuitpython-neopixel-spi

Reboot again and that´s all!!!

Connect “Din” of your Neopixel to the SPI1_MOSI pin of your Jetson Nano(pin 19 of the expansion header), Gnd to Gnd and 5v to 5v.

sample script :
import board
import neopixel_spi

pixels = neopixel_spi.NeoPixel_SPI(board.SPI(), 10)
pixels.fill(0xff0000)

If an error occurs
Check you have installed this dependencies:

Adafruit CircuitPython BusDevice
pip3 install adafruit-circuitpython-busdevice

Pypixelbuf
pip3 install adafruit-circuitpython-pypixelbuf

python script : make sure that your python3 version is 3.7+

SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries

SPDX-License-Identifier: MIT

import time
import board
import neopixel_spi as neopixel

NUM_PIXELS = 12 // change number acc. to length of led stripe
PIXEL_ORDER = neopixel.GRB
COLORS = (0xFF0000, 0x00FF00, 0x0000FF)
DELAY = 1 //change delay according to your requierment

spi = board.SPI()

pixels = neopixel.NeoPixel_SPI(
spi, NUM_PIXELS, pixel_order=PIXEL_ORDER, auto_write=False
)

while True:
for color in COLORS:
for i in range(NUM_PIXELS):
pixels[i] = color
pixels.show()
time.sleep(DELAY)
pixels.fill(0)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.