NVIDIA Tegra
NVIDIA DRIVE 5.0 Linux SDK

Development Guide
5.0.10.3 Release


 
Tegra-AURIX Communication on DRIVE PX 2
 
Library Usage and Configuration
Modifying the Tegra to AURIX Default IP Address Settings for Ethernet Interface
SPI Transport and Time Synchronization Protocol Using Loopback Interface
TACP Sample Application Usage
This topic describes the Tegra AURIX communication abstraction library layer used in the NVIDIA DRIVE PX 2 platform to send and receive NVIDIA defined commands.
Warning:
Consult the Release Notes before making any changes to the default configuration of the DRIVE PX 2 platform.
Consult the Release Notes for setup instructions and limitations of multiple DRIVE PX 2 systems connected back-to-back.
Tegra AURIX communication is required for the following control functions on DRIVE PX 2. Connectivity of the communication is over Loopback + SPI or Ethernet.
Camera power control
HDMI MUX control only for (P2379) AutoChauffeur
PCI MUX control only for (P2379) AutoChauffeur
Display MUX control only for (P2379) AutoChauffeur
On DRIVE PX 2, Tegra AURIX communication supports TACP (Tegra-AURIX communication protocol) using the generic shared library libtacp.so. The library layer exports a set of API to communicate with the remote AURIX MCU. Consequently, to interact with the remote MCU applications must include this library and must send commands using the exported APIs. Consult the following diagram to understand the functionality structure.
Ethernet interface for P2379
Loopback interface with spi_tp for P3407
C:\Users\hyongbink\Desktop\ACR.png
For details on the exported data structure, see the Tegra AURIX Communication Protocol API in API Modules.
Note:
The following APIs are supported. The other APIs are TBD.
tacp_set_cam_pwr_on
tacp_set_cam_pwr_off
tacp_get_cam_pwr_status
Library Usage and Configuration
The default configuration file tacp.cfg is provided in the root file system at:
/etc/tacp/
This configuration file is used by libtacp.so to obtain the required parameters such as:
Remote MCU IP
Tegra IP
Receive timeout values
Model and interface information etc.
The following are the supported parameters in the configuration file:
AURIX_IP_ADDRESS=<ip address>
TEGRA_A_IP_ADDRESS=<ip address>
TEGRA_B_IP_ADDRESS=<ip address>
TEGRA_IP_ADDRESS=<ip address>
AURIX_SERVER_PORT=<server port>
model=<interface>
RECEIVE_TIMEOUT_S=<value>
RECEIVE_TIMEOUT_US=<value>
Where:
<interface> must be VLAN interface eth0.200 or lo .
Note:
All Tegra-AURIX communication moved from virtual Ethernet interface to fixed VLAN based interface; therefore, the <interface> value is fixed to eth0:200 and is not configurable.
In the case of the Ethernet interface, the required parameters are:
AURIX_IP_ADDRESS
<model>=<interface>
In the case of Loopback interface with spi_tp, the required parameters are:
<model>=<interface>
spi_tp.cfg file (See the SPI Transport and Time Synchronization Protocol for Loopback Interface section below.)
In the case of the Ethernet interface, the following parameters are used for automatic IP assignment by nv_tacp_init service while booting:
AutoChauffeur (P2379)
TEGRA_A_IP_ADDRESS
TEGRA_B_IP_ADDRESS
AutoCruise (P3407)
TEGRA_IP_ADDRESS
TACP Ethernet interface communication is supported on AURIX_SERVER_PORT 5000 only.
For TACP Ethernet interface, AURIX and Tegra IP address in the configuration file must match the IP address stored in AURIX.
Example of tacp.cfg:
AURIX_IP_ADDRESS=10.42.0.146
TEGRA_A_IP_ADDRESS=10.42.0.28
TEGRA_B_IP_ADDRESS=10.42.0.29
AURIX_SERVER_PORT=5000
drive-px2-a=eth0.200
drive-px2-b=eth0.200
 
drive-px2-autocruise=lo
RECEIVE_TIMEOUT_S=5
RECEIVE_TIMEOUT_US=0
Modifying the Tegra to AURIX Default IP Address Settings for Ethernet Interface
If necessary, use the following commands to check and change the IP addresses on the AURIX and Tegra devices. The tacp.cfg file content must always be aligned with the IP address assigned to the AURIX.
To check the IP addresses assigned the AURIX to AURIX/TA/TB
In the AURIX console, enter:
status
To change the IP addresses assigned in the AURIX to AURIX/TA/TB
Enter in the AURIX console:
setip a <new_AURIX_ip_address>
setip ta <new_TA_ip_address>
setip tb <new_TB_ip_address>
To change the IP address assigned in the Tegra devices
Edit the tacp.cfg file as described above in “Library Usage and Configuration” above with the same IP addresses for AURIX, Tegra A, and Tegra B as entered in the AURIX in the previous step.
Note:
After changing the Tegra and AURIX IP address configurations, perform an “aurixreset” at the AURIX console for the addresss to take effect. Note that this resets the Tegra as well, so make sure to save any unsaved data before executing the command.
SPI Transport and Time Synchronization Protocol Using Loopback Interface
SPI transport and time synchronization protocol (spi_tp) is a daemon. This application must be started before using libtacp.so. P3407 uses 1 SPI interface and 2 GPIO to communicate between Tegra and AURIX. spi_tp transacts data over multiple loopback interface socket ports and transport data from/to AURIX through SPI.
spi_tp provides additional functions, including TACP:
Camera power control (with TACP)
Time synchronization
AURIX firmware OTA update (using nv_aurix_update tool)
Easycan(flexible CAN Gateway solution of AURIX)
To terminate spi_tp process
In the Tegra console, enter:
sudo systemctl stop nv_spi_tp
 
To start spi_tp process
In the Tegra console, enter:
sudo systemctl start nv_spi_tp
spi_tp Usage and Options
The default configuration file spi_tp.cfg is provided in the root file system at:
/etc/spi_tp/
This configuration file is used by spi_tp and client applications to obtain the required parameters, such as:
SPITP_MASTER_PORT=<port>
SPITP_CLIENT_PORT_OFFSET=<port offset value>
SPITP_TACP_PORT=<port>
SPITP_AURIX_OTA_PORT=<port>
SPITP_EASYCAN_PORT=<port>
SPITP_POLL_TIMEOUT_USEC=<timeout to wait UDP packet or GPIO>
SPITP_NO_POLL_COUNT=<dummy idle packet count after valid packet>
SPITP_TIME_SYNC_ENABLE=<0 or 1>
SPITP_TIME_SYNC_SEC=<time synchronization period>
Where:
When spi_tp starts, the following parameters are used for spi_tp options:
SPITP_MASTER_PORT=<port>
SPITP_CLIENT_PORT_OFFSET=<port offset value>
SPITP_POLL_TIMEOUT_USEC=<timeout to wait UDP packet or GPIO>
SPITP_NO_POLL_COUNT=<dummy idle packet count after valid packet>
SPITP_TIME_SYNC_ENABLE=<0 or 1>
SPITP_TIME_SYNC_SEC=<time synchronization period>
TACP library uses the port below with loopback interface:
SPITP_TACP_PORT=<port>
easycan_test sample application uses the port below with loopback interface:
SPITP_EASYCAN_PORT=<port>
Example of spi_tp.cfg:
SPITP_MASTER_PORT=50000
SPITP_CLIENT_PORT_OFFSET=50100
SPITP_TACP_PORT=50101
SPITP_AURIX_OTA_PORT=50102
SPITP_EASYCAN_PORT=50103
SPITP_POLL_TIMEOUT_USEC=50000
SPITP_NO_POLL_COUNT=0
SPITP_TIME_SYNC_ENABLE=0
SPITP_TIME_SYNC_SEC=1
The following are the supported parameters of spi_tp options:
SPITP_MASTER_PORT
UDP receive port of spi_tp. 50000 is default.
SPITP_CLIENT_PORT_OFFSET
Calculates the Channel number. <port> is the base representing Channel 0. Application that <port>+n is assigned uses channel n.
SPITP_TIME_SYNC_ENABLE
This option enables time synchronization.
Time synchronization is disabled by default.
SPITP_TIME_SYNC_SEC
Time synchronization period, in seconds.
SPITP_POLL_TIMEOUT_USEC
Waits UDP data from client APP or GPIO rising from AURIX for timeout microsecond. If <usec> does not exist, 50 msec is the default.
SPITP_NO_POLL_COUNT
Polls UDP and GPIO after <n> idle SPI transfers. This is used to receive data from AURIX(SPI slave) faster. This is not currently used. Default is 0.
SPITP_VERBOSE_MODE
Prints verbose information when value is not 0.
 
Note:
Do not modify options unless you are sure.
To enable time synchronization every 1 sec
In the Tegra console (ensure that you stop NTP or PTP before enabling spi_tp time synchronization):
In the Tegra console (ensure that you stop NTP or PTP before enabling spi_tp time synchronization):
sudo systemctl stop nv_spi_tp
Change “SPITP_TIME_SYNC_SEC=1” in spi_tp.cfg
sudo systemctl start nv_spi_tp
Example code of Easycan client application
For testing basic Easycan communication between Tegra and the AUTOSAR MCU (AURIX), the easycan_test application and source code are provided in the PDK package at:
drive-t186ref-linux/samples/easycan/
TACP Sample Application Usage
For testing basic TACP communication between Tegra and the AUTOSAR MCU (AURIX), a tacp_test_app sample application is provided in the PDK package at:
drive-t186ref-linux/samples/tacp/
For complete usage information, see the README included in the above directory.
The following commands are supported:
DRIVE PX 2 (P2379) AutoChauffeur:
./tacp_test_app get_cam_pwr_status
./tacp_test_app set_cam_pwr_on a/b/c/all m
./tacp_test_app set_cam_pwr_off a/b/c/all m
DRIVE PX 2 (P3407) AutoCruise:
./tacp_test_app get_cam_pwr_status
./tacp_test_app set_cam_pwr_on a/b/ all
./tacp_test_app set_cam_pwr_off a/b/ all