This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: RpMsg Communication between R5f and C7x.

Part Number: TDA4VM


Tool/software:


















Hi Team,

1. We are facing  the issue in RpMsg between C7x and R5F. 

    R5F <===> C7x  (not working)

2. We are able to communicate between:

    A72  <===> C7x
    A72  <===> R5F


3.   Build Info:
     
     i. example:                 ipc_echo_test_freertos
     ii. Application:            ipc_testsetup.c  (pdk_jacinto_09_01_00_22/packages/ti/drv/ipc/examples/common/src)
    iii. Build Command:     make -sj -j8 BOARD=j721e_evm CORE=mcu2_1 ipc_echo_test_freertos BUILD_PROFILE=debug
    iv. Ref Docs: ti-processor-sdk-rtos-j721e-evm-09_01_00_06/pdk_jacinto_09_01_00_22/docs/userguide/jacinto/modules/ipc.html#example-details

    v. RpMsg Send function:    status = RPMessage_send(handle, remoteProcId, remoteEndPt, myEndPt, str, len);

                      remoteProcId = IPC_C7X_1
                      remoteEndPt = 1025
                      myEndPt = 14 

      remote proc id's: #define IPC_MPU1_0 (0U) /**< ARM A72 - VM0 */
                                 #define IPC_MCU1_0 (1U) /**< ARM MCU R5F - core0 */
                                 #define IPC_MCU1_1 (2U) /**< ARM MCU R5F - core1 */
                                 #define IPC_MCU2_0 (3U) /**< ARM Main R5F - core0 */
                                 #define IPC_MCU2_1 (4U) /**< ARM Main R5F - core1 */
                                 #if defined (SOC_J721E)
                                 #define IPC_MCU3_0 (5U) /**< ARM Main R5F - core2 */
                                 #define IPC_MCU3_1 (6U) /**< ARM Main R5F - core3 */
                                 #define IPC_C66X_1 (7U) /**< DSP C66x - core0 */
                                 #define IPC_C66X_2 (8U) /**< DSP C66x - core1 */
                                 #define IPC_C7X_1 (9U) /**< DSP C7x - core0 */
                                 #define IPC_MPU1_1 (10U) /**< ARM A72 - VM1 */
                                 #define IPC_MAX_PROCS (11U) /**< Maximum Processors */
                                 #elif defined (SOC_J7200)
                                #define IPC_MPU1_1 (5U) /**< ARM A72 - VM1 */
                                #define IPC_MAX_PROCS (6U) /**< Maximum Processors */


   ==>   In the above example we are trying send a msg from R5F to C7x. but in c7x end we are not able to get the msg.

 Q1:  Please let us know whether we are passing correct values for send function parameters.
 Q2: and please provide, if any, rpmsg examples for RTOS-RTOS communication.

     With regards,
     Sunil 


      


































  • Hello Sunil,

    May i what executable are you flashing in C7x core ? and also are you SPL or SBL ? 

    May i know which boot media you are using ?

    Regards

    Tarun Mukesh


  • Hi Tarun, 

    1. Execubles:     ipc_echo_test_freertos_c7x_1_debug.xe71 

    2. Boot media: sd card boot mode.

    3. binary loading steps: 

        Run following steps to configure remote firmware for SPL loading with HLOS running on MPU

    1. Copy the remote firmware to rootfs at /lib/firmware/pdk-ipc folder

    2. cd /lib/firmware

    3. Remove old soft link for remote cores

      • rm j7*

    4. Create new soft links

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_test_c66xdsp_1_release.xe66 j7-c66_0-fw

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_test_c66xdsp_2_release.xe66 j7-c66_1-fw

      • ln -s /lib/firmware/pdk-ipc/ ipc_echo_test_freertos_c7x_1_debug.xe71   j7-c71_0-fw

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_test_mcu3_0_release.xer5f j7-main-r5f1_0-fw

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_test_mcu3_1_release.xer5f j7-main-r5f1_1-fw

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_test_mcu2_0_release.xer5f j7-main-r5f0_0-fw

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_test_mcu2_1_release.xer5f j7-main-r5f0_1-fw

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_testb_mcu1_0_release.xer5f j7-mcu-r5f0_0-fw

      • ln -s /lib/firmware/pdk-ipc/ipc_echo_test_mcu1_1_release.xer5f j7-mcu-r5f0_1-fw

    5. sync : write the changes to filesystem

    6. Reboot the system                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      4.     With above procedure, we are able to communicate between:

             A72  <==> C7x
             A72  <==> R5f

      5. Not working between: 

        R5F   <==> C7x (RTOS : RTOS)

      6. ipc_testsetup.c (ti-processor-sdk-rtos-j721e-evm-09_01_00_06/pdk_jacinto_09_01_00_22/packages/ti/drv/ipc/examples/common/src)

      Q1: Please let us know, can we use the same application for rpmsg between r5f and c7x (RTOS:ROS)

      Q2: If yes, what are rpmsg send function parameter values: 

             status = RPMessage_send(handle, remoteProcId, remoteEndPt, myEndPt, str, len);

             i. remoteProcId = IPC_C7X_1;
             ii. remoteEndPt = ?
            iii. myEndPt = ?

      Assume, rpmsg from R5F to C7x. 


      With regards,
      Sunil 



                                                                                                                                                                                                                                                                                                                          



        































  • Hello Sunil,

    rpmsg_char_simple is command used to communicate between A72 core and other cores.For the other cores , as soon as they are loaded they will start executing and will print the logs on trace buffer rather then UART terminal.

    cat /sys/kernel/debug/remoteproc/remoteproc*/trace0

    You can run the above command and verify the communication done or not.

    Regards

    Tarun Mukesh

  • I have tested and got the log

    Regards

    Tarun MUkesh


  • Hi Tarun,

    1. We are able to  see the communication between each core, using buffer trace command from user space:

        cat /sys/kernel/debug/remoteproc/remoteproc*/trace0      

    Observation:     




    Project requirements:

        Note: core involved: A72, R5F, C7x.

         1. Once the  board is boot up, A72 do its task. 
         2. A72 send RpMsg to R5F.  (A72 ==> R5F)
         3. Once R5F receives rpmsg from A72, R5F do its task.
         4. R5F send rpmsg to C7x for further process (R5F ==> C7x) 
         5. C7x do its task and send ack back to A72 core. ( C7x ==> A72)
         6. Finally, A72 display the result once, a72 gets rpmsg from the C7x. 

         
         Req:     A72  ==> R5F ==> C7x ==> A72

         Progress:  A72  <==> C7x (working)
                           A72  <==> R5F (working)
                           R5F  <==> C7x (not working) 

          R5F core:  R5F0_1  (r5f_0, and core_1)

          Questions:

          Q1:  What are the rpmsg send function parameter values to send msg from R5F to C7x:

                  

       status = RPMessage_send(handle, remoteProcId, remoteEndPt, myEndPt, str, len);
                    if (status != IPC_SOK)
                    {
                            App_printf("RecvTask: Sending msg \"%s\" len %d from %s to %s failed!!!\n",
                            str, len, Ipc_mpGetSelfName(),
                            Ipc_mpGetName(remoteProcId));
                    }
    
    


                  i. remoteProcId = ?
                  ii. remoteEndPt = ?
                  iii. myEndPt = ?

    please guide us, as per our requirements.

    With regards,
    Sunil A P

         


         

           

                    
          

















  • Hello,


    Project requirements:

        Note: core involved: A72, R5F, C72.

         1. Once the  board is boot up, A72 do its task. 
         2. A72 send RpMsg to R5F.  (A72 ==> R5F)
         3. Once R5F receives rpmsg from A72, R5F do its task.
         4. R5F send rpmsg to C7x for further process (R5F ==> C7x) 
         5. C7x do its task and send ack back to A72 core. ( C7x ==> A72)
         6. Finally, A72 display the result once, a72 gets rpmsg from the C7x. 

         
         Req:     A72  ==> R5F ==> C7x ==> A72

         Progress:  A72  <==> C7x (working)
                           A72  <==> R5F (working)
                           R5F  <==> C7x (not working) 

    This is your specific requirement, i mean custom development.

    Before A72 loads the linux, the R5F cores and C7x are loaded with executables and started as well. so by the time linux loads the communication between R5F core and C7x core is already done as well.which is what you see in the trace buffer.

    As you need custom specific , you need to modify the code as per the requirement.Please understand the boot flow and develop your application.

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-jacinto7/09_00_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html#boot-flow

    Regards

    Tarun Mukesh


  • Hi Tarun,

    1. Our existing application is already working for (A72 <=> C7x and A72 <=> R5F).

    2. We are just facing an issue between R5F <=> C7x , and doubting on Rpmsg send function parameters.

       

                    /* TODO: 4. send RpMsg to c7x */
                    remoteProcId = IPC_C7X_1;
                    len = snprintf(str, 255, "Mistral custom response [ from MCU2_1 ]: remoteProcId:%d remoteEndPt:%d myEndPt:%d ", remoteProcId, remoteEndPt, myEndPt);
                    status = RPMessage_send(handle, remoteProcId, remoteEndPt, myEndPt, str, len);
                    if (status != IPC_SOK)
                    {
                            App_printf("RecvTask: Sending msg \"%s\" len %d from %s to %s failed!!!\n",
                            str, len, Ipc_mpGetSelfName(),
                            Ipc_mpGetName(remoteProcId));
                    }


       Q: We couldn't find,  values for the following parameters: 
     
                remoteProcId = ? 
                remoteEndPt = ? 
                myEndPt = ?

           Please let us know the values.


    With regards,
    Sunil 
            













  • Hello,

    remote proc ID are as below,

    /** \brief Core definitions */
    #define IPC_MPU1_0 (0U) /**< ARM A72 - VM0 */
    #define IPC_MCU1_0 (1U) /**< ARM MCU R5F - core0 */
    #define IPC_MCU1_1 (2U) /**< ARM MCU R5F - core1 */
    #define IPC_MCU2_0 (3U) /**< ARM Main R5F - core0 */
    #define IPC_MCU2_1 (4U) /**< ARM Main R5F - core1 */
    #define IPC_MCU3_0 (5U) /**< ARM Main R5F - core2 */
    #define IPC_MCU3_1 (6U) /**< ARM Main R5F - core3 */
    #define IPC_C66X_1 (7U) /**< DSP C66x - core0 */
    #define IPC_C66X_2 (8U) /**< DSP C66x - core1 */
    #define IPC_C7X_1 (9U) /**< DSP C7x - core0 */
    #define IPC_MPU1_1 (10U) /**< ARM A72 - VM1 */
    #define IPC_MAX_PROCS (11U) /**< Maximum Processors */
    But endpoints will be dynamic those are not statically allocated we cannot define those.

    Regards
    Tarun Mukesh
  • Hello tarun,

    1. we tried by changing only the remote proc ID:

         msg from R5F  ==> C7x

         remoteProcId = IPC_C7X_1;


         

            /* TODO: 4. send RpMsg to c7x */
                    remoteProcId = IPC_C7X_1;
                    len = snprintf(str, 255, "Mistral custom response [ from MCU2_1 ]: remoteProcId:%d remoteEndPt:%d myEndPt:%d ", remoteProcId, remoteEndPt, myEndPt);
                    status = RPMessage_send(handle, remoteProcId, remoteEndPt, myEndPt, str, len);
                    if (status != IPC_SOK)
                    {
                            App_printf("RecvTask: Sending msg \"%s\" len %d from %s to %s failed!!!\n",
                            str, len, Ipc_mpGetSelfName(),
                            Ipc_mpGetName(remoteProcId));
                    }


         
    Observation in the Trace Buffer:




    2. but it is not working after boot up.





    With regards,
    Sunil 















  • Hello,

    How did you fetch the remote end point ? How do you know that 104 remote endpoint is associated with C7x core ? You are just looking at sender fn rather the entire flow of calls.

    Try to understand the flow of IPC , since you are getting failed prints earlier it communicated well with C7x core ?

    Regards

    Tarun Mukesh

  • Hello tarun,

    1. As u told, remote end points (remoteEndPt ) are dynamically assigned, i assigned  only  the remote proc id (remoteProcId) to  C7x id ( IPC_C7X_1).

       so, 104 is dynamically assigned value.   

    Observation:

        : remoteProcId:4 remoteEndPt:104 myEndPt:13 " len 80 from C7X_1 endPt 13
    SendTask9: Sending "ping 9891" from mcu2_1 to C7X_1...
    [IPC] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> debug info .................... ...NULL vq
    [IPC] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> debug info .................... ...NULL vq
    SendTask9: Received "Mmistral custom response [from C7x ]: remoteProcId:4 remoteEndPt:104 myEndPt:13 " len 80 from C7X_1 endPt 13
    SendTask9: Sending "ping 9892" from mcu2_1 to C7X_1...
    [IPC] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> debug info .................... ...NULL vq
    [IPC] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> debug info .................... ...NULL vq
    SendTask9: Received "Mmistral custom response [from C7x ]: remoteProcId:4 remoteEndPt:104 myEndPt:13 " len 80 from C7X_1 endPt 13
    SendTask9: Sending "ping 9893" from mcu2_1 to C7X_1...
    [IPC] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> debug info .................... ...NULL vq
    [IPC] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> debug info .................... ...NULL vq
    SendTask9: Received "Mmistral custom response [from C7x ]: remoteProcId:4 remoteEndPt:104 myEndPt:13 " len 80 from C7X_1 endPt 13
    SendTask9: Sending "ping 9894" from mcu2_1 to C7X_1...


    2.  As per your previous statement, we need to change only the remote proc id, and remote end points are dynamically assigned, 
        but still it is not working. 

      Please let me know what exactly I need to do to make it work. and let me know if I'm missing something.
        
       

    With regards,
    Sunil 




















  • Hello sunil,

    It is working fine in your initial case.

    since you modified the remote proc ID to C7x just before send API, the dynamic endpoint of some other remote Proc ID was used for C7x and trying to send and failing.

    You run the example as is and MCU2_1 will communicate with C7x along with other cores. with my endpoint as 13.

    Thats why you see earlier on trace that 10000 messages received successfully from MCU2_1 to C7x core .You are missing the flow of execution.

    Regards

    Tarun Mukesh

  • Hi Tarun,

    1. what is the flow, we should follow.  Please provide us with any reference. 

    With regards,
    Sunil 




  • Hello,

    In the rpmsg_senderFxn API , the destination proc will be passed as an argument and later RPMessage_getRemoteEndPt will be called to fetch the endpoint of the remote proc id.

    In your case , for some destination proc 104 is fetched and later you are passing the remote proc which eventually fails. By default the communication between MCU2_1 and C7x core was successful.

    R5F  <==> C7x (not working) 

    I didn't understand how you came to conclusion about this earlier without any error log.

    Regards

    Tarun Mukesh

  • Hi Tarun,

    1. Is there any example application for RpMsg between RTOS  <==> RTOS. 


    With regards,
    Sunil 




  • Hello sunil,

    ipc_rtos_echo_test example does communication between R5F cores.

    You can look into below URL for example details

    software-dl.ti.com/.../ipc.html

    Regards

    Tarun Mukesh

  • Hi Tarun,

    1. Is it okay to have single  RPMessage_create in a single application for both send and receive ??


     /* Create the endpoint for receiving. */
       RPMessageParams_init(&params);
        params.numBufs = 2;
        params.buf = buf1;
        params.bufSize = rpmsgDataSize;
        handle = RPMessage_create(&params, &myEndPt);
        if(!handle)
        {
            App_printf("SendTask%d: Failed to create message endpoint\n",
                    dstProc);
            return;
        }
    


    Or it should be separate ??

    With regards,
    Sunil A P





  • Hello sunil,

    yes you can use different end points to send and receive or same endpoint to send and receive .

    Regards

    Tarun Mukesh