Best way for remote debugging on jetson

Hello,

I try to figure out what’s the best way to do remote debugging on jetson target.
First of all some background: we are afriad that the chip will be weak to do all debugging on target, so we want to use remote debugging.

Is it best to do it by using the same OS in a HOST and do the same installations on host,for example prepare install both host and target with ubuntu 18.04 and make the exact installations on both (for example same installation instruction for qt,gstreamer, etc (using exact same apt-get ) etc. ?

Alternative: using any OS in HOST, and copy files in /lib and /include into host’s sysroot and using cross compile in host after installations.

Does both alternatives make sense ? What’s best ?

Thanks,
ranran

Mostly I just use gdb directly on the host. I prefer the cgdb front end (it is still gdb, but a custom text interface which runs in console or gui and makes gdb more convenient).

Something like the nsight edition of eclipse runs remotely from an Ubuntu host, and is probably more like what you are thinking (this is described in the official documentation which comes with the release you run). Eclipse is a bit heavy, and although it would work reasonably well from an Xavier it would be a bit intense on a TX2. The nsight edition (specific to Jetsons) is meant to run on a regular desktop PC with Ubuntu.

You can do remote debugging for other code, but as you mention for some cases you must put the environment on your host first (a loopback mounted clone works nicely for that). I tend to only do this with kgdb/kgdboc kernel debugging (which conveniently doesn’t need the user space libraries, but it does have other setup…something you wouldn’t have to worry about in user space).

Hi,

One more if I may:
You mentioned kernel remote debugging.
It’s something that I am also very intereseted in doing but was not sure how to:

Is it that you actually use remote PC connected to serial ? Do you than use loopback mount for this ? If you have any tutorial or something a like can you please share ?

Thanks!

This uses a combination of serial console and ethernet. The topic is “kgdb” and “kgdboc”. It requires a kernel image on the host PC, and some setup information from “/proc” or “/sys” (basically memory location information).

There is a thread on this for the Xavier, and Xavier is the same architecture as a TX2:
https://devtalk.nvidia.com/default/topic/1043341/jetson-agx-xavier/need-help-in-getting-kgdb-to-work/post/5294400/#5294400

The official documents actually have something on this. After unpacking the docs for your release version look for file “nvl4t_docs/Tegra Linux Driver Package Development Guide/debugging_kgdb.html” and point a web browser at it. This provides kgdb information.

Here are some additional URLs, but some are old and there are architectural differences which can matter, e.g., memory may not be organized the same in a PC and a TX2, although mostly what you read will be an exact match:
https://elinux.org/Kgdb
https://sourceforge.net/projects/kgdb/?source=directory
https://kgdb.wiki.kernel.org/index.php/Main_Page
https://mirrors.edge.kernel.org/pub/linux/kernel/people/jwessel/kdb/
https://kgdb.wiki.kernel.org/index.php/KDB_FAQ
https://mirrors.edge.kernel.org/pub/linux/kernel/people/jwessel/kdb/kgdbKernelArgs.html
https://mirrors.edge.kernel.org/pub/linux/kernel/people/jwessel/kdb/usingKDB.html
http://www.sourceware.org/gdb/current/onlinedocs/gdb.html
http://landley.net/kdocs/Documentation/DocBook/xhtml-nochunks/kgdb.html
https://blackfin.uclinux.org/doku.php?id=linux-kernel:debug:kgdb

Note that there is essentially a shell the serial console can drop into, and then kgdboc can be used from the host. It is a steep learning curve, but once you set up scripts for gathering memory locations it becomes much easier.