4.8. CDD_IPC Module
4.8.1. Acronyms and Definitions
Abbreviation/Term |
Explanation |
---|---|
AUTOSAR |
Automotive Open System Architecture |
BSW |
Basic Software |
MCAL |
Micro Controller Abstraction Layer |
API |
Application Programming Interface |
DET |
Default Error Tracer |
IPC |
Inter Process Communication |
SW |
Software |
MCU |
Micro Controller Unit |
OS |
Operating System |
CDD |
Complex Device Driver |
4.8.2. Introduction
This document describes the functionality, API and configuration of the AUTOSAR BSW module Complex Device driver for IPC on AM263x device.
Supported AUTOSAR Release |
4.3.1 |
Supported Configuration Variants |
Post Build |
Vendor ID |
CDD_IPC_VENDOR_ID (44) |
Module ID |
CDD_IPC_MODULE_ID (255) |
Supported Platform |
AM263x |
4.8.3. Functional Overview
The main tasks of Complex Device Driver for IPC are the following:
Initialization of the mailbox driver
Simplifies reading and writing to the mailbox peripheral.
4.8.3.1. Complex Device Driver Architecture
The following figure shows where the Complex device driver is located in the AUTOSAR architecture.

Fig. 4.40 CDD in AUTOSAR architecture
4.8.3.2. Safe_IPC Overview
Safe_IPC in a Multi core system requires both Firewalling of shared memory and Data integrity check of payload. Safe_IPC can be enabled using Configurator which configures the shared memory in a way that firewalling is possible(limitation being number of firewalls and firewall granularity). Firewall configuration is not automatic and need to be manually enabled and configured from Non-Autosar core(by the core from which MCAL core is communicating). Data Integrity check has to be enabled using configuration. Once enabled, Data Integrity Check using CRC is enabled for IPC Notify and RPMsg Data. The calculated CRC is sent as a part of IPC Payload and decoded in the receiver end. Application has to define a hook function which will be used by driver for CRC calculation. 8 Bit CRC is used by IPC Notify and 16 Bit CRC is used by IPC RPMsg.
Note
why firewall is needed?
Firewall Protection ensures that if any core which don’t have permission to access the mailbox memory and that core tries to access the memory then exception is called.
With the help of firewall, core which don’t have permission will not be able to read or write into the firewall protected mailbox memory. This insures the prevention of malicious activity by non-firewalled core.
4.8.3.3. Initialization
The initialization covers the following steps:
Initialize the mailbox peripheral.
Cdd_Ipc_Init should be called only once during initialization.
No other CDD API can be invoked until this API is called.
4.8.4. Hardware Features
4.8.4.1. Supported Features
Open/Close mailbox instance
Send/Receive both Notify and RpMsg messages
RpMsg Callback functionality supported
Safe IPC functionality supported
4.8.4.2. Not supported Features
Multiple mailbox channels between the cores
Applications are validated only for the R50_0 core(RPmsg and Notify)
4.8.5. Source files
Description of static files is provided below:
📦AM263x
┣ 📂build
┣ 📂mcal
┃ ┣ 📂Ipc
┃ ┃ ┣ 📂include
┃ ┃ ┃ ┣ 📜Cdd_Ipc.h : Contains interface header for Complex device driver for IPC
┃ ┃ ┃ ┣ 📜Cdd_Ipc_Irq.h : contains ISR function declaration for Complex Device Driver
┃ ┃ ┃ ┣ 📜ipc_notify_lld_utils.h : Contains Internal functions declaration
┃ ┃ ┃ ┣ 📜ipc_notify_v1_lld.h : Contains Internal functions declaration
┃ ┃ ┃ ┣ 📜ipc_notify_v1_mailbox.h : Contains Internal functions declaration
┃ ┃ ┃ ┣ 📜ipc_rpmsg_linux_resource_table.h : Contains Internal functions declaration
┃ ┃ ┃ ┣ 📜ipc_rpmsg_lld.h : Contains Internal functions declaration
┃ ┃ ┃ ┣ 📜ipc_rpmsg_lld_priv.h : Contains Internal functions declaration
┃ ┃ ┃ ┗ 📜ipc_rpmsg_lld_queue.h : Contains Internal functions declaration
┃ ┃ ┣ 📂src
┃ ┃ ┃ ┣ 📜Cdd_Ipc.c : Contains function definitions for the Complex device driver for IPC and helper functions
┃ ┃ ┃ ┣ 📜Cdd_Ipc_Irq.c : Contains ISR function definitions for Complex Device Driver
┃ ┃ ┃ ┣ 📜ipc_notify_lld_utils.c : Contains Internal functions definition
┃ ┃ ┃ ┣ 📜ipc_notify_v1_lld.c : Contains Internal functions definition
┃ ┃ ┃ ┣ 📜ipc_rpmsg_lld.c : Contains Internal functions definition
┃ ┃ ┃ ┗ 📜ipc_rpmsg_lld_vring.c : Contains Internal functions definition
┃ ┃ ┣ 📂V0
┃ ┃ ┃ ┣ 📜hw_mailbox.h : Contains Internal functions definition
┃ ┃ ┃ ┣ 📜ipc_notify_v1_cfg_lld.c : Contains Internal functions definition
┃ ┃ ┃ ┗ 📜ipc_notify_v1_cfg_lld.h : Contains Internal functions definition
┃ ┃ ┗ 📜Makefile
┣ 📂mcal_config
┣ 📂mcal_docs
┗ 📜README.txt
The below diagram shows the files structure for the CDD driver.

Fig. 4.41 CDD header file include structure
4.8.6. Module requirements
4.8.6.1. Memory Mapping
Memory Mapping Sections |
CDD_CODE |
CDD_CODE_ISR |
CDD_VAR_NO_INIT |
CDD_VAR_ZERO_INIT |
---|---|---|---|---|
CDD_IPC_START_SEC_VAR_INIT_UNSPECIFIED (.bss) |
x |
|||
CDD_IPC_STOP_SEC_VAR_INIT_UNSPECIFIED |
x |
|||
CDD_IPC_START_SEC_CODE_APPL (.text) |
x |
|||
CDD_IPC_STOP_SEC_CODE_APPL |
x |
|||
CDD_IPC_START_SEC_VAR_UNSPECIFIED (.data) |
x |
|||
CDD_IPC_STOP_SEC_VAR_UNSPECIFIED |
x |
|||
CDD_IPC_START_SEC_CODE(.rodata) |
x |
|||
CDD_IPC_START_SEC_CODE |
x |
4.8.6.2. Scheduling
There is no scheduling functions in CDD IPC.
4.8.6.3. Error handling
4.8.6.3.1. Development Error Reporting
Development errors are reported to the DET using the service Det_ReportError().
4.8.6.4. Error codes
4.8.6.4.1. Development Errors
The errors reported to DET and DEM are described in the following table
Type of Error |
Related Error code |
Value (Hex) |
---|---|---|
Error code indicating the IPC is uninitialized |
CDD_IPC_E_UNINIT |
0x01 |
Error code indicating register client failed event |
CDD_IPC_E_REGISTER_CLIENT_FAILED |
0x02 |
Error code indicating IPC Initialization Failed |
CDD_IPC_E_INIT_FAILED |
0x03 |
Error code indicating IPC Deinitialization Failed |
CDD_IPC_E_DEINIT_FAILED |
0x04 |
Error code indicating invalid parameter |
CDD_IPC_E_PARAM_POINTER |
0x05 |
Error code indicating IPC already initialized |
CDD_IPC_E_ALREADY_INITIALIZED |
0x06 |
Error code indicating Service called with wrong param |
CDD_IPC_E_PARAM_VALUE |
0x07 |
Error code indicating Service called with invalid length |
CDD_IPC_E_PARAM_LENGTH |
0x08 |
Error code indicating invalid IPC Channel |
CDD_IPC_E_INVALID_CHANNEL |
0x09 |
Error code indicating invalid IPC configuration |
CDD_IPC_E_INVALID_CONFIG |
0x0A |
Error code indicating IPC Write Failed configuration |
CDD_IPC_E_WRITE_FAILED |
0x0B |
Error code indicating unregister client failed event |
CDD_IPC_E_UNREGISTER_CLIENT_FAILED |
0x0C |
Error code indicating construct failed event |
CDD_IPC_E_CONSTRUCT_FAILED |
0x0D |
Error code indicating RpMsg Write failed event |
CDD_IPC_E_RPMSG_WRITE_FAILED |
0x0E |
Error code indicating Rpmsg read failed event |
CDD_IPC_E_RPMSG_READ_FAILED |
0x0F |
Error code indicating destruct failed event |
CDD_IPC_E_DESTRUCT_FAILED |
0x10 |
4.8.6.4.2. Runtime Errors
The run time errors reported to DET module are described in the following table:
Error Code |
Error Macro |
Description |
---|---|---|
[0x01] |
CDD_IPC_E_INIT_FAILED |
Error code indicating the IPC is initialization failed after executing Cdd_Ipc_Init API |
[0x0D] |
CDD_IPC_E_CONSTRUCT_FAILED |
Error code indicating construct failed after executing Cdd_Ipc_construct API |
[0x04] |
CDD_IPC_E_DEINIT_FAILED |
Error code indicating IPC Deinitialization Failed after executing Cdd_Ipc_DeInit API |
4.8.6.4.3. Parameter Checking
AUTOSAR requires that API functions check the validity of their parameters. These checks are for development error reporting and can be en-/disabled via the parameter CDD_IPC_DEV_ERROR_DETECT. The following table shows which parameter checks are performed on which services:
Services |
CDD_IPC_E_UNINIT |
CDD_IPC_E_REGISTER_CLIENT_FAILED |
CDD_IPC_E_UNREGISTER_CLIENT_FAILED |
CDD_IPC_E_PARAM_POINTER |
CDD_IPC_E_ALREADY_INITIALIZED |
CDD_IPC_E_PARAM_VALUE |
CDD_IPC_E_WRITE_FAILED |
CDD_IPC_E_CONSTRUCT_FAILED |
CDD_IPC_E_RPMSG_WRITE_FAILED |
CDD_IPC_E_RPMSG_READ_FAILED |
---|---|---|---|---|---|---|---|---|---|---|
Cdd_Ipc_Init |
x |
x |
||||||||
Cdd_Ipc_DeInit |
x |
x |
||||||||
Cdd_Ipc_Notify_RegisterClient |
x |
x |
x |
|||||||
Cdd_Ipc_Notify_UnregisterClient |
x |
x |
x |
|||||||
Cdd_Ipc_Notify_Write |
x |
x |
x |
x |
||||||
Cdd_Ipc_Construct |
x |
x |
||||||||
Cdd_Ipc_Destruct |
x |
x |
||||||||
Cdd_Ipc_RpMsg_SendMsg |
x |
x |
x |
|||||||
Cdd_Ipc_RpMsg_SendMsg |
x |
x |
x |
4.8.7. Used resources
4.8.7.1. Interrupt Handling
For interrupt notification, ISR’s are provided in CDD IPC driver.Interrupt Subroutine calls notification function depending on the channel mode.
ISR for IPC Interrupt: Cdd_Ipc_Isr
Interrupt Id for MBox Read Request is 136.
4.8.8. Integration description
4.8.8.1. Dependent modules
4.8.8.1.1. OSEK/AUTOSAR OS (Optional)
An operating system can be used for task scheduling, interrupt handling, global suspend and restore of interrupts and creating of the Interrupt Vector Table. The CDD module may use OSEK/AUTOSAR OS to suspend and restore global interrupts.
4.8.8.1.2. DET (Optional)
The module CDD depends on the DET (by default) in order to report development errors. The mailbox operations like write, read are protected by a critical section.
4.8.8.1.3. Services used by Complex device Driver
The CDD does not provide any call back functions.
4.8.8.1.4. Notifications
At its configurable interfaces the CDD defines notifications that can be mapped to callback functions provided by other modules. The mapping is not statically defined by the CDD but can be performed at configuration time. The function prototypes that can be used for the configuration have to match the appropriate function prototype signatures, which are described in the following.
Cdd_Ipc_notify_msgHandler: This is defined in the Cdd_Ipc_notify_app.c for reference.
4.8.8.2. Multi-core support
Not supported
4.8.9. Configuration
4.8.9.1. CddIpcDriver
This container contains the configuration parameters and sub containers of the AUTOSAR Complex device driver(CDD) module.
4.8.9.1.1. CddIpcLocalCoreId
Item |
|
---|---|
Name |
CddIpcLocalCoreId |
Description |
This param contains the local coreId on which the IPC instance is running. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
CDD_IPC_R5FSS0_0_ID |
Range |
CDD_IPC_R5FSS0_0_ID |
4.8.9.1.2. CddIpcRemoteCoreList
Refers to the list of coreId that are valid for the particular platform.
4.8.9.1.2.1. CddIpcRemoteCoreIdIndex
Item |
|
---|---|
Name |
CddIpcRemoteCoreIdIndex |
Description |
The cores that are participating the IPC message exchange (Exclude the local core from these) |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
CDD_IPC_R5FSS0_0_ID |
Range |
CDD_IPC_R5FSS0_0_ID |
4.8.9.1.2.2. CddIpcSafeIpcCoresEnable
Item |
|
---|---|
Name |
CddIpcSafeIpcCoresEnable |
Description |
Switch to enable Safe Ipc between local and remote core. |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
false |
4.8.9.1.3. CddIpcEndPtConfig
This is required only in case of RpMsg is being used. To enable this make sure the CddIpcRpMsgEnable box is enabled.
4.8.9.1.3.1. CddIpcLocalEndPt
Item |
|
---|---|
Name |
CddIpcLocalEndPt |
Description |
This parameter is used to register a local call back especially for receiving or sending a RPMsg message |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
12 |
Max-value |
63 |
Min-value |
0 |
4.8.9.1.3.2. CddIpcRecvCallBack
Item |
|
---|---|
Name |
CddIpcRecvCallBack |
Description |
Function pointer to RPMSG callback function |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
NULL |
4.8.9.1.3.3. CddIpcrecvCallbackArguments
Item |
|
---|---|
Name |
CddIpcrecvCallbackArguments |
Description |
Function Pointer to recv callback function’s arguments |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
NULL |
4.8.9.1.3.4. CddIpcrecvNotifyCallback
Item |
|
---|---|
Name |
CddIpcrecvNotifyCallback |
Description |
Function pointer to IPC notify message Callback function. User can pass a pointer to a custom defined arguments structure and the callback passes this pointer when a notify interrupt is received |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
NULL |
4.8.9.1.3.5. CddIpcrecvNotifyCallbackArguments
Item |
|
---|---|
Name |
CddIpcrecvNotifyCallbackArguments |
Description |
Pointer to IPC notify message callback function’s arguments |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
NULL |
4.8.9.2. CddIpcGeneral
Item |
|
---|---|
Name |
CddIpcGeneral |
Description |
Switches the Cdd_IpcDeinit function ON or OFF. |
Post-build-variant-multiplicity |
false |
Origin |
Texas Instruments |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
true |
4.8.9.2.1. CddIpcWriteApi
Item |
|
---|---|
Name |
CddIpcWriteApi |
Description |
Switches the Cdd_IpcWrite function ON or OFF. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
true |
4.8.9.2.2. CddIpcReadApi
Item |
|
---|---|
Name |
CddIpcReadApi |
Description |
Switches the Cdd_IpcRead function ON or OFF. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
true |
4.8.9.2.3. CddIpcRpMsgEnable
Item |
|
---|---|
Name |
CddIpcRpMsgEnable |
Description |
Switch to enable RpMsg API’s to be enabled or not. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
true |
4.8.9.2.4. CddIpcRecvCallBackEnable
Item |
|
---|---|
Name |
CddIpcRecvCallBackEnable |
Description |
Switch to Enable RPMsg Recv Callback (This is different from Notify Callback). |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
true |
4.8.9.2.5. CddIpcRecvNotifyCallbackEnable
Item |
|
---|---|
Name |
CddIpcRecvNotifyCallbackEnable |
Description |
Switches the Development Error Detection and Notification ON or OFF. |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
true |
4.8.9.2.6. CddIpcSafeIpcEnable
Item |
|
---|---|
Name |
CddIpcSafeIpcEnable |
Description |
Switch to enable Safe Ipc to be enabled or not. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
false |
4.8.9.2.7. CddIpcCrcEnable
Item |
|
---|---|
Name |
CddIpcCrcEnable |
Description |
Switch to enable Crc to be enabled or not. |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
false |
4.8.9.2.8. CddIpcCrcHookFunc
Item |
|
---|---|
Name |
CddIpcCrcHookFunc |
Description |
Type of Isr function: void functionname(void) CAT1 : interrupt void func(void) CAT2 : ISR(func) |
Multiplicity-Configuration-Class |
– |
Post-Build Time |
VARIANT-POST-BUILD |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
CDD_IPC_ISR_VOID |
Range |
CDD_IPC_ISR_VOID |
4.8.9.2.9. CddIpcTimeout
Item |
|
---|---|
Name |
CddIpcTimeout |
Description |
Timeout value for send/receive/wait API’s. Unit is in clock ticks |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
2000000 |
Max-value |
2147483648 |
Min-value |
0 |
4.8.9.2.10. CddIpcNumOfBuffers
Item |
|
---|---|
Name |
CddIpcNumOfBuffers |
Description |
This parameter indicates the number of buffers for sending RPMsg |
Origin |
Texas Instruments |
Post-build-variant-multiplicity |
false |
Post-Build-Variant-Value |
false |
Value-Configuration-Class |
– |
Post-Build-Time |
VARIANT-POST-BUILD |
Default-value |
8 |
Note: In case of CddIpcRecvCallBack , when RPMsg arrive then that is invoked along with the data in the VRING buffer.So now if the msg size is less then what we are transferring between cores then we will send the echo msg back to the core from which we are receiving and will do UNLOCK of core only if complete msg transfer happens.So by this way we are acknowledging the remote core.
For details of configuration supported refer the MCAL_Configurator_UserGuide.pdf present in mcal_config/docs folder
4.8.10. Examples
4.8.10.1. Overview
CDD example application demonstrating the Complex device driver features 3 different examples namely ipc_notify_app , ipc_rpmsg_app and ipc_safeipc_app .
4.8.10.1.1. Ipc_notify_app_working
This application is low payload, low latency message type where user will be able to send a maximum of 28bits of data as the payload. The first 4 bits are used internally by the driver for the client ID. Notify app sends 1000000, to all the other 3 cores and waits for all of them to echo back. To make the example work with lesser cores, edit the following parameters in the example.
#define MAX 4
To the number of cores user needs to reduce.uint32 gRemoteCoreId[];
Enable only the cores that are required.uint32 gIpcTransferMutex[MAX]
Remove the extra Lock variables (These can be replced with any kind of mutex or semaphore implementation at the user End).In addition to these please also ensure the Cdd_Ipc_PBCfg.c has the proper cores configured from the XDM file.
The same changes stand valid for the rpmsg_echo_app as well.
4.8.10.1.2. Ipc_rpmsg_app working
RpMsg application uses Vrings as the medium to send larger data whose size and buffer depth can be configured using the parameters CDD_IPC_NUM_OF_BUFFERS and CDD_IPC_MAX_BUFFER_SIZE.
The application exchanges 100000 messages, the payload data is integer value where it gets incremented on every echo back from each core. In order to change the data from the integer to other data i.e., String or characters for command use-cases please change the following line.
snprintf(msgBuf, MAX_MSG_SIZE-1, "%d", msg);
to
snprintf(msgBuf, MAX_MSG_SIZE-1, "%s", Your String Data);
The notify application is present under the path <MCAL_ROOT>/examples/Ipc/Ipc_app_notify. This application can be built from the build folder by giving "gmake -s ipc_notify_app"
.
The rpmsg application is present under the path <MCAL_ROOT>/examples/Ipc/Ipc_app_rpmsg. This
application can be built from the build folder by giving "gmake -s ipc_rpmsg_app"
.
4.8.10.1.3. Ipc_safeipc_app_working
1.Safe_IPC application uses Vring as medium to transfer large size of data, along with providing the firewall protection on the mailbox memory(by configuring CDD_IPC_SAFEIPC_ENABLE as enable).

2.For selecting the remote core as safe core CddIpcSafeIpcCoresEnable is enabled at the remote core level in the configuration.

3.Apart from that CDD_IPC_CRC_ENABLE is enable in order to ensure the data integrity.

4.Inside the application hook function is defined for checking the CRC on the data payload.
5.This example demonstrate the safe communication between R50_0 AND R50_1, where MCAL is running on R50_1 and running SDK on R50_0(which is also responsible for setting up firewall).
Note
In order to run safe_ipc there are dependencies from TIFS and SDK. Since TIFS is responsible for providing the firewall services and SDK is responsible for setting up of firewall. So this setting up of firewall need to be taken care from SDK core in order to run safe_ipc with MCAL.
4.8.10.2. Setup required to run example
None
4.8.10.3. How to run examples
4.8.10.3.1. Ipc_notify_app_working/Ipc_rpmsg_app working
Examples to import from SDK to validate the CDD_IPC(Notify and Rpmsg) example,
Use all the other cores except R50_0 (this is where CDD_IPC app will be run), the path to the examples inside MCU+SDK directory
$(MCU_PLUS_SDK_PATH)/examples/drivers/ipc/ipc_notify_echo/am263x-cc
$(MCU_PLUS_SDK_PATH)/examples/drivers/ipc/ipc_rpmsg_echo/am263x-cc
After building SDK amd Mcal library, load the Mcal binary in R50_0 and SDK binary in all the other R5 core(R50_1) and execute the binary.
4.8.10.3.1.1. Notify App Sample Output

4.8.10.3.1.2. RPMsg App Sample Output

4.8.10.3.2. Ipc_safeipc_app_working
The safe_ipc application is present under the path <MCAL_ROOT>/examples/Ipc/Ipc_app_safeipc.This can be build from the build folder by using
"gmake -s ipc_safeipc_app CDD_IPC_SAFE_ENABLE=yes"
.After the build is successful, use the generated xer5f file as an input which should be to generate the appimage from the SDK safeIpc example present under $(MCU_PLUS_SDK_PATH)/examples/drivers/ipc/ipc_safeipc_echo/am263x-cc.
MCAL generated xer5f file should be used as an out file for R50_1 core of SDK and then build the SDK appimage.
In this case the generated appimage will have sdk running on R50_0 and MCAL on R50_1.
Now in order to run the appimage : Flash the appimage using UART_UNIFLASH.For more information refer: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/09_01_00_41/exports/docs/api_guide_am263x/TOOLS_FLASH.html#TOOLS_FLASH_UART_UNIFLASH
4.8.10.3.2.1. SafeIpc App Sample Output

4.8.10.3.3. Plugin Generation
The Cdd_Ipc has two configuration files inside Ipc_Demo_Cfg/soc/am263/r5f0_0/src. Cdd_Ipc_Callback_app_PBCfg.c and Cdd_Ipc_PBCfg.c
To generate Cdd_Ipc_Callback_app_PBCfg.c file, configure the macro CDD_IPC_RPMSG_CALLBACK_ENABLE as STD_ON in Cdd_Ipc_Cfg.h file.
Generate the configuration files.
Rename the PBCfg.c file as Cdd_Ipc_Callback_app_PBCfg.c and keep inside Ipc_Demo_Cfg/soc/am263/r5f0_0/src.
This file is used by the Cdd_Ipc_rpmsg_callback app.
To generate Cdd_Ipc_PBCfg.c file, configure the macro CDD_IPC_RPMSG_CALLBACK_ENABLE as STD_OFF in Cdd_Ipc_Cfg.h file.
Generate the configuration files.
keep the Cdd_Ipc_PBCfg.c file inside Ipc_Demo_Cfg/soc/am263/r5f0_0/src.
This file is used by the Cdd_Ipc_rpmsg app.
Note
Keep the Cdd_Ipc_Cfg.h file with macro CDD_IPC_RPMSG_CALLBACK_ENABLE as STD_ON inside the path Ipc_Demo_Cfg/soc/am263/r5f0_0/include.
4.8.10.4. Sample Log
Ipc Notify:
CDD_IPC_NOTIFY_APP: Sample IPC Application started!
CDD_IPC_NOTIFY_APP: Sync All Completed
CDD_IPC_NOTIFY_APP: Message exchange started by main core
CDD_IPC_NOTIFY_APP: All echoed messages received by main core from 3 remote cores !!!
CDD_IPC_NOTIFY_APP: Messages sent to each core = 1000000
CDD_IPC_NOTIFY_APP: Number of remote cores = 3
All tests have passed
Ipc Rpmsg:
CDD_IPC_RPMSG_APP: Sample IPC Application started!
CDD_IPC_RPMSG_APP: Sync All Completed
CDD_IPC_RPMSG_APP: RpMsg Message exchange started by main core
CDD_IPC_RPMSG_APP: All echoed messages received by main core from 3 remote cores !!!
CDD_IPC_RPMSG_APP: Messages sent to each core = 100000
CDD_IPC_RPMSG_APP: Number of remote cores = 3
All tests have passed
Ipc Rpmsg Callback:
CDD_IPC_RPMSG_CALLBACK_APP: Sample IPC Application started!
CDD_IPC_RPMSG_CALLBACK_APP: Sync All Completed
CDD_IPC_RPMSG_CALLBACK_APP: RpMsg Message exchange started by main core
CDD_IPC_RPMSG_CALLBACK_APP: All echoed messages received by main core from 3 remote cores !!!
CDD_IPC_RPMSG_CALLBACK_APP: Messages sent to each core = 100000
CDD_IPC_RPMSG_CALLBACK_APP: Number of remote cores = 3
All tests have passed
4.8.10.5. File Structure
📦AM263x
┣ 📂build
┣ 📂mcal
┃ ┣ 📂examples
┃ ┃ ┣ 📂Ipc
┃ ┃ ┃ ┣ 📂soc
┃ ┃ ┃ ┣ 📂Ipc_app_notify
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_app.h : Contains Cdd Ipc example header file
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_notify_app.c : contains the IPC R50 test app for IPC Notify
┃ ┃ ┃ ┃ ┗ 📜Makefile
┃ ┃ ┃ ┣ 📂Ipc_app_rpmsg
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_app.h : Contains Cdd Ipc example header file
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_rpmsg_app.c : Contains IPC R50 test app for RpMsg
┃ ┃ ┃ ┃ ┗ 📜Makefile
┃ ┃ ┃ ┣ 📂Ipc_app_rpmsg_callback_mode
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_app.h : Contains Cdd Ipc example header file
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_rpmsg_callback_app.c : Contains IPC R50 test app for RpMsg
┃ ┃ ┃ ┃ ┗ 📜Makefile
┃ ┃ ┃ ┣ 📂Ipc_app_safeipc
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_app.h : Contains Cdd Ipc example header file
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_safeipc_app.c : Contains IPC R51 test app for safeipc
┃ ┃ ┃ ┃ ┣ 📜lnk_r5_SafeIpc_am263_CLANG.cmd : Contains linker file
┃ ┃ ┃ ┃ ┗ 📜Makefile
┃ ┃ ┃ ┣ 📂Ipc_test_safeipc
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_app.h : Contains Cdd Ipc example header file
┃ ┃ ┃ ┃ ┣ 📜Cdd_Ipc_safeipc_test.c : Contains IPC R52 test app for safeipc
┃ ┃ ┃ ┃ ┣ 📜lnk_r5_SafeIpc_am263_CLANG.cmd : Contains linker file
┃ ┃ ┃ ┃ ┗ 📜Makefile
┃ ┣ 📂examples_config
┃ ┃ ┣ 📂Ipc_Demo_Cfg
┃ ┃ ┃ ┗ 📂soc
┃ ┃ ┃ ┃ ┣ 📂am263
┃ ┃ ┃ ┃ ┃ ┗ 📂r5f0_0
┃ ┃ ┃ ┃ ┃ ┃ ┣ 📂include
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗📜Cdd_Ipc_Cfg.h : Contains the configuration parameters
┃ ┃ ┃ ┃ ┃ ┃ ┗ 📂src
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣📜Cdd_Ipc_Callback_app_PBCfg.c : Contains all Pre-Compile Configured parameters with Recv CallBack Function
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗📜Cdd_Ipc_PBCfg.c : Contains all Pre-Compile Configured parameters
┃ 📂mcal_config
┃ 📂mcal_docs
┗ 📜README.txt