Problem Encountered When Transmitting Images to DISPLAY via SPI Communication on Jetson Nano

I am currently attempting to transmit images to a display via SPI communication on Jetson Nano.

The current setup involves installing Ubuntu 20.04 on Jetson Nano using an image downloaded from GitHub - Qengineering/Jetson-Nano-Ubuntu-20-image: Jetson Nano with Ubuntu 20.04 image.
The display being used is the adafruit PiTFT Plus 480x320 3.5" TFT+Touchscreen for Raspberry Pi (PiTFT Plus 480x320 3.5 TFT+Touchscreen for Raspberry Pi : ID 2441 : Adafruit Industries, Unique & fun DIY electronics and kits). The connection is established using jumper cables as follows:
Jetson’s Pin – Display Pin

  • pin12 – Backlight Control
  • pin18 – RT Interrupt
  • pin19 – SPI0 MOSI
  • pin21 – SPI0 MISO
  • pin22 – TFT Data/Command
  • pin23 – SPI0 SCLK
  • pin24 – TFT Chip Select
  • pin26 – RT Chip Select

I am currently referencing the repository at GitHub - JetsonHacksNano/SPI-Playground.

The issue I’m encountering is that while I was able to control the backlight with Jetson.GPIO, I encountered problems when attempting to use the adafruit_rgb_display.hx8357 display module for image transmission. Following the referenced repository, I’m using the digitalio and board modules, but not only am I unable to transmit images, but I’m also unable to adjust the backlight.

I’m seeking solutions or recommendations for displays compatible with smooth SPI communication on Jetson Nano.

The key points of my troubleshooting are as follows:

Executing the following code correctly applies voltage to pin 12 and successfully changes the display backlight:

import time
import Jetson.GPIO as GPIO
import spidev
from PIL import Image

def pin_init(i, interval_time):
	target_num = i
	GPIO.setmode(GPIO.BOARD)
	GPIO.setup(target_num, GPIO.OUT, initial=GPIO.LOW)
	print(f"              {i} is LOW")
	time.sleep(interval_time)
	
def pin_test(i, interval_time):
	target_num = i
	GPIO.setmode(GPIO.BOARD)
	GPIO.setup(target_num, GPIO.OUT, initial=GPIO.LOW)
	print(f"              {i} is LOW")
	time.sleep(interval_time)

	GPIO.output(target_num, GPIO.HIGH)
	print(f"              {i} is HIGH")
	time.sleep(interval_time)

	GPIO.output(target_num, GPIO.LOW)
	print(f"              {i} is LOW")
	time.sleep(interval_time)

	print(f"              {i} is nomal.")

print("GPIO pin test start")

spi = spidev.SpiDev()
spi.open(0, 0)
print("Current GPIO mode:", GPIO.getmode())

if False:
	pin_test(12, 1)
else:
	for i in range(1, 41):
		try:
			pin_init(i, 1)

		except Exception as e:
			print(f"{i} is errer.                {e}")
			continue
	pin_test(12,1)
	
GPIO.cleanup()
spi.close()

However, using the following code with what I believe is pin 12 (board.D12) does not change the backlight at all:

import time
import digitalio
import board

backlight_pin = digitalio.DigitalInOut(board.D12)
backlight_pin.direction = digitalio.Direction.OUTPUT

backlight_pin.value = True
print("Backlight ON")
time.sleep(2)

backlight_pin.value = False
print("Backlight OFF")
time.sleep(2)

backlight_pin.value = True
print("Backlight ON")
time.sleep(2)

backlight_pin.value = False
print("Backlight OFF")
time.sleep(2)

If possible, I’d like to perform image transmission. However, I’m currently unsure of how to find the pin numbers corresponding to board.##

My ultimate goal is to successfully transmit images generated with PIL to the display, as shown in the following code:

import digitalio
import board
from PIL import Image, ImageDraw
import adafruit_rgb_display.hx8357 as hx8357

cs_pin = digitalio.DigitalInOut(board.CE0)
dc_pin = digitalio.DigitalInOut(board.D25)
reset_pin = digitalio.DigitalInOut(board.D12)

BAUDRATE = 24000000

spi = board.SPI()

disp = hx8357.HX8357(spi, rotation=180, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)

# Create blank image for drawing.
# Make sure to create image with mode 'RGB' for full color.
if disp.rotation % 180 == 90:
    height = disp.width   # we swap height/width to rotate it to landscape!
    width = disp.height
else:
    width = disp.width   # we swap height/width to rotate it to landscape!
    height = disp.height
image = Image.new('RGB', (width, height))

# Get drawing object to draw on image.
draw = ImageDraw.Draw(image)

# Draw a black filled box to clear the image.
draw.rectangle((0, 0, width, height), outline=0, fill=(0, 0, 0))
disp.image(image)

image = Image.open("./shark.jpg")

# Scale the image to the smaller screen dimension
image_ratio = image.width / image.height
screen_ratio = width / height
if screen_ratio < image_ratio:
    scaled_width = image.width * height // image.height
    scaled_height = height
else:
    scaled_width = width
    scaled_height = image.height * width // image.width
#image = image.resize((scaled_width, scaled_height), Image.BICUBIC)
image = image.resize((scaled_width, scaled_height))

# Crop and center the image
x = scaled_width // 2 - width // 2
y = scaled_height // 2 - height // 2
image = image.crop((x, y, x + width, y + height))

# Display image.
disp.image(image)

Any help would be greatly appreciated.


I hope this helps! Let me know if you need further assistance.

Hi FastDarkTemplar,

Are you using the devkit or custom board for Jetson Nano?
What’s your Jetpack version in use?

Have you verified SPI loopback test before connecting with your Display?

Sorry that I’m not clear about your custom application.

Do you mean that you want to know the PIN12 of 40-pin expansion header maps to which pin of the Jetson Nano module?
If so, you can check "*NVIDIA Jetson Nano Developer Kit *
Carrier Board P3449_B01" spec and also the pinmux spreadsheet for detail.
It should be PJ.07 for PIN12 of 40-pin expansion header.

Hello Kevin!

I’m using the Devkit for Jetson Nano and my Jetpack version is 4.6-b197.

I didn’t know there was an SPI loopback test available on the Devkit for Jetson Nano, so I tested each pin with a multimeter.

Over the weekend, while checking for any mistakes, I found one. When I changed the pin number from D12 to D18 in the original code, the backlight control started working. Then today, I found the pinout map below and adjusted the pin numbers accordingly.

Figure 1

However, I’m still failing to transmit images, and I can’t figure out what the problem is.

Below is the pin connection method for the display I’m using. I connected the jumper wires according to this.

And here’s the new SPI communication code with corrected pin numbers.

import digitalio
import board
from PIL import Image, ImageDraw
import adafruit_rgb_display.hx8357 as hx8357

cs_pin = digitalio.DigitalInOut(board.D8) # origin is CE0
dc_pin = digitalio.DigitalInOut(board.D25) # origin is D25
reset_pin = digitalio.DigitalInOut(board.D18) # origin is D12

BAUDRATE = 24000000

spi = board.SPI()

disp = hx8357.HX8357(spi, rotation=180, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)

# Create blank image for drawing.
# Make sure to create image with mode 'RGB' for full color.
if disp.rotation % 180 == 90:
    height = disp.width   # we swap height/width to rotate it to landscape!
    width = disp.height
else:
    width = disp.width   # we swap height/width to rotate it to landscape!
    height = disp.height
image = Image.new('RGB', (width, height))

# Get drawing object to draw on image.
draw = ImageDraw.Draw(image)

# Draw a black filled box to clear the image.
draw.rectangle((0, 0, width, height), outline=0, fill=(0, 0, 0))
disp.image(image)

image = Image.open("./shark.jpg")

# Scale the image to the smaller screen dimension
image_ratio = image.width / image.height
screen_ratio = width / height
if screen_ratio < image_ratio:
    scaled_width = image.width * height // image.height
    scaled_height = height
else:
    scaled_width = width
    scaled_height = image.height * width // image.width
#image = image.resize((scaled_width, scaled_height), Image.BICUBIC)
image = image.resize((scaled_width, scaled_height))

# Crop and center the image
x = scaled_width // 2 - width // 2
y = scaled_height // 2 - height // 2
image = image.crop((x, y, x + width, y + height))

# Display image.
disp.image(image)

I appreciate your interest in my question. Thank you.

+) The diagram below illustrates the connection method used in the source code I referred to. I’ve added some modifications for clarity.

++) I further iterated over all the pins as follows to observe if any of them succeeded in transmitting the image, but all pins failed:

import digitalio
import board
from PIL import Image, ImageDraw
import adafruit_rgb_display.hx8357 as hx8357

def test_pin(id1, id2):
	cs_pin = digitalio.DigitalInOut(id1)
	dc_pin = digitalio.DigitalInOut(id2)
	reset_pin = digitalio.DigitalInOut(board.D18) # Fixed

	BAUDRATE = 24000000

	spi = board.SPI()

	disp = hx8357.HX8357(spi, rotation=180, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)

	# Create blank image for drawing.
	# Make sure to create image with mode 'RGB' for full color.
	if disp.rotation % 180 == 90:
	    height = disp.width   # we swap height/width to rotate it to landscape!
	    width = disp.height
	else:
	    width = disp.width   # we swap height/width to rotate it to landscape!
	    height = disp.height
	image = Image.new('RGB', (width, height))

	# Get drawing object to draw on image.
	draw = ImageDraw.Draw(image)

	# Draw a black filled box to clear the image.
	draw.rectangle((0, 0, width, height), outline=0, fill=(0, 0, 0))
	disp.image(image)

	image = Image.open("./shark.jpg")

	# Scale the image to the smaller screen dimension
	image_ratio = image.width / image.height
	screen_ratio = width / height
	if screen_ratio < image_ratio:
	    scaled_width = image.width * height // image.height
	    scaled_height = height
	else:
	    scaled_width = width
	    scaled_height = image.height * width // image.width
	#image = image.resize((scaled_width, scaled_height), Image.BICUBIC)
	image = image.resize((scaled_width, scaled_height))

	# Crop and center the image
	x = scaled_width // 2 - width // 2
	y = scaled_height // 2 - height // 2
	image = image.crop((x, y, x + width, y + height))

	# Display image.
	disp.image(image)
	
	
id_list = dir(board)
id_len = len(id_list)
for i in range(id_len):
	for j in range(i + 1, id_len):
		try:
			print(id_list[i], id_list[j])
			test_pin(getattr(board, id_list[i]), getattr(board, id_list[j]))
		except Exception as e:
			print(e)
			continue

I would suggest you could refer to Jetson Nano SPI Bus Not Working - #10 by KevinFFF verify SPI loopback test first.

Do you connect PIN21 for SPI1_1_MISO?

Have you configured PIN18/PIN22/PIN12 as GPIO in pinmux before using them?

Is there any error message showing in the dmesg?

While following the instructions for the SPI loopback test, I encountered the following results.

In step 3.3, the expected result was:

$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi
Bank: 1 Reg: 0x70003050 Val: 0x0000e044 -> spi1_mosi_pc0
Bank: 1 Reg: 0x70003054 Val: 0x0000e044 -> spi1_miso_pc1
Bank: 1 Reg: 0x70003058 Val: 0x0000e044 -> spi1_sck_pc2
Bank: 1 Reg: 0x7000305c Val: 0x0000e048 -> spi1_cs0_pc3
Bank: 1 Reg: 0x70003060 Val: 0x0000e048 -> spi1_cs1_pc4
Bank: 1 Reg: 0x70003064 Val: 0x00006044 -> spi2_mosi_pb4
Bank: 1 Reg: 0x70003068 Val: 0x00006044 -> spi2_miso_pb5
Bank: 1 Reg: 0x7000306c Val: 0x00006044 -> spi2_sck_pb6
Bank: 1 Reg: 0x70003070 Val: 0x00006048 -> spi2_cs0_pb7
Bank: 1 Reg: 0x70003074 Val: 0x00006048 -> spi2_cs1_pdd0

But my actual result was:

root@nano:/boot/dtb# sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi
Bank: 1 Reg: 0x70003050 Val: 0x0000e044 -> spi1_mosi_pc0
Bank: 1 Reg: 0x70003054 Val: 0x0000e044 -> spi1_miso_pc1
Bank: 1 Reg: 0x70003058 Val: 0x0000e044 -> spi1_sck_pc2
Bank: 1 Reg: 0x7000305c Val: 0x0000e048 -> spi1_cs0_pc3
Bank: 1 Reg: 0x70003060 Val: 0x0000e048 -> spi1_cs1_pc4
Bank: 1 Reg: 0x70003064 Val: 0x00006017 -> spi2_mosi_pb4
Bank: 1 Reg: 0x70003068 Val: 0x00006017 -> spi2_miso_pb5
Bank: 1 Reg: 0x7000306c Val: 0x00006017 -> spi2_sck_pb6
Bank: 1 Reg: 0x70003070 Val: 0x0000601b -> spi2_cs0_pb7
Bank: 1 Reg: 0x70003074 Val: 0x0000601b -> spi2_cs1_pdd0
Bank: 1 Reg: 0x70003078 Val: 0x0000e015 -> spi4_mosi_pc7
Bank: 1 Reg: 0x7000307c Val: 0x0000e015 -> spi4_miso_pd0
Bank: 1 Reg: 0x70003080 Val: 0x0000e015 -> spi4_sck_pc5
Bank: 1 Reg: 0x70003084 Val: 0x0000e015 -> spi4_cs0_pc6
Bank: 1 Reg: 0x70003088 Val: 0x00002040 -> qspi_sck_pee0
Bank: 1 Reg: 0x7000308c Val: 0x00002000 -> qspi_cs_n_pee1
Bank: 1 Reg: 0x70003090 Val: 0x00002040 -> qspi_io0_pee2
Bank: 1 Reg: 0x70003094 Val: 0x00002040 -> qspi_io1_pee3
Bank: 1 Reg: 0x70003098 Val: 0x00002040 -> qspi_io2_pee4
Bank: 1 Reg: 0x7000309c Val: 0x00002040 -> qspi_io3_pee5
Bank: 0 Reg: 0x70000b70 Val: 0x00000001 -> drive_qspi_comp_control
Bank: 0 Reg: 0x70000b78 Val: 0x00000001 -> drive_qspi_lpbk_control
Bank: 0 Reg: 0x70000a78 Val: 0x00808000 -> drive_qspi_comp

Continuing from this state resulted in:

Result 1:

root@nano:~/projects# sudo ./spidev_test -D /dev/spidev0.0 -v -p "HelloWorld123456789abcdef"
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 48 65 6C 6C 6F 57 6F 72 6C 64 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 __ __ __ __ __ __ __  | HelloWorld123456789abcdef
RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __  | ..........................

Result 2:

root@nano:~/projects# sudo ./spidev_test -D /dev/spidev0.0 -s 10000000 -v
spi mode: 0x0
bits per word: 8
max speed: 10000000 Hz (10000 KHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D  | ......@....�..................�.
RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  | .............................

When I checked the MOSI line with an oscilloscope, no data was being transmitted.

Below are the steps I followed to set up SPI communication. I am listing them to check if there are any mistakes or missing steps.
And the link below is the guide I referred to for setting up SPI communication.
SPI on Jetson - Using Jetson-IO - JetsonHacks

## SPI Setting
sudo mkdir /boot/dtb
sudo cp -v /boot/tegra210-p3448-0000-p3449-0000-[ab]0[02].dtb /boot/dtb/

sudo /opt/nvidia/jetson-io/jetson-io.py

## Illegal instruction (core dumped)
export OPENBLAS_CORETYPE=ARMV8

## OSError: /dev/spidev0.0 does not exist
sudo modprobe spidev

After this, I ran the image transmission code and result is always fail.


Do you connect PIN21 for SPI1_1_MISO?

I connected PIN21 as MISO. Since it’s a touch panel, I made the connection.

Have you configured PIN18/PIN22/PIN12 as GPIO in pinmux before using them?

I haven’t configured settings like pinmux separately, but it seemed like normal signals were appearing on the oscilloscope.

Is there any error message showing in the dmesg?

No error messages appear, and the code exits, so I’m not sure what to do next…

It seems your pinmux registers of spi1 are configured correct for SPI usage.

Please also share the result of the following command for further check.

$ sudo cat /sys/kernel/debug/tegra_gpio

I created a SPI loopback test in Python, and when executed as shown below, the signal is received correctly.

import Jetson.GPIO as GPIO
import time

# GPIO pin setup
MOSI_PIN = 19
MISO_PIN = 21
CLK_PIN = 23

# SPI data transfer function
def transfer_data(data):
    received_data = []
    for bit in data:
        GPIO.output(MOSI_PIN, bit)
        GPIO.output(CLK_PIN, GPIO.HIGH)
        received_data.append(GPIO.input(MISO_PIN))
        time.sleep(0.001)
        GPIO.output(CLK_PIN, GPIO.LOW)
    return received_data

# Main loop
try:
    # Initialize GPIO
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(MOSI_PIN, GPIO.OUT)
    GPIO.setup(MISO_PIN, GPIO.IN)
    GPIO.setup(CLK_PIN, GPIO.OUT)
    
    # Prepare data
    data_out = [1, 0, 1, 0, 1, 0, 1, 0]  # Arbitrary data
    print(f"S e n d : {data_out}")

    # Transmit and receive data
    data_in = transfer_data(data_out)
    print(f"Received: {data_in}")
    
except KeyboardInterrupt:
    pass

finally:
    GPIO.cleanup()

And that’s result is here.

root@nano:~/projects/SPI-Playground/examples# python3 SPI_loopback_test3.py 
S e n d : [1, 0, 1, 0, 1, 0, 1, 0]
Received: [1, 0, 1, 0, 1, 0, 1, 0]

This way’s problem is that when transmitting data such as a 3-channel color image, it takes too long because of the time.sleep(0.001) delay. Without this delay, the data is not received correctly. How can I transmit image data quickly by using Jetson.GPIO module?
Can the Jetson.GPIO module not configure clock rates? Is the Jetson.GPIO module disadvantageous for image transmission?


I will post the results of running $ sudo cat /sys/kernel/debug/tegra_gpio tomorrow.
Currently, I am unable to access the Jetson Nano as it is too far away.

The following is the execution result.

root@nano:~/projects/SPI-Playground/examples# sudo cat /sys/kernel/debug/tegra_gpio
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 00 00 00 000000
 C: 0:2 1f 00 00 1b 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 00 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 f0 00 00 80 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 10 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

In the current SPI loopback test, the following C code is not producing the expected results, so I reconfigured the SPI settings.

Step 5. Download/build this test file:
5-1 Download
$ wget https://raw.githubusercontent.com/torvalds/linux/v4.9/tools/spi/spidev_test.c
5-2 Build on the board
$ gcc -o spidev_test spidev_test.c

After running this command, I attempted to execute sudo /opt/nvidia/jetson-io/jetson-io.py , but the screen did not appear, and it immediately terminated.

To investigate the issue, I ran sudo /opt/nvidia/jetson-io/jetson-io.py |less and discovered a duplicate profile (relying on my memory, so it might be inaccurate). This resulted in a “FATAL ERROR.”

I resolved it by deleting the tegra210-p3448-0000-p3449-0000-b00.dtb .
Afterward, I was able to run sudo /opt/nvidia/jetson-io/jetson-io.py again and reconfigure the SPI settings.

I’m documenting this unique experience to highlight the difference from others.

Thank you for the sharing the experiences.

Do you get the expected SPI loopback result through spidev_test after these configurations?

No… The Python SPI loopback code I created works, but there’s a problem where it takes 1ms to send 1 bit.
Also, when I run sudo ./spidev_test -D /dev/spidev0.0 -v -p "HelloWorld123456789abcdef , there’s no signal coming out of MOSI.

Is there any error showing when you run this command?

Could you refer to the exact the same steps as Jetson Nano SPI Bus Not Working - #10 by KevinFFF I shared to verify SPI loopback test?
It has been verified from us locally and also some forum users.

I’m also not clear about why you need to create /boot/dtb on your board.
It should exist after you boot up and there’s kernel_XXX.dtb exists by default.

No. There were no error messages. I followed the steps mentioned in the link, but the difference is described above.


This was a my mistake. At first, I thought this folder didn’t exist, so I tried to create it, but it turned out the folder already existed. So, I should have corrected my notes, but I forgot and posted them together.

Do you enable both SPI1 and SPI2 from Jetson-IO?
If so, you should get the same pinmux register value as mine.

I activated both SPI1 and SPI2 or only SPI1 through Jetson-IO, but the message remained the same as shown below. There was no change in the output.

jetson@nano:~$ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi
Bank: 1 Reg: 0x70003050 Val: 0x0000e044 -> spi1_mosi_pc0
Bank: 1 Reg: 0x70003054 Val: 0x0000e044 -> spi1_miso_pc1
Bank: 1 Reg: 0x70003058 Val: 0x0000e044 -> spi1_sck_pc2
Bank: 1 Reg: 0x7000305c Val: 0x0000e048 -> spi1_cs0_pc3
Bank: 1 Reg: 0x70003060 Val: 0x0000e048 -> spi1_cs1_pc4
Bank: 1 Reg: 0x70003064 Val: 0x00006044 -> spi2_mosi_pb4
Bank: 1 Reg: 0x70003068 Val: 0x00006044 -> spi2_miso_pb5
Bank: 1 Reg: 0x7000306c Val: 0x00006044 -> spi2_sck_pb6
Bank: 1 Reg: 0x70003070 Val: 0x00006048 -> spi2_cs0_pb7
Bank: 1 Reg: 0x70003074 Val: 0x00006048 -> spi2_cs1_pdd0
Bank: 1 Reg: 0x70003078 Val: 0x0000e015 -> spi4_mosi_pc7
Bank: 1 Reg: 0x7000307c Val: 0x0000e015 -> spi4_miso_pd0
Bank: 1 Reg: 0x70003080 Val: 0x0000e015 -> spi4_sck_pc5
Bank: 1 Reg: 0x70003084 Val: 0x0000e015 -> spi4_cs0_pc6
Bank: 1 Reg: 0x70003088 Val: 0x00002040 -> qspi_sck_pee0
Bank: 1 Reg: 0x7000308c Val: 0x00002000 -> qspi_cs_n_pee1
Bank: 1 Reg: 0x70003090 Val: 0x00002040 -> qspi_io0_pee2
Bank: 1 Reg: 0x70003094 Val: 0x00002040 -> qspi_io1_pee3
Bank: 1 Reg: 0x70003098 Val: 0x00002040 -> qspi_io2_pee4
Bank: 1 Reg: 0x7000309c Val: 0x00002040 -> qspi_io3_pee5
Bank: 0 Reg: 0x70000b70 Val: 0x00000001 -> drive_qspi_comp_control
Bank: 0 Reg: 0x70000b78 Val: 0x00000001 -> drive_qspi_lpbk_control
Bank: 0 Reg: 0x70000a78 Val: 0x00808000 -> drive_qspi_comp

Additionally, I set up the environment again on a new SD card and conducted an SPI loopback test, but it still doesn’t work. It seems like I might be missing something.

I apologize for the delay in my response due to a severe cold.

The pinmux for spi2_XXX is correct now… (It was wrong in your previous result)

Do you mean that SPI loopback test still not working on your board?

Yes. It is not working still now. I set up a new SD card and conducted the SPI loopback test using Method 2, but it still doesn’t work.

Could it be an issue with step 2-2-2-5: Flash the board? In this step, I executed sudo cp ~/projects/spi_test/tegra210-p3448-0000-p3449-0000-b00.dtb /boot and then rebooted the board. I suspect this step might be causing the issue.

If not, I am not sure what else to do.

Yes, you should use the flash script to flash the board to apply the change.

Please modify the dtb in your BSP package(<Linux_for_Tegra>/kernel/dtb/tegra210-p3448-0000-p3449-0000-b00.dtb) on the host and reflash your board through flash.sh.