NameError: name 'open' is not defined with Jetson.GPIO on the xavier nx

Hello, here are the results:
:~$ tree -d -L 1
.
├── CarND-Term1P4-Advance_Lane_Detection
├── catkin_ws_sandbox
├── Desktop
├── Documents
├── Downloads
├── jetbot
├── jetson-gpio
├── jetson-inference
├── jetsonUtilities
├── LaneDetection_TuSimple
├── logs
├── miniforge3
├── Music
├── Notebooks
├── Pictures
├── Public
├── Road-Lane-Instance-Segmentation-PyTorch
├── sklearn_tutorial
├── Templates
├── Videos
└── ZEDConfig

21 directories

hello user105768,

this doesn’t look correct.
you’ll need to download SDKManager to set up your development environment. after that, you’ll download/install the JetPack release image to your local x86 host machine, and the installation path is looking like this… ~/nvidia/nvidia_sdk/JetPack_<version>_<platform>/Linux_for_Tegra/

do i install the sdkmanager on the jetson or any other linux machine (say my laptop?)

x86 linux machine, it would be compatible by having native ubuntu OS installed.

ok, but my linux machine is 64 bit. so what do i do now? Also after installing the sdkmanager, how do i proceed on installing jetpack and the like on the jetson from my linux machine?

it supports with 64-bit OS. please check developer guide as see-also. NVIDIA SDK Manager Documentation

ok. by the way, does this reflash the entire jetson? do i need to backup any important documents? or are my files left intact after the process?

hello user105768,

you may skip flashing the board by just download the JetPack release image to your host machine to obtain all the necessary tools, binaries.
you must re-flash the target if you process to modify pinmux spreadsheet, to apply the cfg file settings.
the flashing process will erase the entire storage, be sure to backup your important files.
thanks

well, since the main goal at this moment is to have at least one pwm pin. since most of my other software was based on jetpack 4.5.1 I will use this again. where are the steps in order for me to do this using an external linux pc? I will connect the jetson to the pc, then try to modify pinmux spreadsheet.

@JerryChang how are you? I marked pin 32 and 33 as pwm customer usage and output for direction on the pinmux table in excel, generated the gpio, padvoltage and pinmux dsti files. got two .cfg files using the tool: one .cfg file from the gpio and pinmux dsti files and another .cfg file from the padvoltage .dsti file.
Now what do I do next so that i can flash the jetson with these two files to have pwm configured for the gpio header pins? thanks.

hello user105768,

after you create the cfg file by pinmux-dts2cfg.py, you should perform flash script, flash.sh to update the image.
please also check flash configuration file, p3668.conf.common to confirm those cfg files has included. thanks

hello, which flash.sh script? I am seeing about 4 files ending in flash.sh. Also where do I place my configurations file after creation? Which lines of p3668.conf.common do I modify.
I guess:

PINMUX_CONFIG=“tegra19x-mb1-pinmux-p3668-a01.cfg”;

is for the file generated using pinmux and gpio dsti files, what about the one generated using padvoltage? thanks.

hello user105768,

it’s PMC_CONFIG, normally it should be same as default files.
the flash script is under installation folder, i.e. $OUT/Linux_for_Tegra/, you may also check Basic Flash Script Usage to re-flash the target manually.

oh, so to flashmy jetson with storage on sd card or emmc, I execute the script as:

sudo ./flash.sh p3668.conf.common internal

or is it supposed to be:

sudo ./flash.sh jetson-xavier-nx-devkit internal

This part is not yet clear to me. Thanks

hello user105768,

p3668.conf.common, it’s a common file to define all default configurations.
please use the jetson-xavier-nx-devkit-***.conf to execute the flash process, it depends-on which DevKit storage you’re using.
thanks

I see. There is an autoflash script which apparently figures out the board automatically? Why dont I use that? Whats the difference between the two? It is also in the same directory as the flash.sh. Since i have only one board, can I just run that after connecting my device in recovery mode to the pc? Its name is nvautoflash.sh and has a corresponding REAME file

I have a jetson xavier nx developer kit with an on module SD card.

alright. now it seems to have been flashed successfully. indeed checking with jetson-io.py it shows that pin 33 and 32 are now configured as pwm1 and pwm2, respectively. But i noticed that my jetpack now seems to only be half-installed:

NVIDIA Jetson Xavier NX (Developer Kit Version)
 L4T 32.6.1 [ JetPack 4.6 ]
   Ubuntu 18.04.5 LTS
   Kernel Version: 4.9.253-tegra
 CUDA NOT_INSTALLED
   CUDA Architecture: 7.2
 OpenCV version: NOT_INSTALLED
   OpenCV Cuda: NO
 CUDNN: NOT_INSTALLED
 TensorRT: NOT_INSTALLED
 Vision Works: NOT_INSTALLED
 VPI: NOT_INSTALLED
 Vulcan: 1.2.70

if i install only the uninstalled components using the sdk as before without flashing the os image, will that ruin my current system? I want to retain the current pin configuration. So i can try running my motor code again.

hello user105768,

those JetPack components are able to install online.
please refer to below for reference, thanks

$ sudo apt update
$ sudo vim /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
deb https://repo.download.nvidia.com/jetson/common r32.6 main
deb https://repo.download.nvidia.com/jetson/t194 r32.6 main
$ sudo apt update
$ sudo apt dist-upgrade
$ sudo reboot
$ sudo apt install nvidia-jetpack

hello, I finished the installations as well. Jetson.GPIO library is in place. Still my motor will not turn as expected. I dont know what else to try.