I am trying to run multi-flash by double-clicking the shortcut icon on the desktop on the Ubuntu host pc

Hello,

I am trying to run multi-flash by double-clicking the shortcut icon on the desktop on the Ubuntu host pc.

I tried to create a .desktop file under the /usr/share/applications folder as follows, but

It is difficult to run the sudo ./nvmflash command.

Does anyone know how?

ex) untitiled.desktop in /usr/share/applications

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=Program Name
Icon=Program Icon

Thank you.

hello Hodu,

may I know what’s your actual use-case? why don’t you use the command-line to execute the command?
if you would like to have single execute file to perform the function, why don’t you write a simple script file to run the same as your commands?

1 Like

Hello,

I am trying to transfer the equipment production process using jetson nano to the production team.
The production team asked me to make a shortcut icon for easy use instead of a command, so I’m working on it.

Thank you.

hello Hodu,

the process should be already simple enough, you should only deliver the massflash blob to the factory environment.
they have only need to extract the package, and running $ sudo ./nvmflash.sh to flash the targets.
if that’s helps,
you can create the script file to include the command, $ sudo ./nvmflash.sh, and please modify the file as executable file, i.e. $ sudo chmod +x script.sh,
once it’s executable file, double click will doing the same as the commands,
thanks

1 Like

Hello,

When you multiflash, you check whether jetson has entered force recovery mode with the lsusb command, right?
Bus Device : ID 0955: Nvidia Corp.

When flashing 4 jetsons, there must be 4 above messages, right?

When checking with the lsusb command, you have to read it with your own eyes.
Is there any convenient way to check this?

Do you have any plans to support mass flashing in the sdk manager?

Thank you.

You could create a bash script to run nvmflash.sh, but the sudo part might make some of this “non-obvious”. You could also create a script which does nothing more than tell you how many lsusb replies are for your hardware.

FYI, the “lsusb -d '0955:'” checks all NVIDIA devices, but if you were to check for a nano (a dev kit, not sure if you have something different), is “lsusb -d '0955:7020'”. If you are familiar with the “word count” utility ("wc" command line), then examine that if you have four lines from “lsusb -d '0955:7020'”, and pipe it to wc:

lsusb -d '0955:7020' | wc'

…then the occurrence of one line would show three numbers, and the first is the number of lines. If you want four occurrences, then the number should be “4”. This is more suited to command line, but you could incorporate this into an icon if the icon is set to run in a shell and keep the shell open after running. That same shell could be set to run nvmflash.sh if the correct number is seen.

Alternatively, you could create a custom version of nvmflash.sh (I’d keep the original, and maybe create “custom_nvmflash.sh” in the same directory) to stat the number of found units and proceed if correct.

The real issue with scripting is that it isn’t designed for a GUI popup. You can easily create a script which says “this number of Jetson Nanos are found in recovery mode”, but it isn’t a convenient GUI popup. There are a lot of small notification apps one can use to create a GUI popup. This URL has a discussion of a number of applications for this, the one of which I like is “zenity” (uses GTK+ dialog), and one which is very primitive is “xmessage”:
https://stackoverflow.com/questions/7035/how-to-show-a-gui-message-box-from-a-bash-script-in-linux

If you use a custom script which uses something like zenity in place of stdout echoes, then it would look very simple and clean to the person clicking the icon. An example from the URL above, modified slightly, and not yet refined (but put on multiple lines for clarity), looking only at the first lsusb and not caring if it is a Jetson:

zenity \
--info \
--text="<span size=\"large\">First lsusb is \n$(lsusb | head -n 1).\
</span>\n\nCommand line count is \
<b>$(lsusb | head -n 1 | wc | sed -E 's/^[[:space:]]+//g' | cut -d' ' -f1)</b>\
." \
--title="lsusb results" \
--ok-label="Ok" --width=1070

Slightly simplified in terms of programming by means of environment variables, but still the same command:

LISTINGS="$(lsusb | head -n 1)" \
LCOUNT="$(echo ${LISTINGS} | wc | sed -E 's/^[[:space:]]+//g' | cut -d' ' -f1)" \
zenity \
--info \
--text="<span size=\"large\">First lsusb is \n${LISTINGS}.\
</span>\n\nCommand line count is \
<b>${LCOUNT}</b>\
." \
--title="lsusb results" \
--ok-label="Ok" --width=1070

Turning this into a list of all lsusb results with a given vendor ID and device ID instead of a single line of lsusb, where “0955:” is everything NVIDIA, and “7020” is a Nano (be careful that this may not distinguish recovery mode versus just a Nano emulating a network device):

VENDOR='0955:';\
DEVICE='7020';\
IFS=$'\n' read -r -d '' -a LISTINGS < <( lsusb -d ${VENDOR}${DEVICE} && printf '\0' );\
USBCOUNT=${#LISTINGS[@]};\
zenity \
--info \
--text="<span size=\"large\">lsusb for device\n${VENDOR}${DEVICE}.\
</span>\n\nlsusb line count is \
<b>${USBCOUNT}</b>\
." \
--title="lsusb results" \
--ok-label="Ok" --width=1070

The above could easily be modified to verify the right number of Jetsons, and then to run a flash command.

1 Like

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