![]() |
MCUSW
|
This document details Cdd Ipc module implementations
Cdd Ipc modules allows core hosting MCAL/AUTOSAR to communicate with other cores (processing entities, with-in SoC) hosting PDK based IPC driver as well as HLOS Linux IPC driver. This driver could be used to transmit and receive variable length messages between cores, via logical communication channel ID's. Can be mapped to Sender-Receiver AUTOSAR interface, for data oriented communication between core that host AUTOSAR / NON AUTOSAR processing entities.
Some of key points to note
Please refer the Cdd IPC design page, which is part of CSP.[2]
As depicted in architecture figure below, Cdd Ipc implementation relies on mailbox, shared memory to transport messages between cores. The shared memory & other associated memories are provided via the configurator, Refer [Shared Memory Configuration] (Refer to Design Document provided in CSP) for details.
It's recommended to not change the recommended configuration for these parameters, unless the user comprehends methods to change memory location (and/or size) of the shared memory.
A communication channel provides a logical communication channel between two processors. Identified uniquely by an un-signed sequential integer, represented by configurator defined [symbolic name] (Refer to Design Document provided in CSP).
There could be multiple unique communication channel between any given 2 cores.
There are two primary identifiers, identifying the end-points for a core. This is used by the driver to identify the source / destination of a message.
Notes on EndPoints
The demo application by default uses control channel/Announce API's to notify remote cores of service availability. This feature could be turned OFF Refer for steps to turn OFF It is an endpoint which can be used to send or receive control messages, primarily used by Announce API�s to notify remote cores about the availability of service.
The design document details the various configurable parameters of this implementation, please refer section Configurator of [2] (Refer to Design Document provided in CSP)
Note: For detailed descriptions of all configurable parameters, refer to the design document provided in the CSP package. The document is located at: "$(MCAL_INSTALL_PATH)/mcusw/csp"
As noted from the previous MCAL implementation, some of the critical configuration registers could potentially be corrupted by other entities (s/w or h/w). One of the recommended detection methods would be to periodically read-back the configuration and confirm configuration is consistent. The service API defined below shall be implemented to enable this detection
Description | Comments | |
Service Name | Cdd_IpcRegisterReadBack | Can potentially be turned OFF (Refer to Design Document provided in CSP) |
Syntax | uint32 Cdd_IpcRegisterReadBack ( uint32 remoteProcId, P2VAR(Cdd_IpcRegRbValues, AUTOMATIC, CDD_APP_DATA) pRegArgs) | E_OK: Register read back has been done, E_NOT_OK: Register read back failed |
Service ID | NA | |
Sync / Async | Sync | |
Reentrancy | Reentrant | |
Parameter in | remoteProcId | Remote Processor ID. |
Parameters out | pRegArgs - Pointer to where to store the readback values. If this pointer is NULL_PTR, then the API will return E_NOT_OK. | |
Return Value | Std_ReturnType | E_OK, E_NOT_OK |
Service to get Mailbox state is FULL or not
Description | Comments | |
Service Name | Cdd_IpcGetMailboxStatus | Service to get Mailbox state is FULL or not |
Syntax | uint32 Cdd_IpcGetMailboxStatus(uint32 chId) | E_OK: Register read back has been done, E_NOT_OK: Register read back failed |
Service ID | CDD_IPC_SID_MAILBOX_STATE | |
Sync / Async | Sync | |
Reentrancy | Reentrant | |
Parameter in | remoteProcId | Remote ID. |
Parameters out | None | |
Return Value | uint32 | Returns the mailbox state |
The driver doesn't configure the functional clock and power for the Mailbox module. It is expected that the Secondary Bootloader (SBL) powers up the required modules. Please refer SBL documentation.
Note that, this implementation will NOT reset the Mailbox. Un Expected/stale messages could be delivered by the driver. It's recommended to drain stale messages before announcing the availability via service API Cdd_IpcAnnounce () if enabled.
To run the CddIpcRprocLinuxApp on mcu0_0
The MCAL example application could be built with the command
$ cd (SDK Install Directory)/mcusw.xx.yy.zz.bb/build $ gmake -s cdd_ipc_app BOARD=j722s_evm SOC=j722s BUILD_PROFILE=release CORE=mcu0_0 BUILD_OS_TYPE=baremetal $ OR $ gmake -s cdd_ipc_app BOARD=j722s_evm SOC=j722s BUILD_PROFILE=debug CORE=mcu0_0 BUILD_OS_TYPE=baremetal
The remote core application implementation is available at
The DMR5 remote core example application could be built with the command
$ cd (SDK Install Directory)/mcu_plus_sdk_j722s_xx_yy_zz/examples/drivers/ipc/ipc_rpmsg_echo/j722s-evm/wkup-r5fss0-0/ti-arm-clang $ gmake -s syscfg-gui // Select IPC and make sure PDK IPC is checked. Save (ctrl + s) and close gui $ gmake -s all Note: - Comment/remove the IpcNotify_syncAll API's from the path (SDK Install Directory)/mcu_plus_sdk_j722s_xx_yy_zz/examples/drivers/ipc/ipc_rpmsg_echo/ipc_rpmsg_echo.c. - Make sure to change gMainCoreID and gRemoteCoreId to correct ones. MCUR5 is main core and WKUP R5 is in the remote core list. - Vring address and Vring size should match with host and remote application.
steps to run
Various objects of this implementation (e.g. variables, functions, constants) are defined under different sections. The linker command file at (Examples Linker File (Select memory location to hold example binary)) defines separate section for these objects. When the driver is integrated, it is expected that these sections are created and placed in appropriate memory locations. (Locations of these objects depend on the system design and performance needs)
Section | CDD_IPC_CODE | CDD_IPC_VAR | CDD_IPC_VAR_NOINIT | CDD_IPC_CONST | CDD_IPC_CONFIG |
CDD_IPC_DATA_NO_INIT_UNSPECIFIED_SECTION (.data) | USED | ||||
CDD_IPC_DATA_INIT_32_SECTION | USED | ||||
CDD_IPC_TEXT_SECTION | USED | ||||
CDD_IPC_DATA_NO_INIT_8_SECTION | USED | ||||
CDD_IPC_CONFIG_SECTION | USED | ||||
CDD_IPC_ISR_TEXT_SECTION | USED | ||||
CDD_IPC_CONFIG_SECTION | USED |
This implementation depends on the DET in order to report development errors and can be turned OFF. Refer to the Development Error Reporting section for detailed error codes.
This implementation requires 1 level of exclusive access to guard critical sections. Invokes SchM_Enter_Cdd_Ipc_IPC_EXCLUSIVE_AREA_0(), SchM_Exit_Cdd_Ipc_IPC_EXCLUSIVE_AREA_0() to enter critical section and exit.
In the example implementation (SchM_Cdd_Ipc.c), all the interrupts on CPU are disabled. However, disabling of the enabled Mailbox related interrupts should suffice.
IPC demo applications use atleast 2 applications running on 2 different cores. Namely ipc_remote_app & cdd_ipc_app OR cdd_ipc_profile_app , these two applications would have to be re built when this features requires to be turned OFF
Development errors are reported to the DET using the service Det_ReportError(), when enabled. The driver interface files (Cdd_IpcCfg.h shown in the driver directory structure of the File Structure section)
Refer Design Document for detailed [Error Codes] (Refer to Design Document provided in CSP)
Production error are reported to DET via Det_ReportError(). Only the error codes in the Cdd Ipc driver specifications are reported which are listed in [] (Refer to Design Document provided in CSP) Back To Top
The AUTOSAR BSW Eth Driver specification details the APIs [[2] (Refer to Design Document provided in CSP)]
The flow chart below depicts the demo application
1. LINUX TERMINAL LOGS root@j722s-evm:~# rpmsg_char_simple -r 0 -n 10 Created endpt device rpmsg-char-0-699, fd = 4 port = 1025 Exchanging 10 messages with rpmsg device ti.ipc4.ping-pong on rproc id 0 ... Sending message #0: hello there 0! Receiving message #0: hello there 0! Sending message #1: hello there 1! Receiving message #1: hello there 1! Sending message #2: hello there 2! Receiving message #2: hello there 2! Sending message #3: hello there 3! Receiving message #3: hello there 3! Sending message #4: hello there 4! Receiving message #4: hello there 4! Sending message #5: hello there 5! Receiving message #5: hello there 5! Sending message #6: hello there 6! Receiving message #6: hello there 6! Sending message #7: hello there 7! Receiving message #7: hello there 7! Sending message #8: hello there 8! Receiving message #8: hello there 8! Sending message #9: hello there 9! Receiving message #9: hello there 9! Communicated 10 messages successfully on rpmsg-char-0-699 TEST STATUS: PASSED root@j722s-evm:~# modprobe rpmsg_client_sample count=10 [ 93.561808] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: new channel: 0x401 -> 0xd! [ 93.570354] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: new channel: 0x401 -> 0xd! [ 93.570358] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 1 (src: 0xd) [ 93.570567] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 2 (src: 0xd) [ 93.579001] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: new channel: 0x401 -> 0xd! [ 93.587086] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 1 (src: 0xd) [ 93.612028] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 3 (src: 0xd) [ 93.620325] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 1 (src: 0xd) root@j722s-evm:~# [ 93.628624] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 2 (src: 0xd) [ 93.638620] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 4 (src: 0xd) [ 93.646920] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 2 (src: 0xd) [ 93.655222] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 3 (src: 0xd) [ 93.663504] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 3 (src: 0xd) [ 93.671782] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 5 (src: 0xd) [ 93.680075] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 4 (src: 0xd) [ 93.688365] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 5 (src: 0xd) [ 93.696644] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 4 (src: 0xd) [ 93.704921] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 6 (src: 0xd) [ 93.713204] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 6 (src: 0xd) [ 93.721494] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 7 (src: 0xd) [ 93.729779] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 5 (src: 0xd) [ 93.738074] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 7 (src: 0xd) [ 93.746367] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 8 (src: 0xd) [ 93.754657] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 9 (src: 0xd) [ 93.762947] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 6 (src: 0xd) [ 93.771229] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 8 (src: 0xd) [ 93.779514] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: incoming msg 10 (src: 0xd) [ 93.787871] rpmsg_client_sample virtio1.ti.ipc4.ping-pong.-1.13: goodbye! [ 93.794677] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 7 (src: 0xd) [ 93.802956] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 9 (src: 0xd) [ 93.811251] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 8 (src: 0xd) [ 93.819536] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: incoming msg 10 (src: 0xd) [ 93.827887] rpmsg_client_sample virtio0.ti.ipc4.ping-pong.-1.13: goodbye! [ 93.834753] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 9 (src: 0xd) [ 93.843129] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: incoming msg 10 (src: 0xd) [ 93.851539] rpmsg_client_sample virtio2.ti.ipc4.ping-pong.-1.13: goodbye!
[MCU_Cortex_R5_1] CDD_IPC_APP : CDD IPC MCAL Version Info CDD_IPC_APP :--------------------- CDD_IPC_APP : Vendor ID : 44 CDD_IPC_APP : Module ID : 255 CDD_IPC_APP : SW Major Version : 10 CDD_IPC_APP : SW Minor Version : 0 CDD_IPC_APP : SW Patch Version : 1 CDD_IPC_APP : CDD_IPC_APP : Sample Application - STARTS !!! first ping sent to all cores ping sent to all cores inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 10 Iteration 10 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 9 Iteration 9 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 8 Iteration 8 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 7 Iteration 7 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 6 Iteration 6 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 5 Iteration 5 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 4 Iteration 4 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 3 Iteration 3 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 2 Iteration 2 from WKUPR5FSS0_0 inside loop for WKUPR5FSS0_0 remote core rec msg CDD_IPC_APP : Received ping 1 Iteration 1 from WKUPR5FSS0_0 CDD_IPC_APP : Transmitted and Received 10 times CDD_IPC_APP : All tests have passed !!! //In a Different UART Terminal [IPC RPMSG ECHO] Remote Core waiting for messages from main core ... !!! [IPC RPMSG ECHO] Received and echoed 10 messages ... !!! All tests have passed!!
Sl No | Specification | Comment / Link |
---|---|---|
1 | AUTOSAR 4.3.1 | AUTOSAR Specification for CDD Driver & Integration Intranet Link |