Cross-compiling the samples onto the DRIVE platform

Hardware Platform: DRIVE AGX Pegasus™ Developer Kit
Software Version: DRIVE Software 10
Host Machine Version: Ubuntu 18.04
SDK Manager Version: 1.1.0.6343

Hi,

I am trying to cross compile the samples onto the DRIVE platform, but I get the following error when I execute the “make upload” command as in the tutorial/documentation:

make[3]: sshpass: Command not found
CMakeFiles/upload.dir/build.make:57: recipe for target ‘CMakeFiles/upload’ failed
make[3]: *** [CMakeFiles/upload] Error 127
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/upload.dir/all’ failed
make[2]: *** [CMakeFiles/upload.dir/all] Error 2
CMakeFiles/Makefile2:74: recipe for target ‘CMakeFiles/upload.dir/rule’ failed
make[1]: *** [CMakeFiles/upload.dir/rule] Error 2
Makefile:164: recipe for target ‘upload’ failed
make: *** [upload] Error 2

However, I successfully executed the following commands before executing “make upload”:

cmake -DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=/usr/local/driveworks-2.2/samples/cmake/Toolchain-V5L.cmake \
-DVIBRANTE_PDK:STRING=/home/<…>/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux
/usr/local/driveworks-2.2/samples
make -j
make install

I can’t figure out why I am getting the above error. I would very much appreciate any help or guidance.

Thank you in advance.

Hi @kn10,

please notice in the documentation it mentions that there are several cmake parameters that configure the upload target.
among others is the VIBRANTE_HOST (as mentioned in the documentation: " IP address of the board, the default value is 192.168.0.10 for Xavier A and 192.168.0.11 for Xavier B."

if the IP of your Drive AGX is not 192.168.0.10 (that seems to be the problem) then you should invoke the cmake command with additional debug flag: -DVIBRANTE_HOST=

meaning:
cmake -DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=/usr/local/driveworks-2.2/samples/cmake/Toolchain-V5L.cmake
-DVIBRANTE_PDK:STRING=/home/<…>/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux
-DVIBRANTE_HOST=
/usr/local/driveworks-2.2/samples

and then execute the command make upload.

Hi @shayNV,

thank you very much for your fast reply.

How can I identify the IP address of the Xavier A and Xavier B on the DRIVE platform?

Further, I followed the documentation for the Drive AGX and the only connection I have between the host and the DRIVE platform is the connection via the USB Type A to Type A cable for flashing as mentioned in the DRIVE AGX Developer Kit Hardware Quick Start Guide. Is this connection also used to cross compile the samples and the self-developed code onto the DRIVE platform or am I missing something?

Thank you in advance.

Hi @kn10,

You can follow Accessing the SoC from UART doc to access Xavier A/B and then run ifconfig command to get its IP address.

About cross compilation development, it relies on internet connection between host and target.

Hi @VickNV,

I accessed the Xavier A via Minicom and I then executed the ifconfig command. Several IPs are then listed, but I can not figure out which is the right one from the list.

However, I also accessed the AURIX via Minicom and there it lists a IP for both the Xavier A and Xavier B. Are these the IPs I have to use when cross compiling?

I tried cross compiling it with the IP for the Xavier A listed in the AURIX Minicom terminal, but it still did not work. Am I missing something? How can I find the right IP?

You can get your IP as below:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.31 netmask 255.255.255.0 broadcast 192.168.2.255

I can do automatic upload successfully after running below command. FYI.

$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/driveworks/samples/cmake/Toolchain-V5L.cmake -DVIBRANTE_PDK:STRING=/home/$USER/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux -DVIBRANTE_HOST:STRING=<target IP> /usr/local/driveworks/samples

I now have the IP of eth0 from ifconfig, thanks for helping me here.

Coming back to the error message from my first comment: I basically found out the the error mentioned in the first comment was due to sshpass not being installed. I installed it and run the commands again. Now, I get an other error when running “make upload”:

ssh: connect to host 192.168.0.8 port 22: No route to host
CMakeFiles/upload.dir/build.make:57: recipe for target ‘CMakeFiles/upload’ failed
make[3]: *** [CMakeFiles/upload] Error 255
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/upload.dir/all’ failed
make[2]: *** [CMakeFiles/upload.dir/all] Error 2
CMakeFiles/Makefile2:74: recipe for target ‘CMakeFiles/upload.dir/rule’ failed
make[1]: *** [CMakeFiles/upload.dir/rule] Error 2
Makefile:164: recipe for target ‘upload’ failed
make: *** [upload] Error 2

The first line from the error message (ssh: connect to host 192.168.0.8 port 22: No route to host) indicates that the connection to the DRIVE platform is not set up properly.

How should the ssh connection and the wired connection between the host and the DRIVE platform be set up to make the cross compilation work?

Does Manual Upload mentioned in file:///usr/local/driveworks/doc/nvsdk_html/dwx_samples_building_V5L.html work on your side? If not, please take look at 3.2.1 HSD Connectors for Ethernet in https://developer.nvidia.com/DRIVE/secure/docs/DRIVE_Mech_Inst_Guide_DI-08957-001_v07.pdf. My ethernet cable is connected via ethernet dongle (E3579) to port 5|6 and it work well without any extra setup.

The manual upload from the documentation also does not work. It gives the same error:

ssh: connect to host 192.168.0.8 port 22: No route to host
lost connection

I took a look to the HSD Connectors for Ethernet documentation, but I was not able to find any new information.

I have the following setup:

Ethernet —> Host <—> Type A to Type A USB Cable <—> DRIVE Platform <—> E3579 Dongle <— Ethernet

I connected the E3579 dongle to all ports (1|2, 3|4 and 5|6) and tried it then and it did not work for any. For the ports 1|2 and 5|6, I have a internet connection on the Xavier A.

Did I miss something in the setup? Is the above mentioned setup correct?

Thanks in advance.

Every HSD connector (in Table 3-11. Dual GbE Dongle Ethernet Connection Mapping) with RJ45 channel A/B connection works on my side. Have you plugged a power plug into your Dual GbE dongle? Please also refer to https://developer.nvidia.com/DRIVE/secure/docs/DRIVE_AGX_Developer_Kit_Hardware_Quick_Start_Guide.pdf.

Has internet ever worked on this system before? Could you check if something wrong outside of the system and dongle? Ethernet cable? DHCP server?

Please also check if below topics can help on your case.


Yes, I have plugged a power plug into the Dual GbE dongle and it is blinking. I also connected everything according to https://developer.nvidia.com/DRIVE/secure/docs/DRIVE_AGX_Developer_Kit_Hardware_Quick_Start_Guide.pdf.

Yes, I can access the internet from the AGX platform when an ethernet cable is connected and am also able to ping, for example, google.com etc.

Despite being able to connect to the internet, the light on the Dual GbE dongle is blinking red. Does this mean anything?

Further, the two links you provided me to the other forum topics unfortunately did not help me since I am able to establish an internet connection for the DRIVE AGX, but I am not able to connect the host with the DRIVE AGX.

When I ping the target from the host (or the other way around), I get the following output: Destination Host Unreachable. How can I resolve this issue?

I also tried connecting the host and target directly with each other with an ethernet cable, but I still was not able to ping the target from the host. What could be the reason for this?

Hi @kn10,

This means that there is no way the network has found to access the requested IP.
Is it possible that the Drive is connected to the internet through a separate DNS server then the host computer?
please check if you can try connecting the host computer and the DRIVE AGX to an Ethernet switch and then connect to that switch the cable to the internet connection and check:

  1. does the DRIVE AGX has internet connection?
  2. does the host has internet connection?
  3. please post here the IPs of both, and check does ping command from the host to the DRIVE AGX or the other way around works?

that is called connecting peer to peer, that can work but because there is no DNS server that allocates IPs you would need to assign IPs manually.
So alternatively to the above option, if you want to try that way then after connecting them directly, enter for example the following command on the host terminal (if the interface is called eth0:
sudo ifconfig eth0 10.10.10.1 netmask 255.255.255.0
and on the DRIVE AGX terminal enter the following command:
sudo ifconfig eth0 10.10.10.2 netmask 255.255.255.0

then ping and ssh would work (from host to ip 10.10.10.2 and from DRIVE AGX to ip 10.10.10.1)

When I enter “systemd-resolve --status” on both the host and target, I can see that they are both connected to the same DNS servers.

I connected the host and the target both to a ethernet switch and connected the switch to the internet. The following are the answers to the three questions:

  1. Yes, the DRIVE AGX has an internet connection (I can ping google.com, for example).
  2. Yes, the host has an internet connection
  3. The IP of the host is
    enp109s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.0.6 netmask 255.255.255.0 broadcast 192.168.0.255
    and the IP of the target is
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.0.8 netmask 255.255.255.0 broadcast 192.168.0.255
    When I try to ping the target from the host, I still get Destination Host Unreachable. When I try to ping the host from the target, I get the same.

However, I managed to setup a direct ethernet connection between host and target with the ifconfig terminal commands from the previous comment. I can now successfully ping the devices and also cross compile the samples. Everything works now!

Thank you very much for your help!