Crash jetson-io.py

  • Problem

Hello.
I’m not good at English so some parts may be difficult to understand.
I apologize in advance.
I’m trying to run a DC motor on a Jetson AGX Xvier.
However, I wanted to check the jetson-io config as there are no pin outputs.

When I use the command below it crashes instantly.

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

Please tell me how I should deal with this.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

  • Coping strategies already tried
    1.Prerequisite
$ sudo apt update
$ sudo apt upgrade
$ sudo reboot

  1. Editing Source Code 1

#dtbdir = os.path.join(self.bootdir, ‘dtb’)
dtbdir = os.path.join(self.bootdir, ‘’)

$ sudo reboot

  1. Editing Source Code 2 (After try “Editing Source Code 1”)

dtbdir = os.path.join(self.bootdir, ‘dtb’)
# dtbdir = os.path.join(self.bootdir, ‘’)

$ sudo reboot

  1. Rename .dtb file
$ sudo /opt/nvidia/jetson-io/config-by-pin.py

Traceback (most recent call last):
File “/opt/nvidia/jetson-io/config-by-pin.py”, line 84, in
main()
File “/opt/nvidia/jetson-io/config-by-pin.py”, line 39, in main
jetson = board.Board()
File “/opt/nvidia/jetson-io/Jetson/board.py”, line 223, in init
self.dtb = _board_get_dtb(self.compat, self.model, dtbdir)
File “/opt/nvidia/jetson-io/Jetson/board.py”, line 116, in _board_get_dtb
raise RuntimeError(“Multiple DTBs found for %s!” % model)
RuntimeError: Multiple DTBs found for Jetson-AGX!

$ ls /boot/dtb

kernel_tegra194-p2888-0001-p2822-0000-user-custom.dtb
kernel_tegra194-p2888-0001-p2822-0000.dtb.bkp
kernel_tegra194-p2888-0001-p2822-0000.dtb.sig
tegra186-p3636-0001-p3509-0000-a01-adafruit-sph0645lm4h.dtbo
tegra186-p3636-0001-p3509-0000-a01-adafruit-uda1334a.dtbo
tegra186-p3636-0001-p3509-0000-a01-fe-pi-audio.dtbo
tegra186-p3636-0001-p3509-0000-a01-hdr40.dtbo
tegra186-p3636-0001-p3509-0000-a01-m2ke.dtbo
tegra186-p3636-0001-p3509-0000-a01-respeaker-4-mic-array.dtbo
tegra186-p3636-0001-p3509-0000-a01-respeaker-4-mic-lin-array.dtbo
tegra186-p3636-0001-p3509-0000-a01.dtb
tegra186-quill-p3310-1000-a00-00-base.dtb
tegra186-quill-p3310-1000-as-0888.dtb
tegra186-quill-p3310-1000-c03-00-base-adafruit-sph0645lm4h.dtbo
tegra186-quill-p3310-1000-c03-00-base-adafruit-uda1334a.dtbo
tegra186-quill-p3310-1000-c03-00-base-csi.dtbo
tegra186-quill-p3310-1000-c03-00-base-fe-pi-audio.dtbo
tegra186-quill-p3310-1000-c03-00-base-hdr30.dtbo
tegra186-quill-p3310-1000-c03-00-base-hdr40.dtbo
tegra186-quill-p3310-1000-c03-00-base-m2ke.dtbo
tegra186-quill-p3310-1000-c03-00-base-respeaker-4-mic-array.dtbo
tegra186-quill-p3310-1000-c03-00-base-respeaker-4-mic-lin-array.dtbo
tegra186-quill-p3310-1000-c03-00-base.dtb
tegra186-quill-p3310-1000-c03-00-dsi-hdmi-dp.dtb
tegra186-quill-p3489-0888-a00-00-base.dtb
tegra186-quill-p3489-1000-a00-00-ucm1.dtb
tegra186-quill-p3489-1000-a00-00-ucm2.dtb
tegra194-p2888-0001-p2822-0000-adafruit-sph0645lm4h.dtbo
tegra194-p2888-0001-p2822-0000-adafruit-uda1334a.dtbo
tegra194-p2888-0001-p2822-0000-csi.dtbo
tegra194-p2888-0001-p2822-0000-fe-pi-audio.dtbo
tegra194-p2888-0001-p2822-0000-hdr40.dtbo
tegra194-p2888-0001-p2822-0000-m2ke.dtbo
tegra194-p2888-0001-p2822-0000-maxn.dtb
tegra194-p2888-0001-p2822-0000-maxn.dtb.sig
tegra194-p2888-0001-p2822-0000-respeaker-4-mic-array.dtbo
tegra194-p2888-0001-p2822-0000-respeaker-4-mic-lin-array.dtbo
tegra194-p2888-0001-p2822-0000.dtb
tegra194-p2888-0001-p2822-0000.dtb.sig
tegra194-p2888-0004-e3900-0000-adafruit-sph0645lm4h.dtbo
tegra194-p2888-0004-e3900-0000-adafruit-uda1334a.dtbo
tegra194-p2888-0004-e3900-0000-csi.dtbo
tegra194-p2888-0004-e3900-0000-dual-imx274.dtbo
tegra194-p2888-0004-e3900-0000-fe-pi-audio.dtbo
tegra194-p2888-0004-e3900-0000-hdr40.dtbo
tegra194-p2888-0004-e3900-0000-imx274.dtbo
tegra194-p2888-0004-e3900-0000-respeaker-4-mic-array.dtbo
tegra194-p2888-0004-e3900-0000-respeaker-4-mic-lin-array.dtbo
tegra194-p2888-0004-e3900-0000.dtb
tegra194-p2888-0004-e3900-0000.dtb.sig
tegra194-p2888-0008-p2822-0000.dtb
tegra194-p2888-0008-p2822-0000.dtb.sig
tegra194-p3668-all-p3509-0000-adafruit-sph0645lm4h.dtbo
tegra194-p3668-all-p3509-0000-adafruit-uda1334a.dtbo
tegra194-p3668-all-p3509-0000-camera-imx219-dual.dtbo
tegra194-p3668-all-p3509-0000-camera-imx477-dual.dtbo
tegra194-p3668-all-p3509-0000-camera-imx477-imx219.dtbo
tegra194-p3668-all-p3509-0000-fe-pi-audio.dtbo
tegra194-p3668-all-p3509-0000-hdr40.dtbo
tegra194-p3668-all-p3509-0000-m2ke.dtbo
tegra194-p3668-all-p3509-0000-respeaker-4-mic-array.dtbo
tegra194-p3668-all-p3509-0000-respeaker-4-mic-lin-array.dtbo
tegra194-p3668-all-p3509-0000.dtb
tegra194-p3668-all-p3509-0000.dtb.sig

$ sudo mv kernel_tegra194-p2888-0001-p2822-0000.dtb kernel_tegra194-p2888-0001-p2822-0000.dtb.bkp

  1. Manual parameter setting error
$ sudo /opt/nvidia/jetson-io/config-by-pin.py -p 5

Traceback (most recent call last):
File “/opt/nvidia/jetson-io/config-by-pin.py”, line 84, in
main()
File “/opt/nvidia/jetson-io/config-by-pin.py”, line 39, in main
jetson = board.Board()
File “/opt/nvidia/jetson-io/Jetson/board.py”, line 223, in init
self.dtb = _board_get_dtb(self.compat, self.model, dtbdir)
File “/opt/nvidia/jetson-io/Jetson/board.py”, line 116, in _board_get_dtb
raise RuntimeError(“Multiple DTBs found for %s!” % model)
RuntimeError: Multiple DTBs found for Jetson-AGX!

$ sudo mkdir -p /boot/dtb
$ ls /boot/*.dtb | xargs -I{} sudo ln -s {} /boot/dtb/

  1. A01 board(?)
$ sudo cp -v /boot/tegra186-p3636-0001-p3509-0000-[ab]0[012].dtb /boot/dtb/

‘/boot/tegra186-p3636-0001-p3509-0000-a01.dtb’ → ‘/boot/dtb/tegra186-p3636-0001-p3509-0000-a01.dtb’

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

  • Other Information
  1. Xavier version
$ cat /etc/nv_tegra_release

.# R32 (release), REVISION: 7.2, GCID: 30192233, BOARD: t186ref, EABI: aarch64, DATE: Sun Apr 17 09:53:50 UTC 2022


  1. Jetpack version
$ sudo apt show nvidia-jetpack

Package: nvidia-jetpack
Version: 4.6.2-b5
Priority: standard
Section: metapackages
Maintainer: NVIDIA Corporation
Installed-Size: 199 kB
Depends: nvidia-cuda (= 4.6.2-b5), nvidia-opencv (= 4.6.2-b5), nvidia-cudnn8 (= 4.6.2-b5), nvidia-tensorrt (= 4.6.2-b5), nvidia-visionworks (= 4.6.2-b5), nvidia-container (= 4.6.2-b5), nvidia-vpi (= 4.6.2-b5), nvidia-l4t-jetson-multimedia-api (>> 32.7-0), nvidia-l4t-jetson-multimedia-api (<< 32.8-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 29.4 kB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.7/main arm64 Packages
Description: NVIDIA Jetpack Meta Package
N: 追加レコードが 1 件あります。表示するには ‘-a’ スイッチを付けてください。


  1. Boot config(?)
$ cat /etc/nv_boot_control.conf

TNSPEC 2888-400-0004-G.0-1-2-jetson-xavier-mmcblk0p1
COMPATIBLE_SPEC 2888-400-0004–1-2-jetson-agx-xavier-devkit-
TEGRA_CHIPID 0x19
TEGRA_OTA_BOOT_DEVICE /dev/mmcblk0boot0
TEGRA_OTA_GPT_DEVICE /dev/mmcblk0boot1

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

  • References
  1. jetson-io.pyがすぐに終了するときの解決策
  2. Jetson‑IOがすごく良かった話とエラー対処方法
  3. Jetson-io crashing on startup
  4. Looks like you have an A01 board. Please try the following …

hello asuka.za,

first, it looks you’re using incorrect device tree blob. you should keep using tegra194-p2888-0001-p2822-0000.dtb for AGX Xavier.

may I know what’s your actual use-case? also, is this a Jetson AGX Xavier Developer Kit?

Thank you for your reply.

I should keep using tegra194-p2888-0001-p2822-0000.dtb,ok.

What is “actual use-case”?
I need to pwm output to run a dc motor.
So I would like to change the pin settings to allow pwm output.
Is my answer what you want?
Yes, this is a Jetson AGX Xavier Developer Kit.

hello asuka.za,

here’s an example to configure J30, 40-pin expansion header, pin-13; PWM01 / SOC_GPIO44

  • Step-1 Modify pinmux spreadsheets to toggle the pin as GP_PWM8 / Output / Int PD
  • Step-2 Create the pinmux configuration
    $ python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt --mandatory_pinmux_file mandatory_pinmux.txt tegra19x-jetson_agx_xavier-pinmux.dtsi tegra19x-jetson_agx_xavier-gpio-default.dtsi 1.0 > tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg
  • Step-3 Replace the cfg file, and re-flash the target without "-r" options
    $OUT/Linux_for_Tegra/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg

Thank you for your reply.

Thank you for your kind attention to the means.
I don’t have a Jetson near me right now.
I will come back to share the results of the execution.

I need advice on “Step-1 Modify pinmux spreadsheets”

Does this mean editing the dtb file?
If so, should I edit “tegra194-p2888-0001-p2822-0000.dtb”?

hello asuka.za,

you’ll need to access pinmux spreadsheets via download center.
please see-also developer guide for the instructions of Pinmux Changes.

Thank you for your reply.

I totally understood it.
By the way, I am told that I cannot open “pinmux-dts2cfg.py”. Do I need to set the PATH?

$ cd download
$ python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt --mandatory_pinmux_file mandatory_pinmux.txt tegra19x-jetson_agx_xavier-pinmux.dtsi tegra19x-jetson_agx_xavier-gpio-default.dtsi 1.0 > tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg

python: can’t open file ‘pinmux-dts2cfg.py’: [Errno 2] No such file or directory

Perhaps I need to run this program on the host PC?
I can’t find “pinmux-dts2cfg.py” or even “Linux_for_Tegra” in Jetson.
Or do I need to download “Linux_for_Tegra” to Jetson?

hello asuka.za,

yes, you should copy those generated dtsi files to your host machine,
after that, please go to Jetpack installation path, then you should see python script file.
for example,
~/nvidia/nvidia_sdk/JetPack_<version>_Linux_<platform>/Linux_for_Tegra/kernel/pinmux/t19x/pinmux-dts2cfg.py

note,
you should remove --mandatory_pinmux_file option to avoid the errors.
mandatory_pinmux.txt it’s an information for PinMux configuration for the bring-up process.
the mandatory (must have) configurations will be like hardcoded, such that mandatory configurations cannot be changed.
for example, this mandatory configurations used specific for IOs in PinMux configurations, such as I2C SCL/SDA pins should be in input enable mode.

after the cfg file has generated,
please update the cfg file and doing full flash to update the configuation.
thanks

Thank you for your reply.

I ran the command shown below with the options removed.

$ python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt tegra19x-jetson_agx_xavier-pinmux.dtsi tegra19x-jetson_agx_xavier-gpio-default.dtsi 1.0 > tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg

The cfg file was generated without any errors.
In other words, it worked up to step 2.
But, step 3 is not working.
Are you saying that I should replace the generated cfg file with the one in the location shown below?

~/nvidia/nvidia_sdk/JetPack_Linux/Linux_for_Tegra/bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg

And how can I do “full flash”?
Do I connect Jetson to the host PC?
If I do a full flash, will I lose my Jetson data (catkin files, etc.)?

hello asuka.za,

yes, you may replace the generated cfg file with the default one.
you’ll need to perform full image flash in order to update configuration, this will erase APP partition which contain your user-space data.

Thank you for your reply.

Is it correct that “full image flash” means rewriting jetpack using the SDK Manager?

It would be a shame to lose the data, so I will make a backup.

I did a full flash but cannot change the pin settings.
And for some reason pin 22 is disabled.


As a result, nothing could be resolved.

hello asuka.za,

pin-22 / GPIO17 is by default as… GPIO3_PQ.01. it’s gpio-436 for this pin.

# cat /sys/kernel/debug/gpio | grep PQ.01
 gpio-436 (PQ.01    

you’re able to enable GPIOs manually
for example,
# echo 436 > /sys/class/gpio/export
# cd /sys/class/gpio/PQ.01
# echo out > direction && echo 1 > value

Thank you for your reply.

$ cat /sys/kernel/debug/gpio | grep PQ.01

cat: /sys/kernel/debug/gpio: 許可がありません

$ sudo cat /sys/kernel/debug/gpio | grep PQ.01

(There was no output of any kind.)

$ echo 436 > /sys/class/gpio/export
$ cd /sys/class/gpio/PQ.01

bash: cd: /sys/class/gpio/PQ.01: そのようなファイルやディレクトリはありません

I was referring to this site and there is a difference between it and the pin number you mention.
Where can i check the correct pin number?

hello asuka.za,

you’ll need root permission to execute this command.

FYI,
there shows different GPIO numbers (due to allocation range changes) after kernel-5.10.
if you’re using kernel-4.9, please refer to developer guide To check the GPIO number.
if you’re using kernel-5.10, you should refer to To check the GPIO number session.
thanks

Thank you for your reply.

I understood that I needed root privileges.
So I tried again with the sudo command, but did not get any output.

Thanks for the pin info.

hello asuka.za,

it’ll create nodes, but naming were different. may I double confirm your l4t release version?
for example, if you’re using JP-4.x, it will be gpio436 with above commands.

Thank you for your reply.

Is this the information you seek?

$ sudo apt show nvidia-jetpack

Package: nvidia-jetpack
Version: 4.6.2-b5
Priority: standard
Section: metapackages
Maintainer: NVIDIA Corporation
Installed-Size: 199 kB
Depends: nvidia-cuda (= 4.6.2-b5), nvidia-opencv (= 4.6.2-b5), nvidia-cudnn8 (= 4.6.2-b5), nvidia-tensorrt (= 4.6.2-b5), nvidia-visionworks (= 4.6.2-b5), nvidia-container (= 4.6.2-b5), nvidia-vpi (= 4.6.2-b5), nvidia-l4t-jetson-multimedia-api (>> 32.7-0), nvidia-l4t-jetson-multimedia-api (<< 32.8-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 29.4 kB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.7/main arm64 Packages
Description: NVIDIA Jetpack Meta Package

N: 追加レコードが 1 件あります。表示するには ‘-a’ スイッチを付けてください。