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.
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:
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.
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
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:
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.
may I know the latest status, did you have the servo rotates but not active with the correct degree?
please share your code snippets for reference, thanks
Yes @JerryChang , because now the GPIO is fine. in fact it passes all pin checks. So the remaining issue is that one of the new topic. To have the motor turn smoothly and well. Thanks.
@JerryChang, yes. In fact sometimes it doesnt rotate but shakes in place. After a while, sometimes tends to rotate close to fine but sometimes totally wrong. below is the code:
import Jetson.GPIO as GPIO
import time
control = [5,5.5,6,6.5,7,7.5,8,8.5, 9, 9.5, 10]
# control = [6.25, 7, 7.5, 8, 8.5]
servo = 33 # connect to pwm pin
GPIO.setmode(GPIO.BOARD)
GPIO.setup(servo, GPIO.OUT)
# in servo motor,
# 1ms pulse for 0 degree (LEFT)
# 1.5ms pulse for 90 degree (MIDDLE)
# 2ms pulse for 180 degree (RIGHT)
# so for 50hz, one frequency is 20ms
# duty cycle for 0 degree = (1/20)*100 = 5%
# duty cycle for 90 degree = (1.5/20)*100 = 7.5%
# duty cycle for 180 degree = (2/20)*100 = 10%
p=GPIO.PWM(servo,50) # 50hz frequency
p.start(2.5) # starting duty cycle ( it set the servo to 0 degree )
try:
while True:
for x in range(len(control)):
p.ChangeDutyCycle(control[x])
time.sleep(0.15)
print control[x]
for x in range(len(control)-1,0,-1):
p.ChangeDutyCycle(control[x])
time.sleep(0.15)
print control[x]
except KeyboardInterrupt:
p.stop()
GPIO.cleanup()