ePaper Display using a NVIDIA Jetson Nano and SPI does not work

Hello,

I have a 2.9 Flexible 296x128 Monochrome eInk / ePaper Display [UC8151D Chipset] : ID 4262 : $24.95 : Adafruit Industries, Unique & fun DIY electronics and kits connected to the Adafruit eInk Breakout Friend which I want to use with a NVIDIA Jetson Nano Development Kit B01. The Nano is running JetPack 4.6.1 and was freshly set up.

To test the display, I first tried it with a Raspberry Pi 4B. I set it up with the following steps:

sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install python3-pip -y
sudo pip3 install --upgrade setuptools
cd ~
sudo pip3 install --upgrade adafruit-python-shell
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
ls /dev/i2c* /dev/spi*
wget https://learn.adafruit.com/pages/12762/elements/2993427/download -O blinkatest.py && python3 blinkatest.py
sudo pip3 install adafruit-circuitpython-epd
wget https://github.com/adafruit/Adafruit_CircuitPython_framebuf/raw/main/examples/font5x8.bin
sudo pip3 install adafruit-circuitpython-neopixel

I then connected to pins of the display to the 40 pin header of the Raspberry Pi:

  • VIN → 3.3V
  • GND → GND
  • SCK → Pin 23 (GPIO11 / SPI_CLK)
  • MOSI → Pin 19 (GPIO10 / SPI_MOSI)
  • ECS → Pin 24 (GPIO08 / SPI_CE0_N)
  • D/C → Pin 15 (GPIO22 / GPIO_GEN3)
  • RST → Pin 13 (GPIO27 / GPIO_GEN2)
  • BUSY → Pin 11 (GPIO17 / GPIO_GEN0)

After that I tested it using a simple Python script.

import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.CE0)
dc = digitalio.DigitalInOut(board.D22)
rst = digitalio.DigitalInOut(board.D27)
busy = digitalio.DigitalInOut(board.D17)
srcs = None

from adafruit_epd.uc8151d import Adafruit_UC8151D
display = Adafruit_UC8151D(128, 296, spi, cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs, rst_pin=rst, busy_pin=busy)
display.set_black_buffer(1, True)
display.set_color_buffer(1, True)

display.rotation = 3
display.fill(Adafruit_EPD.WHITE)
display.text("Hello World!", 0, 0, Adafruit_EPD.BLACK, font_name='font5x8.bin', size=1)
display.display()

And it worked like expected. After that I switched to the Jetson Nano and installed the library using the following steps:

sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install python3-pip
sudo /opt/nvidia/jetson-io/jetson-io.py # activate SPI and reboot
sudo pip3 install --upgrade setuptools
pip3 install adafruit-blinka
pip3 install adafruit-circuitpython-epd
pip3 install Jetson.GPIO==2.0.21 # Use previous version because of the bugs with the latest version
wget https://github.com/adafruit/Adafruit_CircuitPython_framebuf/raw/main/examples/font5x8.bin
sudo modprobe spidev # enable SPI for use

I switched the connections to the Jetson Nano but didn’t change the pins since they should be compatible. However the display does not update nor flash / blink. The script runs without error but I cannot check the serial connection using an oscilloscope. I am grateful for any ideas on how the debug this problem.

Thanks in advance!

– Edit –
It looks like SPI is not enabled on the gpios. When I run sudo cat /sys/kernel/debug/tegra_gpio it returns:

Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
 A: 0:0 64 40 40 24 00 00 000000
 B: 0:1 f0 00 00 60 00 00 000000
 C: 0:2 1f 00 00 1d 00 00 000000
 D: 0:3 00 00 00 00 00 00 000000
 E: 1:0 40 00 00 00 00 00 000000
 F: 1:1 00 00 00 00 00 00 000000
 G: 1:2 0c 00 00 04 00 00 000000
 H: 1:3 fd 99 00 60 00 00 000000
 I: 2:0 07 07 03 02 00 00 000000
 J: 2:1 00 00 00 00 00 00 000000
 K: 2:2 00 00 00 00 00 00 000000
 L: 2:3 00 00 00 00 00 00 000000
 M: 3:0 00 00 00 00 00 00 000000
 N: 3:1 00 00 00 00 00 00 000000
 O: 3:2 00 00 00 00 00 00 000000
 P: 3:3 00 00 00 00 00 00 000000
 Q: 4:0 00 00 00 00 00 00 000000
 R: 4:1 00 00 00 00 00 00 000000
 S: 4:2 a0 80 00 00 00 00 000000
 T: 4:3 01 01 00 00 00 00 000000
 U: 5:0 00 00 00 00 00 00 000000
 V: 5:1 01 00 00 00 00 00 000000
 W: 5:2 00 00 00 00 00 00 000000
 X: 5:3 78 08 08 70 00 60 606000
 Y: 6:0 06 00 00 02 00 00 000000
 Z: 6:1 0f 08 08 04 00 06 020600
AA: 6:2 00 00 00 00 00 00 000000
BB: 6:3 01 00 00 00 00 00 000000
CC: 7:0 92 80 80 00 00 12 121200
DD: 7:1 01 00 00 00 00 00 000000
EE: 7:2 00 00 00 00 00 00 000000
FF: 7:3 00 00 00 00 00 00 000000

There shouldn’t C: 0:2 1f 00 00 1d 00 00 000000 instead be like C: 0:2 00 00 ...?

I enabled SPI via sudo /opt/nvidia/jetson-io/jetson-io.py however I also pushed a 0 into the register at 0x6000d008 and it still does not work?

Hi,
Do you use Jetson Nano module with SD card? The script jetson-io.py is supported on the module only. If you use the module with eMMC, you would need to modify device tree to enable SPI and re-flash the system.

After booting to Ubuntu desktop, please execute xxd command to check if device tree is configured correctly. And then execute sudo modprobe spidev and try this test:
How to set gpio for spi? - #27 by DaneLLL

To see if it works by sending data from MOSI to MISO

Hey,

pushing a 0 into the CNF register for SPI0 did fix my issue. I also managed to miscount the CS pin multiple times.

However, yes I am using a SD card. Does that mean I can only configure the expansion header by changing the device tree manually (using the pinmux spreadsheet)? If so is this a bug or feature? I have the same issues with configuring every special io.

I have looked into the Jetson Linux Developer Guide - Configuring Jetson Expansion Header but there is no documentation for why the tool won’t work when using a SD card.

Hi,
The tool works for Jetson Nano module with SD card slot. you can generate device tree files through jetson-io.py for a try. And apply the same to device tree and rebuild it. We have seen issue that the pins do not work as expected without clean re-flash. Please check
Jetson Nano FAQ

Q: How to configure the pinmux function of jetson Nano?
Q: Why pinmux setting does not work on some pins?

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