Enabling SPI in Jetson Nano using JetsonIO

Hello,

After I reconfigure the GPIO header to SPI1 using the “Configure 40-pin expansion header” option, I save and reboot. Then when I check again the header, I find that the pins went back to their original state “unused”.
Is that normal? and if it’s not, do you know what could be the reason?

@jonathanh
Do you have idea about this?

Thanks

Hello!

That is not expected indeed. After rebooting can you …

$ cat /boot/extlinux/extlinux.conf

Hopefully, you should have an entry such as …

LABEL JetsonIO
        MENU LABEL Custom 40-pin Header Config
        LINUX /boot/Image
        FDT /boot/tegra210-p3448-0000-p3449-0000-a02-user-custom.dtb
        INITRD /boot/initrd
        APPEND ${cbootargs}

Then hopefully you should see entries such as the following …

$ ls /sys/firmware/devicetree/base/pinmux@700008d4/header-40pin-pinmux/
linux,phandle  name  phandle  pin10  pin19  pin21  pin23  pin24  pin26  pin27  pin28  pin3  pin5  pin8

$ cat /sys/firmware/devicetree/base/pinmux@700008d4/header-40pin-pinmux/pin*/nvidia,function                                                                                                                                
uartbspi1spi1spi1spi1spi1i2c1i2c1i2c2i2c2uartb

And use the CLI for Jetson-IO it should show …

$ sudo /opt/nvidia/jetson-io/config-by-function.py -l enabled
The following functions are enabled on the 40-pin header:
 1. spi1
$ sudo /opt/nvidia/jetson-io/config-by-pin.py                                                                                                                                                                               
 1: 3.3V
 2: 5V
 3: i2c2
 4: 5V
 5: i2c2
 6: GND
 7: unused
 8: uartb
 9: GND
10: uartb
11: unused
12: unused
13: unused
14: GND
15: unused
16: unused
17: 3.3V
18: unused
19: spi1
20: GND
21: spi1
22: unused
23: spi1
24: spi1
25: GND
26: spi1
27: i2c1
28: i2c1
29: unused
30: GND
31: unused
32: unused
33: unused
34: GND
35: unused
36: unused
37: unused
38: unused
39: GND
40: unused

Regards,
Jon

Thank you for your reply.
These are the outputs of your commands:
$ cat /boot/extlinux/extlinux.conf

TIMEOUT 30
DEFAULT JetsonIO

MENU TITLE L4T boot options

LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet

# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
# sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot

# LABEL backup
# MENU LABEL backup kernel
# LINUX /boot/Image.backup
# INITRD /boot/initrd
# APPEND ${cbootargs}

LABEL JetsonIO
MENU LABEL Custom 40-pin Header Config
LINUX /boot/Image
FDT /boot/tegra210-p3448-0000-p3449-0000-a02-user-custom.dtb
INITRD /boot/initrd
APPEND ${cbootargs}

for the second and third commands, there is no header-40pin-pinmux in the folder /sys/firmware/devicetree/base/pinmux@700008d4

and for sudo /opt/nvidia/jetson-io/config-by-function.py -l enabled:
No functions are enabled on the 40-pin header

for the last one sudo /opt/nvidia/jetson-io/config-by-pin.py :

1: 3.3V
2: 5V
3: i2c2
4: 5V
5: i2c2
6: GND
7: unused
8: uartb
9: GND
10: uartb
11: unused
12: unused
13: unused
14: GND
15: unused
16: unused
17: 3.3V
18: unused
19: unused
20: GND
21: unused
22: unused
23: unused
24: unused
25: GND
26: unused
27: i2c1
28: i2c1
29: unused
30: GND
31: unused
32: unused
33: unused
34: GND
35: unused
36: unused
37: unused
38: unused
39: GND
40: unused

Do you think I should comment the LABEL primary? Or maybe during the boot I should get a menu with two options: Primary kernel and Custom 40-pin Header Config. But, I don’t.

You can exchange the context of the primary and jetson-io to try.

I did, but still no functions are enabled on the 40-pin header.

In my Jetson nano there is actually two boot/extlinux/extlinux.config files. One in the SD card and one in a USB. I think JetsonIO modifies the extlinux.config in the USB not the one in the SD card.

This is the content of the extlinux.config file in the SD card:

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

# LABEL primary
#       MENU LABEL primary kernel
#       LINUX /boot/Image
#       INITRD /boot/initrd
#       APPEND ${cbootargs} quiet

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd-xusb.img
      APPEND ${cbootargs} root=UUID=04f2358f-bba5-4056-95ca-fd16376f7b93 rootwait rootfstype=ext4

# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
#      sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot

# LABEL backup
#    MENU LABEL backup kernel
#    LINUX /boot/Image.backup
#    INITRD /boot/initrd
#    APPEND ${cbootargs}

Hello!

Jetson-IO will modify the /boot/extlinux/extlinux.conf that is on the rootfs partition. So if you are mounting the rootfs on the USB drive and not the SD-card then it will modify the on the USB drive. Jetson-IO will not be aware of the one on the SD-card.

Now U-Boot which is parsing the extlinux.conf, I believe looks at the SD card (mmc devices) and the USB drive and so this is probably where it is going wrong.

For testing purposes, can you copy the extlinux.conf and tegra210-p3448-0000-p3449-0000-a02-user-custom.dtb to the SD card and see if this resolves the problem?

How did you flash the rootfs to the USB drive?

Regards,
Jon

Unfortunatly, I’m not the one who flashed the rootfs. And I didn’t get any good explanation from the guy who have done it. Anyways, I changed this in the SD card:

LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd-xusb.img
APPEND ${cbootargs} root=UUID=04f2358f-bba5-4056-95ca-fd16376f7b93 rootwait rootfstype=ext4

to this:

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      FDT /boot/tegra210-p3448-0000-p3449-0000-a02-user-custom.dtb
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet

Eventhough I can’t see the SD card icon anymore :p, but at least the pins are configured to SPI now :D.

Thank you so much for your help :)

I still have one more question if you don’t mind. In the docs it says that the extlinux.config file is configured to display a boot menu to the user for three seconds before booting. But, when I boot the Jetson Nano, I don’t see any boot menu. Why is that?

You need to connect UART console to see the boot message and boot menu.

1 Like

I see. Thank you :)