Demonstration#
DemoAppCom demonstrates FSI-CCPLEX communication. It is packaged in SDK.
Sending a Single Message to/from FSI to CCPLEX#
Change to the directory that holds the sample applications:
cd /opt/nvidia/drive-linux/samples/FsiCom/
Launch the DemoAppCom:
./DemoAppCom
Select
s
to send a single frame. Each frame consists of the message ID (2 bytes), message length (4 bytes) and message data. Message ID and message length are to demonstrate the sample application protocol to identify different messages. Applications must develop their own protocol.
With choice s
, an option is given to select the message ID and message length, for which the maximum value is limited to 58. Along with a single byte, which fills the message data. On success, write DemoAppcom displays the number of bytes written to channel_3 :
nvidia@tegra-ubuntu:/opt/nvidia/drive-linux/samples/FsiCom$ ./DemoAppCom
DriveOS_FsiComDemoApp main menu
_____________________________________________
[m] Display the menu
[s] Send a frame to FSI
[p] Periodically send data to FSI
[q] Terminate the app
s
Enter Message Id (0x0 - 0xFFFF)
1
Enter Message Length (DemoApp Supports maximum 54 bytes)
54
select single byte pattern to fill the message (0x00-0xFF)
1
written 60 size on channel_0
Important
User must send message with 54 bytes length. Refer to an open issue on variable length array.
DemoApp on FSI displays the received message from CCPLEX on FSI console as below. Here 0x1 is data sent at step 3:
consume on SM2
Pdu Length: 64
Message Id: 1 Message Length 54
Data:
0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1
0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1
0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1
0x1 0x1 0x1 0x1 0x1 0x1
produce on SM1
consume on SM2
FSI DemoApp sends the response by updating the message data by adding 0xA to each received byte and sends it back to the CCPLEX.
DemoAppCom on receiving the data on channel_3 validates the message length and displays the message in Guest OS console (here data is 0x1 + 0xA): (channel_0 indicates the index of channel_3 in DemoAppCom FsiCom Client node channel list)
NvFsiComWaitForEvent received for channel_0
Received Frame from FSI on Channel_0
Message Id : 0x0001
Message Length : 54
Message Data :
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B
Send/Receive Periodic Messages to FSI#
By selecting option p
from the main menu, DemoAppCom sends the message 10 times to FSI with a periodicity of 1 s.
Sending Messages to FSI Core1
Rebuild the DT with the below changes to send a message to FSI core1.
Set the DT parameter max_fsi_core in dt node fsicom_client: fsicom_client present in tegra264.dtsi to 2. For example:
max_fsi_core=<2>;
Set the core-id for channel_4 to 1 in dt node FsiComIvc in tegra264.dtsi. For example:
channel_4{
frame-count = <2>;
frame-size = <64>;
core-id = <1>;
NvSciCh = "nvfsicom_app2";
};
Set the channel ID to 4 for DemoAppCom in tegra264-p3960-0010-linux-gos.dtsi. For example:
FsiComAppChConfApp1{
compatible = "nvidia,tegra-fsicom-sampleApp1";
status = "okay";
channelid_list = <4>;
};
Rebuild DT and update the target. Copy DemoAppCom to the target.
Launch the DemoAppCom and select option
s
to send single data over the channel_4 to FSI core1.
./DemoAppCom
DriveOS_FsiComDemoApp main menu
_____________________________________________
[m] Display the menu
[s] Send a frame to FSI
[p] Periodically send data to FSI
[q] Terminate the app
p
Enter Message Id (0x0 - 0xFFFF)
1
Enter Message Length (DemoApp Supports maximum 54 bytes)
54
select single byte pattern to fill the message (0x00-0xFF)
0x0B
written 60 size on channel_0 _(0 indicates index of channel_4 in FsiCom Client node channel list)_
Important
User must send message with 54 bytes length. Refer to an open issue on variable length array.
FSI DemoApp sends the received data back to the CCPLEX.
DemoAppCom on receiving the data on channel_4 validates the message length and displays the message in Guest OS console (channel_0 indicates the index of channel_4 in DemoAppCom FsiCom client node channel list)
NvFsiComWaitForEvent received for channel_0
Received Frame from FSI on Channel_0
Message Id : 0x0001
Message Length : 54
Message Data :
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B 0x0B
0x0B 0x0B 0x0B 0x0B 0x0B 0x0B