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.

TDA4VH-Q1: How is the service response happeing on the MCU side for the IPC services example?

Part Number: TDA4VH-Q1

Tool/software:

I am running vision apps on the MCU1_0 ((/vision_apps/platform/j721e/rtos/mcu1_0/main.c)) and I am running the vx_app_arm_ipc.out binary (src/vision_apps/apps/utilities/app_ipc/main_ipc.c) on the QNX side.  What i understand is that the vx_app_arm_ipc.out  binary uses remote services.   But what is not clear is how is the firmware on MCU1_0  responding back. Which task is responsible for sending back  service response to the A72. Are both the MCU code and MPU code using same  app_remote_service_test.c file?

I want to modify the response of service cmd0 on the MCU side. On the QNX side the function looks like this.

(snippet from app_remote_service_test.c)

int32_t appRemoteServiceTestRunCmd0(uint32_t cpu_id)
{
    int32_t status = 0;
    volatile uint32_t value = 0;
    uint32_t i, count = 5;
    uint32_t test_pass = 1;

    appLogPrintf("REMOTE_SERVICE_TEST: Running test for CPU %s !!!\n",
        appIpcGetCpuName(cpu_id)
        );

    for(i=0; i<count; i++)
    {
        status = appRemoteServiceRun(cpu_id, APP_REMOTE_SERVICE_TEST_NAME, APP_REMOTE_SERVICE_TEST_CMD_0, (void*)&value, sizeof(uint32_t), 0);
        if(status!=0 || value != (i+1))
        {
            test_pass = 0;
            status = -1;
            break;
        }
    }
    if(test_pass)
    {   
    
        appLogPrintf("REMOTE_SERVICE_TEST: Test passed !!!\n");
        appLogPrintf("REMOTE_SERVICE_TEST1: Test passed with value %d!!!\n",value);
    }
    else
    {
        appLogPrintf("REMOTE_SERVICE_TEST: Test failed @ iteration %d !!!\n", i);
    }
    return status;
}

Where is the corresponding service response code on the MCU1_0 side? Is it using the same file ?

Secondly, It is not clear to me which task is then executing the service on the MCU1_0? I only see references to the services in the appInit(). But donot get it how is it continuously running and responding when i run the vx_app_arm_ipc.out on the QNX side. Please note that i am only concerned with the  services and not with the IPC ping pong messages.

Third question, I also noticed that the app_remote_service_test.c is built into a dynamically linkable library   and then vx_app_arm_ipc.out links to it during run time. It took me alot of time doing hit and trial to figure this out the hard way by analysing the binaries. Where is this dynamically linking behavior of this file defined in the concerto file?This understanding would help to understand the required dynamic and static libraries for a given binary.

  • Hello ,

    The expert is Out of office till next week , please expect delay in response.

    Regards

    Tarun Mukesh

  • Hi,

    Where is the corresponding service response code on the MCU1_0 side? Is it using the same file ?

    If you search the command id APP_REMOTE_SERVICE_TEST_CMD_0 in the same file, you can see it being part of a switch case in appRemoteServiceTestHandler().

    This is the registered callback which will execute for the service APP_REMOTE_SERVICE_TEST_NAME

    It is not clear to me which task is then executing the service on the MCU1_0? I only see references to the services in the appInit(). But donot get it how is it continuously running and responding when i run the vx_app_arm_ipc.out on the QNX side

    The task appRemoteServiceRxTaskMain() is a task created on MCU1_0 side during app_init() in the file app_remote_service.c. This inturn calls the registered handler as mentioned previously.

    I also noticed that the app_remote_service_test.c is built into a dynamically linkable library   and then vx_app_arm_ipc.out links to it during run time.

    app_utils_remote_serive is the library name for this utility. If you search this in the vision_Apps folder, you can see various hits on the concerto.mak files.

    In concerto_mpu_inc.mak, you can see this being add as a lib in the #else part of the code.

    This would be hit only for vision_apps/modules/concerto.mak, which is of TARGETTYPE = dsmo, which is dynamic library.

    Hope this answers all your query.

    Regards,

    Nikhil