SPE gpio example and Jetson NX devkit questions

Hi,

I’ve been working to get the SPE gpio-app example working at Jetson NX development kit.

I managed to build SPE fw and flash it with gpio settings as instructed. Currently I’ve setup where I can see on the oscilloscope how example code toggles every 3 seconds the pin 15 on boards 40pin J12 header. However I don’t see any message “GPIO input irq triggered” anywhere when I short pin 15 to 27. Also pin 27 is always high on 3v3 even though it’s configured as pull-down input as far I understand.

Could I get clarification on the following items please?

  1. What version of tegra194-mb1… cfg files I must edit? The ones in bootloader/… or in bootloader/t186/BCT/.
  2. Why guide tells me to ‘Compile device tree’ when there are no changes to device tree? The cfg files are only used by flash.sh during flashing process as far as I understand. Kernel building is a completely separate process.
  3. Why pin 27 on 40-pin header stays high even when it’s configured as pull-down as per example. Could there be a mistake in the steps?
  4. Where the message “GPIO input irq triggered” would be shown?

Thank you!

Hello, teemu1:

  1. What version of tegra194-mb1… cfg files I must edit? The ones in bootloader/… or in bootloader/t186/BCT/.
    ./bootloader/t186ref/BCT/tegra194-mb1-bct-scr-cbb-mini-p3668.cfg is the right one to edit. You can notice that some files in folder bootloader are generated during flash procedure, and you should edit the original source.
  2. Why guide tells me to ‘Compile device tree’ when there are no changes to device tree? The cfg files are only used by flash.sh during flashing process as far as I understand. Kernel building is a completely separate process.
    You can just edit corresponding files, and re-flash the device with those changes. the ‘device tree’ here does not mean kernel device tree, (By default the GPIOs in this demo are free in kernel side. If you have used those pins, please correct them to avoid confliction.) and other bootloader components have their own device-tree files. During flash procedure, the device tree files will be re-generated, and re-flashed.
  3. Why pin 27 on 40-pin header stays high even when it’s configured as pull-down as per example. Could there be a mistake in the steps?
    Pin 27 should be configured as an input pin. Have you ever checked the pin configurations and make sure it works well? You can also check the pin configurations by reading register directly. (Jetson/L4T BSP development tips - eLinux.org)
  4. Where the message “GPIO input irq triggered” would be shown?
    If everything’s good, you should see that log from console. Refer to GitHub - NVIDIA/python-jetson: Python utilities for NVIDIA Jetson for console demux tool.

For your issues, some possible reasons:

  1. If you can see the output pin toggles, that means the output GPIO works well.
  2. Please check whether the input pin configuration is good, including SCR, interrupt mapping, and pinmux.
  3. Make sure the correct pins are shorted.
  4. Make sure you can see the default SPE firmware log.

br
Chenjian

Hi, thank you for the detailed response.

I verified that the pin configuration is correct but the pin27 still has a pull-up. Pin is marked as I2C SDA pin for I2C bus 1, maybe kernel is still accessing the pin and enabling pull-up somewhere else? I guess I do not really understand yet how mapping between SPE MCU pins to Xavier pins works and what layers and reroutes it involves.

ubuntu@jetsonnx:~$ sudo devmem2 0x0c302040
/dev/mem opened.
Memory mapped at address 0x7fb5290000.
Value at address 0xC302040 (0x7fb5290040): 0x75

How could I see default SPE firmware log? What is the ‘console’ in this context?
I took a look earlier into python-jetson and could not never get anything out of it. It seems to support only AGX anyway.
For example.

ubuntu@jetsonnx:~/python-jetson-master$ ls /dev/tty*
/dev/tty    /dev/tty21  /dev/tty35  /dev/tty49  /dev/tty62   /dev/ttyp9
/dev/tty0   /dev/tty22  /dev/tty36  /dev/tty5   /dev/tty63   /dev/ttypa
/dev/tty1   /dev/tty23  /dev/tty37  /dev/tty50  /dev/tty7    /dev/ttypb
/dev/tty10  /dev/tty24  /dev/tty38  /dev/tty51  /dev/tty8    /dev/ttypc
/dev/tty11  /dev/tty25  /dev/tty39  /dev/tty52  /dev/tty9    /dev/ttypd
/dev/tty12  /dev/tty26  /dev/tty4   /dev/tty53  /dev/ttyGS0  /dev/ttype
/dev/tty13  /dev/tty27  /dev/tty40  /dev/tty54  /dev/ttyp0   /dev/ttypf
/dev/tty14  /dev/tty28  /dev/tty41  /dev/tty55  /dev/ttyp1   /dev/ttyS0
/dev/tty15  /dev/tty29  /dev/tty42  /dev/tty56  /dev/ttyp2   /dev/ttyS1
/dev/tty16  /dev/tty3   /dev/tty43  /dev/tty57  /dev/ttyp3   /dev/ttyS2
/dev/tty17  /dev/tty30  /dev/tty44  /dev/tty58  /dev/ttyp4   /dev/ttyS3
/dev/tty18  /dev/tty31  /dev/tty45  /dev/tty59  /dev/ttyp5   /dev/ttyTCU0
/dev/tty19  /dev/tty32  /dev/tty46  /dev/tty6   /dev/ttyp6   /dev/ttyTHS0
/dev/tty2   /dev/tty33  /dev/tty47  /dev/tty60  /dev/ttyp7   /dev/ttyTHS1
/dev/tty20  /dev/tty34  /dev/tty48  /dev/tty61  /dev/ttyp8   /dev/ttyTHS4
ubuntu@jetsonnx:~/python-jetson-master$ sudo bin/jetson-demux -d /dev/ttyTCU0
[sudo] password for ubuntu:
RCE:    /dev/pts/4
BPMP:   /dev/pts/5
SCE:    /dev/pts/6
SPE:    /dev/pts/7
TZ:     /dev/pts/8
CCPLEX: /dev/pts/9

How I’ve tried to read the SPE terminal.

ubuntu@jetsonnx:~/python-jetson-master$ ls -l /dev/pts/*
crw------- 1 ubuntu tty  136, 0 huhti  7 11:31 /dev/pts/0
crw--w---- 1 ubuntu tty  136, 1 huhti  7 11:29 /dev/pts/1
crw--w---- 1 ubuntu tty  136, 2 huhti  7 11:31 /dev/pts/2
crw--w---- 1 ubuntu tty  136, 3 huhti  7 11:31 /dev/pts/3
crw--w---- 1 root  tty  136, 4 huhti  7 11:31 /dev/pts/4
crw--w---- 1 root  tty  136, 5 huhti  7 11:31 /dev/pts/5
crw--w---- 1 root  tty  136, 6 huhti  7 11:31 /dev/pts/6
crw--w---- 1 root  tty  136, 7 huhti  7 11:31 /dev/pts/7
crw--w---- 1 root  tty  136, 8 huhti  7 11:31 /dev/pts/8
crw--w---- 1 root  tty  136, 9 huhti  7 11:31 /dev/pts/9
c--------- 1 root  root   5, 2 joulu 10 11:15 /dev/pts/ptmx
ubuntu@jetsonnx:~/python-jetson-master$ sudo screen /dev/pts/7

Never seen any activity here.

Hi, on the AGX you have to connect a micro usb cable between host computer and AGX in order to get ttyUSB0,1,2 and 3 (
this might be different if you have some other ttyUSB’s already. ). You should then run “sudo jetson-demux -d /dev/ttyUSB3” in order to get the output working on /dev/pts/x.
However im not sure if that is the case on the NX.

Hello, teemu1:
The pinmux looks good. I’m not sure whether that pin has external pull-up.

For UART port, in NX, please connect a USB-UART dongle with TX/RX/GND to corresponding pins in devkit.

That should work if you follow the instructions strictly, without any extra change.

br
ChenJian

Hi,
Jetson_Xavier_NX_Pinmux_Configuration_Template_v1.06 spreadsheet tells that the pin 27 has external 2k2 pull-up, this explains what I’m seeing.
I’ll try to get the log with a UART-USB dongle.

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