Configuration#
This topic lists all configuration options on the FSI and CCPLEX side used for the component demonstration. Additional applications can be enabled by extending for more channels following this example.
FSI Side Configuration#
The following BSW modules must be configured:
LdCom: Used for defining communication data to be exposed to the application layer. Alternatively, users can also configure the Com module based on the requirement.
PduR: Used for establishing routing path between LdCom module and CddCCplexCom module.
CddCCplexCom: This module is used in configurations of lower PDUs that are part of CddCcplexCom module. Provide the references to PDUs used for communication at the driver level.
FsiCcplexCom: This module configures the underlying driver for communication between FSI and CCPLEX - CddCcplexCom. The following configuration should be configured and generated in DaVinci Configurator tool.
Container |
Configuration parameter |
Description |
Valid Range |
Default Value |
---|---|---|---|---|
FsiCcplexComGeneral |
FsiCcplexComPageSize |
DRAM Page size |
0 - 65535 |
4096 |
FsiCcplexComGeneral |
“Multi Core Support” |
Enable multicore support for FsiCom |
TRUE-FALSE |
FALSE |
FsiCcplexComCfg |
Cfg Variant |
Variant identification of FsiCcplexCom configuration to define the configuration for two ECUs. If the use case is for only one ECU, keep the default configuration as CONFIG_VAR_1. |
VAR_1 - VAR_2 |
VAR_1 |
FsiCcplexComChannelConfigs |
Sub container for channel specific configuration. |
NA |
NA |
|
FsiCcplexComChannelConfigs |
Buffer Rx |
Enable this feature for channel, which must be buffered by CddCcplexCom driver before delivering it to RTE (Reception). This optimizes the time taken by the RTE memcopy function to copy from SRAM to SRAM rather than DRAM to SRAM, which is time consuming. |
TRUE-FALSE |
FALSE |
FsiCcplexComChannelId |
Channel index denoting the channel that can be configured in discontinuous fashion starting from 1 to 255. This value must be unique across configuration for multiple FSI cores. |
1 - 255 |
NA |
|
Core Usage |
Specify the FSI core to which this channel needs to be mapped. |
CORE_0, CORE_1, CORE_2, CORE_3 |
NA |
|
FsiCcplexComFrameSize |
Frame size configured in bytes. It must be a multiple of 64. Total available data size for communication is always 4B less than the configured frame size. In a FsiCcplexComFrame, 4B is reserved for the payload length field and this field is transparent to the application. |
0 - 65472 |
NA |
|
FsiCcplexComNumberOfFrames |
Number of frames in a given physical channel. |
0 - 65535 |
NA |
|
FsiCcplexComTxPduRef |
Reference to CddPduRLowerLayerTxPdu container used in CddCcplexCom. Note This is required for generic communication |
Reference parameter /AUTOSAR/EcucDefs/Cdd/CddComStackContribution/CddPduRLowerLayerContribution/CddPduRLowerLayerTxPdu |
||
FsiCcplexComRxPduRef |
Reference to PduRSrcPdu container used in the PduR routing path to route PDUs to the upper layer (Com/LdCom) from CddCcplexCom. Note This is required for generic communication |
Reference parameter /AUTOSAR/EcucDefs/PduR/PduRRoutingTables/PduRRoutingTable/PduRRoutingPath/PduRSrcPdu |
||
“Supports Notification” |
Parameter to enable notification for read and write on Fsi-ccplex Com channel. By default, notification is enabled for channel. Un-select to disable notification. |
TRUE-FALSE |
NA |
|
“OS resource” |
Reference to an OS resource that is used to lock scheduling during FsiCom channel read and write when notification is disabled. |
refer /AUTOSAR/EcucDefs/Os/OsResource |
NA |
Note
CddCcplexCom_Init()
should be called after Rte_start()
from all configured FSI cores.
FSI Communication Extract#
A sample communication extract is provided in 3rdparty_sw_Extract.arxml
. This extract is created using the Artop tool and alternatively can be updated in any arxml or text editor. The communication extract is based on an Ethernet bus as DaVinci configurator tool requires a communication extract based on communication bus ex. Ethernet, CAN etc. The actual medium for FSI CCPLEX communication is a shared memory and this extract helps in mapping data elements in a delegation port of SWC to LdComIPdu (Alternatively ComIPdu can also be used).
The communication extract predominantly models the following elements which is required for signal mappings:
PDU
ISignal
ISignalIPduMapping
SystemSignal
In our example, the DemoApp (SWC name : UserSwFsiCcplexCom) communicates with LdCom using the configuration mentioned below. In LdCom EcuC, LdComSystemTemplateSignalRef parameter is used to map a LdComIPdu to ISignalIPduMapping as described below:
LdComIPdu_Rx is mapped to CCPLEX_TO_FSI_ISignalIPduMapping.
LdComIPdu_Tx is mapped to FSI_TO_CCPLEX_ISignalIPduMapping.
Using the data mapping option in DaVinciConfigurator, the system signals are mapped to delegation ports as described below. The mapping cannot be executed in the DaVinci Developer tool for the provided example communication extract.
CCPLEX_TO_FSI_SysSIGNAL to R_Deleg_UserDataRx_GenericCase.UserData.
FSI_TO_CCPLEX_SysSIGNAL to P_Deleg_UserDataTx_GenericCase.UserData.
Since communication extract is based on Ethernet communication bus, there are redundant configurations created in BSW that must be manually removed. This is required whenever new signals are defined in the communication extract.
Com
Remove ComConfig->ComSignals remove additional signals coming from extract.
Remove ComConfig->ComIPdus remove additional signals coming from extract.
ComM
Remove ComMConfigSet->ComMChannel remove additional channels getting created from extract ex. SensorFusion_xyz
EcuC
Remove EcucPduCollection -> Additional Pdus getting created ex. CCPLEX_TO_FSI_750e0ae4_Rx, CCPLEX_TO_FSI_3c8409d8_Rx
PduR
Remove PduRRoutingTables->PduRRoutingPath remove redundant paths ex. CCPLEX_TO_FSI_750e0ae4_Rx
In Davinci Configurator, remove redundant modules of Ethernet stack (only required at first import)
Go to Project Settings -> Modules. Remove Eth, EthIf, EthSM, TcpIp,SoAd.
CCPLEX side configuration#
Add Application Dt node for CCPLEX side configuration in the corresponding gos dts (refer to “Configuration DT file” for file path):
<FsiCom_App_Node_Name>{
/* Unique compatible string to detect this at run time. */
compatible = "nvidia,XYZ";
/* Status of DT node. */
status = "disabled";
/* List of channels used by the application. */
channelid_list = <0>;
};
Create 2 NvSci channels for IPC. To create the NvSci channels nvfsicom_xyz_* add a new entry in
nvsciipc_t26x.cfg
file using the below format:nvfsicom_xyz_0 <-> nvfsicom_xyz_1: Used to send command response mechanism between FsiCom lib and daemon.
nvfsicom_xyz_2 <-> nvfsicom_xyz_3: Used by daemon to notify read events to NvFsiCom clients about the data available in carveout notification.
Note
This extra channel came because of sigrtmin signal usage removal from FsiCcple Com.
INTER_PROCESS channel_name_0 channel_name_1 frame_count frame_size
INTER_PROCESS channel_name_2 channel_name_3 frame_count frame_size
INTER_PROCESS nvfsicom_xyz_0 nvfsicom_xyz_1 64 1536
INTER_PROCESS nvfsicom_xyz_2 nvfsicom_xyz_3 64 1536
NvFsiCom dt node for channel configuration (refer to “Configuration DT file” for the file path):
FsiComIvc {
/* Unique compatible string. */
compatible = "nvidia,tegra-fsicom-channels";
/* Status of DT node. */
status = "disabled";
/* Total no. of channels configured. Each channel configured should be unique. */
nChannel=<2>;
/* List all nvsciipc endpoints used by channels. */
nvsciipc_endpoint = "nvfsicom_xyz", "nvfsicom_abc";
/* Max FSI core supported */
max_fsi_core=<1>; /* support only core 0: To support core 0 & core 1 put value as 2 */
/* Only two FSI cores in Orin can support notification for FSI-CCPLEX-COM.
fsi_core_noify indicates which core can get notifications.
Core 0 should always be in list of fsi_core_noify.
fsi_core_polling is list of FSI core ids where polling is used for FSI-CCPLEX-COM. */
fsi_core_notify=<0 1>;
fsi_core_polling=<2 3>;
channel_0 {
/* Total no. of frames in channel 0 */
frame-count = <4>;
/* Size of each frame in channel 0 */
frame-size = <64>;
/* FSI core/cpu Id */
core-id = <0>; /* 0 - FSI CPU0, 1 - FSI CPU1 */
};
/* 1st channel config */
channel_1 {
/* Total no. of frames in channel 1 */
frame-count = <2>;
/* Size of each frame in channel 1 */
frame-size = <512>;
/* FSI core/cpu Id */
core-id = <0>; /* 0 - FSI CPU0, 1 - FSI CPU1 */
};
channel_10 {
frame-count = <4>;
frame-size = <64>;
core-id = <2>;
notification = "disabled"; /* polling is used for this channel */
};
channel_11 {
frame-count = <4>;
frame-size = <1024>;
core-id = <3>;
notification = "disabled"; /* polling is used for this channel */
};
FsiComApp_grp1 {
compatible = "nvidia,tegra-fsicom-grp1";
group_id = <1>; /* Channels which are grouped can receive message in one thread */
nChannels = <2>; /* Number of channels in group */
channelid_list = <2 1>; /* Channel 2 and Channel 1 are grouped */
}
};
Steps to Add and Configure New Channel#
Total memory allocation per FsiCom Client is 4K page aligned and new channel can be added as described in the following steps. The channel ID can be discontinuous. This means any client can configure any channel ID (not used by any other client and less than 256) for use.
Adding a channel in CddCcplexCom
Follow the steps below to add a channel on the FSI side:
Configure FsiCcplexCom as per recommended settings.
Configure a Pdu for Rx and one Pdu for Tx. Refer to the sample configuration of Pdu_Tx_Cdd and Pdu_Rx_Cdd for how to represent communication data at the CddCcplexCom layer.
Configure a Pdu for Rx and one Pdu for Tx for LdCom. Refer to the sample configuration of Pdu_Tx_LdCom and Pdu_Rx_LdCom for how to represent communication data at LdCom.
Update configuration for routing paths.
For configuration, refer to PduR, LdCom , Ecuc configuration arxml in the SupportingFiles folder.
Adding a channel for NvFsiCom
Follow the steps below to add a channel on the CCPLEX side:
Add a channel config in FsiComIvc as shown in 4.3. Channel_0 is used internally for FsiCom. New channels should start with node id channel_1.
If is not present for your application, add a node for your application and go to step #3.
Add the corresponding channel reference in your application dt node as shown in 4.3.
Set status of to “okay” in
tegra264-p3960-0010-linux-gos.dtsi
.Refer to
tegra264.dtsi
andtegra264.dtsi
for example configuration.
Shared Memory and Channel Details
Total Shared memory size available: 16 MB
Memory Allocated for a Channel =One Rx FIFO + One Tx FIFO of equal size + Additional 256 bytes for header used by lower driver
Example:
For a client that has only channel_0 configured as below:
Channe_0: Frame-size = 64, frame-count = 4 .
Memory allocated for this channel = (64 * 4) + (64 *4) + 256 = 768
Total Memory allocated for the client= PAGE_ALIGN(768 , PAGE_SIZE) = PAGE_SIZE i.e., 4K
Note
From available 16MB, 12 memory pages in shared memory are reserved for FsiCom Internal Channels. FsiCom Internal Channel to send notification uses 1 page of shared memory (per FSI core) and FsiCom Channel to send Eps configuration uses 8 pages of shared memory.
Configuration Constraints
Configuration on FSI and CCPLEX side should be the same for each channel (channel index, frame size, num frames etc). After each update, the corresponding build/compilation steps should be followed.
One Channel maps to 2 PDUs (one for transmit and the other for receive).
Max data size in any transmit request from the application should be 4Bytes less than the frame size configured.
If a transmit request from an application has a lesser number of bytes than frame size, one frame data is always transferred. Additional bytes are random. FsiCom driver updates the FsiCom frame header with the payload length. The receiving application receives valid data indicated by the frame header.
If an application needs to send different data in the same PDUs, then the application has to code a message identifier (for example, Byte 0 and Byte 1 reserved for ID). This establishes multiple logical connections over one PDU.
The application must configure the RTE port for receiving data from Ccplex based on use-cases. Example: RTE port for receiving from high data rate channel should use queued communication.
Channel ID 0 is reserved for FsiCom internal usage.
Frame size for FsiCom channel should be 64 byte aligned.
MPU region for FsiCom DRAM should be configured as GRE device memory.
Channels Configured in Demoref Configuration
Channel 0 - Used for Eps reconfiguration. This channel is autogenerated and a must have for Safety Services use cases. It should not be modified.
Channel 1 - Used for Error report forwarding from FSI to CCPLEX. This channel can be removed, which affects the CcplexApp demo.
Channel 2 - Used for sending state change notification to FSI SEH from CcplexApp. This channel can be removed, which affects the CcplexApp demo.
Channel 3 - Used for FsiCom GenericCom demo. This channel can be removed, affects the DemoAppCom demo.
Channel 4 - Used for FsiCom Multicore demo. This channel can be removed, which affects the FsiCom FSI Multicore demo.
Channel 5,6 - Used for internal testapp. This channel can be removed.
Channel 10,11 - Used for internal testapp. This channel can be removed.
Note
For Closed Box FSI binary, only the channel 0 configuration is valid. Remove the GuestOS “channel 1~6” configuration for closedbox cases.
NvFsiCom Security Hardening#
This section describes the security hardening requirements for FSI-CCPLEX communication on the GuestOS side.
Security Configuration Steps#
- Process Configuration
For more information about Linux security hardening, refer to Linux Security Hardening.
- NvSciIpc Endpoint Security
For more information about endpoint security, refer to Steps to Adopt Security for NvSciIpc Endpoints.
Example Configuration#
Refer to the DemoAppCom configuration in the
process_information.yaml
file.Refer to
nvfsicom_app*
endpoint configurations in thenvsciipc.cfg
file.