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: Multiple zone errors while running an Application on TDA4

Part Number: TDA4VM


We have our own application and network that works fine when its is run on the simulator, but its getting issues when the same is run on the EVM.

root@j7-evm:/opt/vision_apps# ./vx_app_minerva.out --cfg app_minerva.cfg
APP: Init ... !!!
MEM: Init ... !!!
MEM: Initialized DMA HEAP (fd=4) !!!
MEM: Init ... Done !!!
IPC: Init ... !!!
IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
73.617091 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
73.623546 s: VX_ZONE_INIT:Enabled
73.623569 s: VX_ZONE_ERROR:Enabled
73.623580 s: VX_ZONE_WARNING:Enabled
73.627669 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
73.627853 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
Computing checksum at 0x0000FFFF9A1E8180, size = 699104
73.787430 s: VX_ZONE_ERROR:[vxSetGraphScheduleConfig:218] user parameter list (2) > number of graph parameters (1)
73.787461 s: VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2325] Invalid parameters
73.787475 s: VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2325] Invalid parameters
73.800826 s: VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message returned failure cmd_status: -7
73.800845 s: VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
73.800852 s: VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMD_NODE_CREATE failed for node PreProcNode
73.800858 s: VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the target callbacks have been registered for this core
73.800864 s: VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
73.800996 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 1, kernel com.ti.minerva.img.pre.proc ... failed !!!
73.801007 s: VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed
73.801013 s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
73.801382 s: VX_ZONE_ERROR:[tivxNodeSendCommandTimed:277] vxVerifyGraph should be called before tivxNodeSendCommand can be called on a node in the same graph
MSC: Node send command failed!
[C6x_1 ] 73.800714 s: VX_ZONE_ERROR:[tivxTargetKernelInstanceAlloc:115] kernel com.ti.minerva.img.pre.proc has not been registered on this CPU
[C6x_1 ] 73.800738 s: VX_ZONE_ERROR:[tivxTargetKernelInstanceAlloc:116] Please register this kernel on the appropriate target core
[C6x_1 ] 73.800759 s: VX_ZONE_ERROR:[tivxTargetNodeDescNodeCreate:761] target_kernel_instance is NULL
73.901480 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
73.903192 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
73.903203 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
74.301265 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
74.305635 s: VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
APP: Deinit ... !!!
REMOTE_SERVICE: Deinit ... !!!
REMOTE_SERVICE: Deinit ... Done !!!
IPC: Deinit ... !!!
IPC: DeInit ... Done !!!
MEM: Deinit ... !!!
MEM: Alloc's: 110 alloc's of 27735756 bytes
MEM: Free's : 110 free's of 27735756 bytes
MEM: Open's : 0 allocs of 0 bytes
MEM: Deinit ... Done !!!
APP: Deinit ... Done !!!

  • Amal,

    I think the main issue is in below statement.

    73.787430 s: VX_ZONE_ERROR:[vxSetGraphScheduleConfig:218] user parameter list (2) > number of graph parameters (1)

    It seems you are not using graph schedule mode from one of VX_GRAPH_SCHEDULE_MODE_NORMAL, VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO, VX_GRAPH_SCHEDULE_MODE_QUEUE_MANUAL. Can you please check?

    Regards,

    Brijesh

  • Hi Brijesh,

    Used the VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO mode in the application. Turns out it was an issue with adding "add_graph_parameter_by_node_index" function.

  • After the VX_ZONE_ERROR:[vxSetGraphScheduleConfig:218] user parameter list (2) > number of graph parameters (1) is resloved tried to run the application and got an issue like this,

    root@j7-evm:/opt/vision_apps# ./vx_app_minerva.out --cfg app_minerva.cfg
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    89.863225 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
    89.869526 s: VX_ZONE_INIT:Enabled
    89.869536 s: VX_ZONE_ERROR:Enabled
    89.869549 s: VX_ZONE_WARNING:Enabled
    89.873603 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
    89.873790 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    Computing checksum at 0x0000FFFFA2508180, size = 699104
    90.033388 s: VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2325] Invalid parameters
    90.033411 s: VX_ZONE_ERROR:[tivxSetNodeParameterNumBufByIndex:2325] Invalid parameters
    90.033657 s: VX_ZONE_ERROR:[ownGraphValidatePipelineParameters:947] Invalid pipelining parameters
    90.033664 s: VX_ZONE_ERROR:[ownGraphValidatePipelineParameters:948] Parameter image_175 of node MosaicNode has multiple buffers set both as a graph parameter and using tivxSetNodeParamx
    90.033672 s: VX_ZONE_ERROR:[vxVerifyGraph:1951] Error in pipelining parameters
    90.033677 s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
    90.033775 s: VX_ZONE_ERROR:[tivxNodeSendCommandTimed:277] vxVerifyGraph should be called before tivxNodeSendCommand can be called on a node in the same graph
    MSC: Node send command failed!
    90.134366 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    90.134388 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    90.553515 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
    90.557893 s: VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 22 alloc's of 8740132 bytes
    MEM: Free's : 22 free's of 8740132 bytes
    MEM: Open's : 0 allocs of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!

  • Hi,

    For tivxSetNodeParameterNumBufByIndex() are you following the below conditions?

    - The node parameter specified MUST be a output parameter
    - The node parameter specified MUST NOT be an enqueueable graph parameter
    - index provided should be less than number of params in the node
    - Buffer that is provided should be < 32


    Regards,
    Nikhil

  • Checked this, the parameters meet the said requirements.

  • Few doubts here,

    How do we set the index parameter in the  tivxSetNodeParameterNumBufByIndex function?

    And Tried to run the application in the sequential pipeline as well, which was used in the simulator, Getting an error like this

    root@j7-evm:/opt/vision_apps# ./vx_app_minerva.out --cfg app_minerva.cfg
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    72.737539 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
    72.743947 s: VX_ZONE_INIT:Enabled
    72.743959 s: VX_ZONE_ERROR:Enabled
    72.743972 s: VX_ZONE_WARNING:Enabled
    72.748153 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
    72.748342 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    Computing checksum at 0x0000FFFF7E3D8180, size = 699104

    ___________________Waiting done______________________
    App Create Graph Done!
    72.930846 s: VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message returned failure cmd_status: -7
    72.930865 s: VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
    72.930886 s: VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMD_NODE_CREATE failed for node PreProcNode
    72.930892 s: VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the target callbacks have been registered for this core
    72.930898 s: VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
    72.930905 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 1, kernel com.ti.minerva.img.pre.proc ... failed !!!
    72.930920 s: VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed
    72.930926 s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
    72.931289 s: VX_ZONE_ERROR:[tivxNodeSendCommandTimed:277] vxVerifyGraph should be called before tivxNodeSendCommand can be called on a node in the same graph
    MSC: Node send command failed!
    [C6x_1 ] 72.930736 s: VX_ZONE_ERROR:[tivxTargetKernelInstanceAlloc:115] kernel com.ti.minerva.img.pre.proc has not been registered on this CPU
    [C6x_1 ] 72.930761 s: VX_ZONE_ERROR:[tivxTargetKernelInstanceAlloc:116] Please register this kernel on the appropriate target core
    [C6x_1 ] 72.930781 s: VX_ZONE_ERROR:[tivxTargetNodeDescNodeCreate:761] target_kernel_instance is NULL
    App Verify Graph Done!
    73.032331 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    73.032344 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    73.438448 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
    73.442827 s: VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 63 alloc's of 21777316 bytes
    MEM: Free's : 63 free's of 21777316 bytes
    MEM: Open's : 0 allocs of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!

    And even if I fix the parameter issues from the above post I am still getting theVX_ZONE_ERROR:[ownGraphValidatePipelineParameters:947] Invalid pipelining parameters error.

  • Could you please support I am blocked here.

  • Hi,

    Could you confirm if you have called "tivxImgProcLoadKernels()" in your main source code?

    Is it possible to share your code for review?

    Regards,
    Nikhil

  • I have used the "tivxImgProcLoadKernels" in the main source code. Sharing the main.c for your reference. and could you tell me How do we set the index parameter in the  tivxSetNodeParameterNumBufByIndex function?

    /*
     *
     * Copyright (c) 2017 Texas Instruments Incorporated
     *
     * All rights reserved not granted herein.
     *
     * Limited License.
     *
     * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
     * license under copyrights and patents it now or hereafter owns or controls to make,
     * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
     * terms herein.  With respect to the foregoing patent license, such license is granted
     * solely to the extent that any such patent is necessary to Utilize the software alone.
     * The patent license shall not apply to any combinations which include this software,
     * other than combinations with devices manufactured by or for TI ("TI Devices").
     * No hardware patent is licensed hereunder.
     *
     * Redistributions must preserve existing copyright notices and reproduce this license
     * (including the above copyright notice and the disclaimer and (if applicable) source
     * code license limitations below) in the documentation and/or other materials provided
     * with the distribution
     *
     * Redistribution and use in binary form, without modification, are permitted provided
     * that the following conditions are met:
     *
     * *       No reverse engineering, decompilation, or disassembly of this software is
     * permitted with respect to any software provided in binary form.
     *
     * *       any redistribution and use are licensed by TI for use only with TI Devices.
     *
     * *       Nothing shall obligate TI to provide you with source code for the software
     * licensed and provided to you in object code.
     *
     * If software source code is provided to you, modification and redistribution of the
     * source code are permitted provided that the following conditions are met:
     *
     * *       any redistribution and use of the source code, including any resulting derivative
     * works, are licensed by TI for use only with TI Devices.
     *
     * *       any redistribution and use of any object code compiled from the source code
     * and any resulting derivative works, are licensed by TI for use only with TI Devices.
     *
     * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
     *
     * may be used to endorse or promote products derived from this software without
     * specific prior written permission.
     *
     * DISCLAIMER.
     *
     * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
     * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
     * OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */
    
    #include <utils/draw2d/include/draw2d.h>
    #include <utils/perf_stats/include/app_perf_stats.h>
    #include <utils/console_io/include/app_get.h>
    #include <utils/grpx/include/app_grpx.h>
    #include <VX/vx_khr_pipelining.h>
    
    #include "app_common.h"
    #include "app_scaler_module.h"
    #include "app_pre_proc_module_old.h"
    #include "app_tidl_module.h"
    #include "app_seg_post_proc_module.h"
    #include "app_od_post_proc_module.h"
    #include "app_draw_detections_module.h"
    #include "app_img_mosaic_module.h"
    #include "app_display_module.h"
    
    //#define WRITE_INTERMEDIATE_OUTPUTS
    
    #ifndef x86_64
    //#define APP_ENABLE_PIPELINE_FLOW
    #endif
    
    
    #define APP_BUFFER_Q_DEPTH   (2)
    #define APP_PIPELINE_DEPTH   (6)
    
    #define SEG_OUTPUT_IDX  (0)
    #define OD_OUTPUT_IDX   (1)
    #define SOIL_OUTPUT_IDX (2)
    
    typedef struct {
    
        ScalerObj  scalerObj;
        PreProcObj preProcObj;
    
        TIDLObj tidlObj;
    
        SegPostProcObj segPostProcObj;
        ODPostProcObj odPostProcObj;
        ODPostProcObj soilPostProcObj;
    
        DrawDetectionsObj odDrawDetectionsObj;
        DrawDetectionsObj soilDrawDetectionsObj;
    
        ImgMosaicObj imgMosaicObj;
    
        DisplayObj displayObj;
    
        vx_char input_file_path[APP_MAX_FILE_PATH];
        vx_char output_file_path[APP_MAX_FILE_PATH];
    
        /* OpenVX references */
        vx_context context;
        vx_graph   graph;
    
        vx_int32 en_out_img_write;
    
        vx_int32 start_frame;
        vx_int32 num_frames;
    
        vx_uint32 delay_in_msecs;
        vx_uint32 num_iterations;
        vx_uint32 is_interactive;
    
        tivx_task task;
        vx_uint32 stop_task;
        vx_uint32 stop_task_done;
    
        app_perf_point_t total_perf;
        app_perf_point_t fileio_perf;
        app_perf_point_t draw_perf;
    
        int32_t pipeline;
    
        int32_t enqueueCnt;
        int32_t dequeueCnt;
    
    } AppObj;
    
    AppObj gAppObj;
    
    /* Provide segmentation color map in RGB format */
    static const vx_uint8 seg_color_map[5][3] = {{152,251,152},{0,130,180},{220,20,60},{3,3,251},{190,153,153}};
    /* Provide OD color map in YUV format */
    static const vx_uint8 od_color_map[5][3] = {{210,95,86},{96,174,58},{84,114,224},{31,252,107},{164,121,146}};
    
    static void app_parse_cmd_line_args(AppObj *obj, vx_int32 argc, vx_char *argv[]);
    static int app_init(AppObj *obj);
    static void app_deinit(AppObj *obj);
    static vx_status app_create_graph(AppObj *obj);
    static vx_status app_verify_graph(AppObj *obj);
    static vx_status app_run_graph(AppObj *obj);
    static vx_status app_run_graph_interactive(AppObj *obj);
    static void app_delete_graph(AppObj *obj);
    static void app_default_param_set(AppObj *obj);
    static void app_update_param_set(AppObj *obj);
    
    
    #ifndef x86_64
    static void app_draw_graphics(Draw2D_Handle *handle, Draw2D_BufInfo *draw2dBufInfo, uint32_t update_type);
    #endif
    #ifdef APP_ENABLE_PIPELINE_FLOW
    static void app_pipeline_params_defaults(AppObj *obj);
    static void add_graph_parameter_by_node_index(vx_graph graph, vx_node node, vx_uint32 node_parameter_index);
    static void app_find_object_array_index(vx_object_array object_array[], vx_reference ref, vx_int32 array_size, vx_int32 *array_idx);
    static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id);
    #else
    static vx_status app_run_graph_for_one_frame_sequential(AppObj *obj, vx_int32 frame_id);
    #endif
    
    static void app_show_usage(vx_int32 argc, vx_char* argv[])
    {
        printf("\n");
        printf(" Minerva Demo - (c) Valeo 2020\n");
        printf(" ========================================================\n");
        printf("\n");
        printf(" Usage,\n");
        printf("  %s --cfg <config file>\n", argv[0]);
        printf("\n");
    }
    
    static char menu[] = {
        "\n"
        "\n ========================="
        "\n Demo : Minerva Demo"
        "\n ========================="
        "\n"
        "\n p: Print performance statistics"
        "\n"
        "\n x: Exit"
        "\n"
        "\n Enter Choice: "
    };
    
    static void app_run_task(void *app_var)
    {
        AppObj *obj = (AppObj *)app_var;
    
        while(!obj->stop_task)
        {
            app_run_graph(obj);
        }
        obj->stop_task_done = 1;
    }
    
    static int32_t app_run_task_create(AppObj *obj)
    {
        tivx_task_create_params_t params;
        int32_t status;
    
        tivxTaskSetDefaultCreateParams(&params);
        params.task_main = app_run_task;
        params.app_var = obj;
    
        obj->stop_task_done = 0;
        obj->stop_task = 0;
    
        status = tivxTaskCreate(&obj->task, &params);
    
        return status;
    }
    
    static void app_run_task_delete(AppObj *obj)
    {
        while(obj->stop_task_done==0)
        {
             tivxTaskWaitMsecs(100);
        }
    
        tivxTaskDelete(&obj->task);
    }
    
    static vx_status app_run_graph_interactive(AppObj *obj)
    {
        vx_status status;
        uint32_t done = 0;
        char ch;
    
        status = app_run_task_create(obj);
        if(status!=0)
        {
            printf("app_tidl: ERROR: Unable to create task\n");
        }
        else
        {
            appPerfStatsResetAll();
            while(!done)
            {
                printf(menu);
                ch = getchar();
                printf("\n");
    
                switch(ch)
                {
                    case 'p':
                        appPerfStatsPrintAll();
                        tivx_utils_graph_perf_print(obj->graph);
                        appPerfPointPrint(&obj->fileio_perf);
                        appPerfPointPrint(&obj->total_perf);
                        printf("\n");
                        appPerfPointPrintFPS(&obj->total_perf);
                        printf("\n");
    
                        break;
    
                    case 'x':
                        obj->stop_task = 1;
                        done = 1;
                        break;
                }
            }
            app_run_task_delete(obj);
        }
        return status;
    }
    
    static void app_set_cfg_default(AppObj *obj)
    {
        snprintf(obj->tidlObj.config_file_path,APP_MAX_FILE_PATH, ".");
        snprintf(obj->tidlObj.network_file_path,APP_MAX_FILE_PATH, ".");
    
        snprintf(obj->input_file_path,APP_MAX_FILE_PATH, ".");
    
    }
    
    static void app_parse_cfg_file(AppObj *obj, vx_char *cfg_file_name)
    {
        FILE *fp = fopen(cfg_file_name, "r");
        vx_char line_str[1024];
        vx_char *token;
    
        if(fp==NULL)
        {
            printf("# ERROR: Unable to open config file [%s]\n", cfg_file_name);
            exit(0);
        }
    
        while(fgets(line_str, sizeof(line_str), fp)!=NULL)
        {
            vx_char s[]=" \t";
    
            if (strchr(line_str, '#'))
            {
                continue;
            }
    
            /* get the first token */
            token = strtok(line_str, s);
            if(token != NULL)
            {
                if(strcmp(token, "tidl_config")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      strcpy(obj->tidlObj.config_file_path, token);
                    }
                }
                else
                if(strcmp(token, "tidl_network")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      strcpy(obj->tidlObj.network_file_path, token);
                    }
                }
                else
                if(strcmp(token, "input_file_path")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      strcpy(obj->input_file_path, token);
                    }
                }
                else
                if(strcmp(token, "output_file_path")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      strcpy(obj->output_file_path, token);
                    }
                }
                else
                if(strcmp(token, "start_frame")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      obj->start_frame = atoi(token);
                    }
                }
                else
                if(strcmp(token, "num_frames")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      obj->num_frames = atoi(token);
                    }
                }
                else
                if(strcmp(token, "in_size")==0)
                {
                    vx_int32 width, height;
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      width =  atoi(token);
                      obj->scalerObj.input.width  = width;
                      obj->scalerObj.output1.width  = width;
    
                      token = strtok(NULL, s);
                      if(token != NULL)
                      {
                        if (token[strlen(token)-1] == '\n')
                          token[strlen(token)-1]=0;
    
                        height =  atoi(token);
                        obj->scalerObj.input.height = height;
                        obj->scalerObj.output1.height = height;
                      }
                    }
                }
                else
                if(strcmp(token, "out_size")==0)
                {
                    vx_int32 width, height;
    
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      width =  atoi(token);
                      obj->scalerObj.output2.width   = width;
    
                      token = strtok(NULL, s);
                      if(token != NULL)
                      {
                        if(token[strlen(token)-1] == '\n')
                          token[strlen(token)-1]=0;
    
                        height =  atoi(token);
                        obj->scalerObj.output2.height  = height;
                      }
                    }
                }
                else
                if(strcmp(token, "viz_th")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      obj->odDrawDetectionsObj.params.viz_th = atof(token);
    
                      token = strtok(NULL, s);
                      if(token != NULL)
                      {
                        if (token[strlen(token)-1] == '\n')
                          token[strlen(token)-1]=0;
    
                        obj->soilDrawDetectionsObj.params.viz_th = atof(token);
                      }
                    }
                }
                else
                if(strcmp(token, "num_classes")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                        obj->segPostProcObj.viz_params.num_classes[0] = atoi(token);
    
                        token = strtok(NULL, s);
                        if(token != NULL)
                        {
                            obj->odDrawDetectionsObj.params.num_classes = atoi(token);
    
                            token = strtok(NULL, s);
                            if(token != NULL)
                            {
                                obj->soilDrawDetectionsObj.params.num_classes = atoi(token);
                            }
                        }
                    }
                }
                else
                if(strcmp(token, "en_out_img_write")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      obj->en_out_img_write = atoi(token);
                    }
                }
                else
                if(strcmp(token, "display_option")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      obj->displayObj.display_option = atoi(token);
                    }
                }
                else
                if(strcmp(token, "delay_in_msecs")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      obj->delay_in_msecs = atoi(token);
                      if(obj->delay_in_msecs > 2000)
                        obj->delay_in_msecs = 2000;
                    }
                }
                else
                if(strcmp(token, "num_iterations")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      obj->num_iterations = atoi(token);
                      if(obj->num_iterations == 0)
                        obj->num_iterations = 1;
                    }
                }
                else
                if(strcmp(token, "is_interactive")==0)
                {
                    token = strtok(NULL, s);
                    if(token != NULL)
                    {
                      token[strlen(token)-1]=0;
                      obj->is_interactive = atoi(token);
                      if(obj->is_interactive > 1)
                        obj->is_interactive = 1;
                    }
                }
            }
        }
    
        fclose(fp);
    }
    
    static void app_parse_cmd_line_args(AppObj *obj, vx_int32 argc, vx_char *argv[])
    {
        vx_int32 i;
    
        app_set_cfg_default(obj);
    
        if(argc==1)
        {
            app_show_usage(argc, argv);
            exit(0);
        }
    
        for(i=0; i<argc; i++)
        {
            if(strcmp(argv[i], "--cfg")==0)
            {
                i++;
                if(i>=argc)
                {
                    app_show_usage(argc, argv);
                }
                app_parse_cfg_file(obj, argv[i]);
                break;
            }
            else
            if(strcmp(argv[i], "--help")==0)
            {
                app_show_usage(argc, argv);
                exit(0);
            }
        }
    
        #ifdef x86_64
        obj->displayObj.display_option = 0;
        obj->is_interactive = 0;
        #endif
    
        return;
    }
    
    vx_int32 app_minerva_main(vx_int32 argc, vx_char* argv[])
    {
        vx_status status = VX_SUCCESS;
    
        AppObj *obj = &gAppObj;
    
        /*Optional parameter setting*/
        app_default_param_set(obj);
        APP_PRINTF("App set default params Done! \n");
    
        /*Config parameter reading*/
        app_parse_cmd_line_args(obj, argc, argv);
        APP_PRINTF("App Parse User params Done! \n");
    
        /*Update of parameters are config file read*/
        app_update_param_set(obj);
        APP_PRINTF("App Update Params Done! \n");
    
        app_init(obj);
        APP_PRINTF("App Init Done! \n");
    
        app_create_graph(obj);
        printf("App Create Graph Done! \n");
    
        status = app_verify_graph(obj);
        printf("App Verify Graph Done! \n");
    
        if(status == VX_SUCCESS)
        {
            if(obj->is_interactive)
            {
              app_run_graph_interactive(obj);
            }
            else
            {
              app_run_graph(obj);
            }
    
            APP_PRINTF("App Run Graph Done! \n");
        }
    
        app_delete_graph(obj);
        APP_PRINTF("App Delete Graph Done! \n");
    
        app_deinit(obj);
        APP_PRINTF("App De-init Done! \n");
    
        return status;
    }
    
    #ifdef APP_ENABLE_PIPELINE_FLOW
    /*
     * Utility API used to add a graph parameter from a node, node parameter index
     */
    static void add_graph_parameter_by_node_index(vx_graph graph, vx_node node, vx_uint32 node_parameter_index)
    {
        vx_parameter parameter = vxGetParameterByIndex(node, node_parameter_index);
    
        vxAddParameterToGraph(graph, parameter);
        vxReleaseParameter(&parameter);
    }
    #endif
    
    static int app_init(AppObj *obj)
    {
        int status = VX_SUCCESS;
        app_grpx_init_prms_t grpx_prms;
    
        /* Create OpenVx Context */
        obj->context = vxCreateContext();
        APP_ASSERT_VALID_REF(obj->context);
    
        tivxHwaLoadKernels(obj->context);
        tivxImgProcLoadKernels(obj->context);
        tivxMinervaLoadKernels(obj->context);
        tivxTIDLLoadKernels(obj->context);
    
        /* Initialize modules */
        app_init_scaler(obj->context, &obj->scalerObj, "scaler_obj", APP_BUFFER_Q_DEPTH);
        APP_PRINTF("Scaler init done!\n");
    
        /* Initialize TIDL first to get tensor I/O information from network */
        app_init_tidl(obj->context, &obj->tidlObj, "tidl_obj");
        APP_PRINTF("TIDL init done!\n");
    
        app_update_pre_proc(obj->context, &obj->preProcObj, obj->tidlObj.config);
        app_init_pre_proc(obj->context, &obj->preProcObj, "pre_proc_obj");
        APP_PRINTF("Pre Proc init done!\n");
    
        app_update_seg_post_proc(&obj->segPostProcObj, obj->tidlObj.config, SEG_OUTPUT_IDX);
        APP_PRINTF("Seg Post Proc update done!\n");
        app_init_seg_post_proc(obj->context, &obj->segPostProcObj, "seg_post_proc");
        APP_PRINTF("Seg Post Proc init done!\n");
    
        app_update_od_post_proc(&obj->odPostProcObj, obj->tidlObj.config, OD_OUTPUT_IDX);
        APP_PRINTF("OD Post Proc update done!\n");
        app_init_od_post_proc(obj->context, &obj->odPostProcObj, "od_post_proc");
        APP_PRINTF("OD Post Proc init done!\n");
    
        //app_update_od_post_proc(&obj->soilPostProcObj, obj->tidlObj.config, SOIL_OUTPUT_IDX);
        //APP_PRINTF("Soil Post Proc update done!\n");
        //app_init_od_post_proc(obj->context, &obj->soilPostProcObj, "soil_post_proc");
        //APP_PRINTF("Soil Post Proc init done!\n");
    
        app_update_draw_detections(&obj->odDrawDetectionsObj, obj->tidlObj.config);
        APP_PRINTF("OD Draw Det update done!\n");
        app_init_draw_detections(obj->context, &obj->odDrawDetectionsObj, "od_draw_det_obj");
        APP_PRINTF("OD Draw Det init done!\n");
    
        //app_update_draw_detections(&obj->soilDrawDetectionsObj, obj->tidlObj.config);
        //APP_PRINTF("Soil Draw Det update done!\n");
        //app_init_draw_detections(obj->context, &obj->soilDrawDetectionsObj, "soil_draw_det_obj");
        //APP_PRINTF("Soil Draw Det init done!\n");
    
        app_init_img_mosaic(obj->context, &obj->imgMosaicObj, "mosaic_obj", APP_BUFFER_Q_DEPTH);
        APP_PRINTF("Mosaic init done!\n");
    
        app_init_display(obj->context, &obj->displayObj, "display_obj");
        APP_PRINTF("Display init done!\n");
    
        appPerfPointSetName(&obj->total_perf , "TOTAL");
        appPerfPointSetName(&obj->fileio_perf, "FILEIO");
    
        #ifndef x86_64
        if(obj->displayObj.display_option == 1)
        {
          appGrpxInitParamsInit(&grpx_prms, obj->context);
          grpx_prms.draw_callback = app_draw_graphics;
          appGrpxInit(&grpx_prms);
        }
        #endif
    
        return status;
    }
    
    static void app_deinit(AppObj *obj)
    {
        app_deinit_scaler(&obj->scalerObj, APP_BUFFER_Q_DEPTH);
    
        app_deinit_pre_proc(&obj->preProcObj);
    
        app_deinit_tidl(&obj->tidlObj);
    
        app_deinit_seg_post_proc(&obj->segPostProcObj);
    
        app_deinit_od_post_proc(&obj->odPostProcObj);
    
        //app_deinit_od_post_proc(&obj->soilPostProcObj);
    
        app_deinit_draw_detections(&obj->odDrawDetectionsObj);
    
        app_deinit_draw_detections(&obj->soilDrawDetectionsObj);
    
        app_deinit_img_mosaic(&obj->imgMosaicObj, APP_BUFFER_Q_DEPTH);
    
        app_deinit_display(&obj->displayObj);
    
        #ifndef x86_64
        if(obj->displayObj.display_option == 1)
        {
          appGrpxDeInit();
        }
        #endif
    
        tivxTIDLUnLoadKernels(obj->context);
        tivxMinervaUnLoadKernels(obj->context);
        tivxImgProcUnLoadKernels(obj->context);
        tivxHwaUnLoadKernels(obj->context);
    
        vxReleaseContext(&obj->context);
    }
    
    static void app_delete_graph(AppObj *obj)
    {
        app_delete_scaler(&obj->scalerObj);
    
        app_delete_pre_proc(&obj->preProcObj);
    
        app_delete_tidl(&obj->tidlObj);
    
        app_delete_seg_post_proc(&obj->segPostProcObj);
    
        app_delete_od_post_proc(&obj->odPostProcObj);
    
        //app_delete_od_post_proc(&obj->soilPostProcObj);
    
        app_delete_draw_detections(&obj->odDrawDetectionsObj);
    
        app_delete_draw_detections(&obj->soilDrawDetectionsObj);
    
        app_delete_img_mosaic(&obj->imgMosaicObj);
    
        app_delete_display(&obj->displayObj);
    
        vxReleaseGraph(&obj->graph);
    }
    
    static vx_status app_create_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
    
        obj->graph = vxCreateGraph(obj->context);
        status = vxGetStatus((vx_reference)obj->graph);
        vxSetReferenceName((vx_reference)obj->graph, "app_minerva_graph");
    
        app_create_graph_scaler(obj->context, obj->graph, &obj->scalerObj);
        APP_PRINTF("Scaler create graph done!\n");
    
        app_create_graph_pre_proc(obj->graph, &obj->preProcObj, obj->scalerObj.output1.arr[0]);
        APP_PRINTF("Pre Proc create graph done!\n");
    
        app_create_graph_tidl(obj->context, obj->graph, &obj->tidlObj, obj->preProcObj.output_tensor_arr);
        APP_PRINTF("TIDL create graph done!\n");
    
        app_create_graph_seg_post_proc(obj->graph, &obj->segPostProcObj, obj->scalerObj.output2.arr[0], obj->tidlObj.out_args_arr, obj->tidlObj.output_tensor_arr[0]);
        APP_PRINTF("Seg post proc create graph done!\n");
    
        app_create_graph_od_post_proc(obj->graph, &obj->odPostProcObj, obj->tidlObj.out_args_arr, obj->tidlObj.output_tensor_arr[1]);
        APP_PRINTF("OD post proc create graph done!\n");
    /*
        app_create_graph_od_post_proc(obj->graph, &obj->soilPostProcObj, obj->tidlObj.out_args_arr, obj->tidlObj.output_tensor_arr[2]);
        APP_PRINTF("Soil post proc create graph done!\n");
    */
    
        app_create_graph_draw_detections(obj->graph, &obj->odDrawDetectionsObj, obj->odPostProcObj.output_tensor_arr[0], obj->segPostProcObj.output_image_arr);
        APP_PRINTF("OD draw det create graph done!\n");
    /*
        app_create_graph_draw_detections(obj->graph, &obj->soilDrawDetectionsObj, obj->tidlObj.output_tensor_arr[2], obj->odDrawDetectionsObj.output_image_arr);
        APP_PRINTF("Soil draw det create graph done!\n");
    */
        vx_int32 idx = 0;
        /*Select only one of the below 3 statements as the new output is shown on top of previous output */
        //obj->imgMosaicObj.input_arr[idx++] = obj->segPostProcObj.output_image_arr;
        obj->imgMosaicObj.input_arr[idx++] = obj->odDrawDetectionsObj.output_image_arr;
        //obj->imgMosaicObj.input_arr[idx++] = obj->soilDrawDetectionsObj.output_image_arr;
        obj->imgMosaicObj.num_inputs = idx;
    
        app_create_graph_img_mosaic(obj->graph, &obj->imgMosaicObj);
        APP_PRINTF("Mosaic create graph done!\n");
    
        app_create_graph_display(obj->graph, &obj->displayObj, obj->imgMosaicObj.output_image[0]);
        APP_PRINTF("Display create graph done!\n");
    
    #ifdef APP_ENABLE_PIPELINE_FLOW
        vx_int32 graph_parameter_index;
        vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[2];
        /* Scalar Node - input is in Index 0 */
        graph_parameter_index = 0;
        add_graph_parameter_by_node_index(obj->graph, obj->scalerObj.node, 0);
        obj->scalerObj.graph_parameter_index = graph_parameter_index;
        graph_parameters_queue_params_list[graph_parameter_index].graph_parameter_index = graph_parameter_index;
        graph_parameters_queue_params_list[graph_parameter_index].refs_list_size = APP_BUFFER_Q_DEPTH;
        graph_parameters_queue_params_list[graph_parameter_index].refs_list = (vx_reference*)&obj->scalerObj.input_images[0];
        graph_parameter_index++;
    
        if (obj->en_out_img_write == 1)
        {
          add_graph_parameter_by_node_index(obj->graph, obj->imgMosaicObj.node, 1);
          obj->imgMosaicObj.graph_parameter_index = graph_parameter_index;
          graph_parameters_queue_params_list[graph_parameter_index].graph_parameter_index = graph_parameter_index;
          graph_parameters_queue_params_list[graph_parameter_index].refs_list_size = APP_BUFFER_Q_DEPTH;
          graph_parameters_queue_params_list[graph_parameter_index].refs_list = (vx_reference*)&obj->imgMosaicObj.output_image[0];
          graph_parameter_index++;
        }
    
        vxSetGraphScheduleConfig(obj->graph,
                VX_GRAPH_SCHEDULE_MODE_QUEUE_AUTO,
                graph_parameter_index,
                graph_parameters_queue_params_list);
    
        tivxSetGraphPipelineDepth(obj->graph, APP_PIPELINE_DEPTH);
    
        tivxSetNodeParameterNumBufByIndex(obj->scalerObj.node, 1, 6);
        printf("\nScalar params 1\n");
        //tivxSetNodeParameterNumBufByIndex(obj->scalerObj.node, 1, 6);
        printf("Scalar params 2\n");
    
        tivxSetNodeParameterNumBufByIndex(obj->preProcObj.node, 2, 2);
        printf("preproc params 1\n");
        //tivxSetNodeParameterNumBufByIndex(obj->preProcObj.node, 2, 5);
    
        tivxSetNodeParameterNumBufByIndex(obj->tidlObj.node, 4, 3);
        printf("tidl params 1\n");
        tivxSetNodeParameterNumBufByIndex(obj->tidlObj.node, 7, 3);
        printf("tidl params 2\n");
        //tivxSetNodeParameterNumBufByIndex(obj->tidlObj.node, 9, 2);
    
        tivxSetNodeParameterNumBufByIndex(obj->segPostProcObj.node, 4, 2);
        printf("seg params 1\n");
    
    
        tivxSetNodeParameterNumBufByIndex(obj->odPostProcObj.node, 5, 2);
    
    
        printf("post proc 1\n");
    /*
        tivxSetNodeParameterNumBufByIndex(obj->soilPostProcObj.node, 4, 2);
    */
    
       tivxSetNodeParameterNumBufByIndex(obj->odDrawDetectionsObj.node, 5, 2);
       printf("obj detection 1\n");
    
    /*
       tivxSetNodeParameterNumBufByIndex(obj->soilDrawDetectionsObj.node, 5, 2);
    
    */
    
        tivxSetNodeParameterNumBufByIndex(obj->imgMosaicObj.node, 1, 4);
        printf("Mosaic detection 1\n");
    
    #endif
    
        return status;
    }
    
    static vx_status app_verify_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
    
        ScalerObj *scalerObj;
        vx_reference refs[1];
    
        status = vxVerifyGraph(obj->graph);
    
        if(VX_SUCCESS == status)
        {
          status = tivxExportGraphToDot(obj->graph,".", "vx_app_minerva");
        }
    
        scalerObj = &obj->scalerObj;
    
        refs[0] = (vx_reference)scalerObj->coeff_obj;
    
        status = tivxNodeSendCommand(scalerObj->node, 0u,
                                     TIVX_VPAC_MSC_CMD_SET_COEFF,
                                     refs, 1u);
    
        APP_PRINTF("App Send MSC Command Done!\n");
    
        if(VX_SUCCESS != status)
        {
            printf("MSC: Node send command failed!\n");
        }
    
        /* wait a while for prints to flush */
        tivxTaskWaitMsecs(100);
    
        return status;
    }
    
    #ifndef APP_ENABLE_PIPELINE_FLOW
    static vx_status app_run_graph_for_one_frame_sequential(AppObj *obj, vx_int32 frame_id)
    {
      vx_status status = VX_SUCCESS;
    
      vx_char input_file_name[APP_MAX_FILE_PATH];
    
      ScalerObj *scalerObj = &obj->scalerObj;
    
      snprintf(input_file_name, APP_MAX_FILE_PATH, "%s/%010d.yuv", obj->input_file_path, frame_id);
    
      appPerfPointBegin(&obj->total_perf);
      appPerfPointBegin(&obj->fileio_perf);
    
      readScalerInput(input_file_name, scalerObj->input.arr[0], NUM_CH);
    
      appPerfPointEnd(&obj->fileio_perf);
    
      printf("App Reading Input Done!\n");
    
      #ifdef x86_64
      printf("Processing file %s ...", input_file_name);
      #endif
    
      status = vxProcessGraph(obj->graph);
    
      #ifdef x86_64
      printf("Done!\n");
      #endif
    
      APP_PRINTF("App Process Graph Done!\n");
    
      if((VX_SUCCESS == status) && (obj->en_out_img_write == 1))
      {
    
    
        APP_PRINTF("App Writing Outputs Start...\n");
    
    #ifdef WRITE_INTERMEDIATE_OUTPUTS
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/%010d_scaler_1024x384.yuv", obj->output_file_path, frame_id);
        writeScalerOutput(output_file_name, scalerObj->output1.arr[0]);
    
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/%010d_scaler_512x192.yuv", obj->output_file_path, frame_id);
        writeScalerOutput(output_file_name, scalerObj->output2.arr[0]);
    
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/pre_proc_%010d", obj->output_file_path, frame_id);
        writePreProcOutput(output_file_name, &obj->preProcObj);
    
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/sem_seg_%010d_1024x384.yuv", obj->output_file_path, frame_id);
        writeScalerOutput(output_file_name, obj->segPostProcObj.output_image_arr);
    
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/tidl_sem_seg_%010d", obj->output_file_path, frame_id);
        writeTIDLOutput(output_file_name, &obj->tidlObj);
    
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/psd_output_%010d", obj->output_file_path, frame_id);
        writePostProcOutput(output_file_name, obj->odDrawDetectionsObj.output_image_arr);
    
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/soil_output_%010d", obj->output_file_path, frame_id);
        writePostProcOutput(output_file_name, obj->soilDrawDetectionsObj.output_image_arr);
    
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/mosaic_output_%010d_1920x1080.yuv", obj->output_file_path, frame_id);
        writeMosaicOutput(output_file_name, obj->imgMosaicObj.output_image[0]);
    #endif
    
    #ifdef x86_64
        vx_char output_file_name[APP_MAX_FILE_PATH];
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/tidl_sem_seg_%010d", obj->output_file_path, frame_id);
        printf("Processing out file %s ...", output_file_name);
        writeTIDLOutput(output_file_name, &obj->tidlObj);
        snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/mosaic_output_%010d_1920x1080.yuv", obj->output_file_path, frame_id);
        writeMosaicOutput(output_file_name, obj->imgMosaicObj.output_image[0]);
    #endif
    
        APP_PRINTF("App Writing Outputs Done!\n");
      }
    
      appPerfPointEnd(&obj->total_perf);
    
      return status;
    }
    #else
    static vx_status app_run_graph_for_one_frame_pipeline(AppObj *obj, vx_int32 frame_id)
    {
      vx_status status = VX_SUCCESS;
    
      vx_char input_file_name[APP_MAX_FILE_PATH];
      vx_int32 obj_array_idx = -1;
    
      ScalerObj    *scalerObj    = &obj->scalerObj;
      ImgMosaicObj *imgMosaicObj = &obj->imgMosaicObj;
    
      snprintf(input_file_name, APP_MAX_FILE_PATH, "%s/%010d.yuv", obj->input_file_path, frame_id);
    
      appPerfPointBegin(&obj->total_perf);
    
      if(obj->pipeline < 0)
      {
        /* Enqueue outpus */
        if (obj->en_out_img_write == 1)
        {
          vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&imgMosaicObj->output_image[obj->enqueueCnt], 1);
        }
    
        appPerfPointBegin(&obj->fileio_perf);
        /* Read input */
        readScalerInput(input_file_name, scalerObj->input.arr[obj->enqueueCnt], NUM_CH);
    
        appPerfPointEnd(&obj->fileio_perf);
    
        APP_PRINTF("App Reading Input Done!\n");
    
        /* Enqueue input - start execution */
        vxGraphParameterEnqueueReadyRef(obj->graph, scalerObj->graph_parameter_index, (vx_reference*)&obj->scalerObj.input_images[obj->enqueueCnt], 1);
    
        obj->enqueueCnt++;
        obj->enqueueCnt   = (obj->enqueueCnt  >= APP_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
        obj->pipeline++;
      }
    
      if(obj->pipeline >= 0)
      {
        vx_image scaler_input_image;
        vx_image mosaic_output_image;
        uint32_t num_refs;
    
        /* Dequeue input */
        vxGraphParameterDequeueDoneRef(obj->graph, scalerObj->graph_parameter_index, (vx_reference*)&scaler_input_image, 1, &num_refs);
    
        if(obj->en_out_img_write == 1)
        {
          vx_char output_file_name[APP_MAX_FILE_PATH];
    
          /* Dequeue output */
          vxGraphParameterDequeueDoneRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&mosaic_output_image, 1, &num_refs);
    
          APP_PRINTF("App Writing Outputs Start...\n");
    
          snprintf(output_file_name, APP_MAX_FILE_PATH, "%s/mosaic_output_%010d_1920x1080.yuv", obj->output_file_path, (frame_id - APP_BUFFER_Q_DEPTH));
          writeMosaicOutput(output_file_name, mosaic_output_image);
    
          APP_PRINTF("App Writing Outputs Done!\n");
    
          /* Enqueue output */
          vxGraphParameterEnqueueReadyRef(obj->graph, imgMosaicObj->graph_parameter_index, (vx_reference*)&mosaic_output_image, 1);
        }
    
        appPerfPointBegin(&obj->fileio_perf);
    
        app_find_object_array_index(scalerObj->input.arr, (vx_reference)scaler_input_image, APP_BUFFER_Q_DEPTH, &obj_array_idx);
        if(obj_array_idx != -1) {
          readScalerInput(input_file_name, scalerObj->input.arr[obj_array_idx], NUM_CH);
        }
    
        appPerfPointEnd(&obj->fileio_perf);
    
        APP_PRINTF("App Reading Input Done!\n");
    
        /* Enqueue input - start execution */
        vxGraphParameterEnqueueReadyRef(obj->graph, scalerObj->graph_parameter_index, (vx_reference*)&scaler_input_image, 1);
    
        obj->enqueueCnt++;
        obj->dequeueCnt++;
    
        obj->enqueueCnt = (obj->enqueueCnt >= APP_BUFFER_Q_DEPTH)? 0 : obj->enqueueCnt;
        obj->dequeueCnt = (obj->dequeueCnt >= APP_BUFFER_Q_DEPTH)? 0 : obj->dequeueCnt;
    
      }
    
      appPerfPointEnd(&obj->total_perf);
    
      APP_PRINTF("App Process Graph Done!\n");
    
      return status;
    }
    #endif
    
    static vx_status app_run_graph(AppObj *obj)
    {
        vx_status status = VX_SUCCESS;
        uint64_t cur_time;
    
        vx_int32 frame_id = obj->start_frame;
        vx_int32 x = 0;
    
    #ifdef APP_ENABLE_PIPELINE_FLOW
        app_pipeline_params_defaults(obj);
    #endif
    
        for(x = 0; x < obj->num_iterations; x++)
        {
            for(frame_id = obj->start_frame; frame_id < (obj->start_frame + obj->num_frames); frame_id++)
            {
                APP_PRINTF("Running frame %d\n", frame_id);
    
                vx_int32 count = 1;
    
                while (count > 0)
                {
                    cur_time = tivxPlatformGetTimeInUsecs();
    
                    #ifdef APP_ENABLE_PIPELINE_FLOW
                    app_run_graph_for_one_frame_pipeline(obj, frame_id);
                    #else
                    printf("\n .......Running in sequential mode........\n");
                    app_run_graph_for_one_frame_sequential(obj, frame_id);
                    #endif
    
                    cur_time = tivxPlatformGetTimeInUsecs() - cur_time;
                    /* convert to msecs */
                    cur_time = cur_time/1000;
    
                    if(cur_time < obj->delay_in_msecs)
                    {
                        tivxTaskWaitMsecs(obj->delay_in_msecs - cur_time);
                    }
    
                    APP_PRINTF("app_minerva: Frame ID %d of %d ... Done.\n", frame_id, obj->start_frame + obj->num_frames);
    
                    count--;
                }
                /* user asked to stop processing */
                if(obj->stop_task)
                  break;
            }
    
            printf("app_minerva: Iteration %d of %d ... Done.\n", x, obj->num_iterations);
    
            if(obj->stop_task)
              break;
        }
    
    #ifdef APP_ENABLE_PIPELINE_FLOW
        vxWaitGraph(obj->graph);
    #endif
    
        obj->stop_task = 1;
    
        return status;
    }
    
    static void set_pre_proc_defaults(PreProcObj *preProcObj)
    {
        vx_int32 i;
        for(i = 0; i < 4; i++ )
        {
            preProcObj->params.pad_pixel_y[i] = 0;
            preProcObj->params.pad_pixel_uv[i] = 0;
        }
    
        preProcObj->params.img_width_y = 0;
        preProcObj->params.img_height_y = 0;
    
        preProcObj->params.img_width_uv = 0;
        preProcObj->params.img_height_uv = 0;
    
        preProcObj->params.color_conv_flag = 1;
    }
    
    static void set_seg_post_proc_defaults(SegPostProcObj *postProcObj)
    {
        int32_t i;
    
        postProcObj->viz_params.ip_rgb_or_yuv = 1;
        postProcObj->viz_params.op_rgb_or_yuv = 1;
    
        postProcObj->viz_params.num_input_tensors  = 1;
        postProcObj->viz_params.num_output_tensors = 1;
    
        postProcObj->viz_params.tidl_8bit_16bit_flag = 0;
    
        postProcObj->viz_params.num_classes[0] = 5; //5 classes for semantic segmentation
        postProcObj->viz_params.num_classes[1] = 0;
        postProcObj->viz_params.num_classes[2] = 0;
    
        for(i=0; i < TIVX_PIXEL_VIZ_MAX_TENSOR; i++){
          postProcObj->viz_params.valid_region[i][0] = 0;
          postProcObj->viz_params.valid_region[i][1] = 0;
          postProcObj->viz_params.valid_region[i][2] = 0;
          postProcObj->viz_params.valid_region[i][3] = 0;
        }
    }
    
    static void update_seg_post_proc_params(AppObj *obj, SegPostProcObj *postProcObj)
    {
      vx_int32 i;
    
      postProcObj->out_width  = obj->scalerObj.output2.width;
      postProcObj->out_height = obj->scalerObj.output2.height;
    
      memcpy(postProcObj->viz_params.color_map[0], seg_color_map, postProcObj->viz_params.num_classes[0]*3*sizeof(vx_uint8));
      postProcObj->viz_params.max_value[0] = postProcObj->viz_params.num_classes[0] - 1;
    
      for(i=0; i < TIVX_PIXEL_VIZ_MAX_TENSOR; i++){
        postProcObj->viz_params.valid_region[i][0] = 0;
        postProcObj->viz_params.valid_region[i][1] = 0;
        postProcObj->viz_params.valid_region[i][2] = postProcObj->out_width  - 1;
        postProcObj->viz_params.valid_region[i][3] = postProcObj->out_height - 1;
      }
    }
    
    static void set_draw_detection_defaults(DrawDetectionsObj *drawDetectionsObj)
    {
      drawDetectionsObj->out_width  = 512;
      drawDetectionsObj->out_height = 192;
    
      //drawDetectionsObj->params.num_max_det = 100;
      drawDetectionsObj->params.viz_th = 0.5F;
    
    }
    
    static void set_img_mosaic_defaults(AppObj *obj, ImgMosaicObj *imgMosaicObj)
    {
      vx_int32 idx = 0;
      imgMosaicObj->out_width    = 1920;
      imgMosaicObj->out_height   = 1080;
      imgMosaicObj->num_inputs   = 1;
    
      if(NUM_CH > 0)
      {
          imgMosaicObj->params.windows[idx].startX  = 700;
          imgMosaicObj->params.windows[idx].startY  = 100;
          imgMosaicObj->params.windows[idx].width   = obj->segPostProcObj.out_width;
          imgMosaicObj->params.windows[idx].height  = obj->segPostProcObj.out_height;
          imgMosaicObj->params.windows[idx].input_select   = 0;
          imgMosaicObj->params.windows[idx].channel_select = 0;
          idx++;
      }
      if(NUM_CH > 1)
      {
          imgMosaicObj->params.windows[idx].startX  = 1212;
          imgMosaicObj->params.windows[idx].startY  = 350;
          imgMosaicObj->params.windows[idx].width   = obj->segPostProcObj.out_width;
          imgMosaicObj->params.windows[idx].height  = obj->segPostProcObj.out_height;
          imgMosaicObj->params.windows[idx].input_select   = 0;
          imgMosaicObj->params.windows[idx].channel_select = 1;
          idx++;
      }
      if(NUM_CH > 2)
      {
          imgMosaicObj->params.windows[idx].startX  = 700;
          imgMosaicObj->params.windows[idx].startY  = 600;
          imgMosaicObj->params.windows[idx].width   = obj->segPostProcObj.out_width;
          imgMosaicObj->params.windows[idx].height  = obj->segPostProcObj.out_height;
          imgMosaicObj->params.windows[idx].input_select   = 0;
          imgMosaicObj->params.windows[idx].channel_select = 2;
          idx++;
      }
      if(NUM_CH > 3)
      {
          imgMosaicObj->params.windows[idx].startX  = 188;
          imgMosaicObj->params.windows[idx].startY  = 350;
          imgMosaicObj->params.windows[idx].width   = obj->segPostProcObj.out_width;
          imgMosaicObj->params.windows[idx].height  = obj->segPostProcObj.out_height;
          imgMosaicObj->params.windows[idx].input_select   = 0;
          imgMosaicObj->params.windows[idx].channel_select = 3;
          idx++;
      }
    
      imgMosaicObj->params.num_windows  = idx;
    
      /* Number of time to clear the output buffer before it gets reused */
      imgMosaicObj->params.clear_count  = 4;
    }
    
    static void set_display_defaults(DisplayObj *displayObj)
    {
      displayObj->display_option = 0;
    }
    
    static void app_pipeline_params_defaults(AppObj *obj)
    {
      obj->pipeline       = -APP_BUFFER_Q_DEPTH;
      obj->enqueueCnt     = 0;
      obj->dequeueCnt     = 0;
    }
    
    static void app_default_param_set(AppObj *obj)
    {
        set_pre_proc_defaults(&obj->preProcObj);
    
        set_seg_post_proc_defaults(&obj->segPostProcObj);
    
        set_draw_detection_defaults(&obj->odDrawDetectionsObj);
        set_draw_detection_defaults(&obj->soilDrawDetectionsObj);
    
        set_display_defaults(&obj->displayObj);
    
        app_pipeline_params_defaults(obj);
    
        obj->delay_in_msecs = 0;
        obj->num_iterations = 1;
        obj->is_interactive = 0;
    
    }
    
    static void update_draw_detections_defaults(AppObj *obj, DrawDetectionsObj *drawDetectionsObj)
    {
        vx_int32 i;
    
        drawDetectionsObj->params.width  = drawDetectionsObj->out_width;
        drawDetectionsObj->params.height = drawDetectionsObj->out_height;
    
        for(i = 0; i < drawDetectionsObj->params.num_classes; i++)
        {
            drawDetectionsObj->params.color_map[i][0] = od_color_map[i][0];
            drawDetectionsObj->params.color_map[i][1] = od_color_map[i][1];
            drawDetectionsObj->params.color_map[i][2] = od_color_map[i][2];
        }
    }
    
    static void app_update_param_set(AppObj *obj)
    {
        update_seg_post_proc_params(obj, &obj->segPostProcObj);
    
        update_draw_detections_defaults(obj, &obj->odDrawDetectionsObj);
        update_draw_detections_defaults(obj, &obj->soilDrawDetectionsObj);
    
        set_img_mosaic_defaults(obj, &obj->imgMosaicObj);
    
        if(obj->is_interactive)
        {
          obj->num_iterations = 1000000000;
        }
    }
    
    #ifdef APP_ENABLE_PIPELINE_FLOW
    
    static void app_find_object_array_index(vx_object_array object_array[], vx_reference ref, vx_int32 array_size, vx_int32 *array_idx)
    {
      vx_int32 i;
    
      *array_idx = -1;
      for(i = 0; i < array_size; i++)
      {
        vx_image img_ref = (vx_image)vxGetObjectArrayItem((vx_object_array)object_array[i], 0);
        if(ref == (vx_reference)img_ref)
        {
          *array_idx = i;
          vxReleaseImage(&img_ref);
          break;
        }
        vxReleaseImage(&img_ref);
      }
    }
    #endif
    
    #ifndef x86_64
    static void app_draw_graphics(Draw2D_Handle *handle, Draw2D_BufInfo *draw2dBufInfo, uint32_t update_type)
    {
    
      appGrpxDrawDefault(handle, draw2dBufInfo, update_type);
    
      if(update_type == 0)
      {
        Draw2D_FontPrm sHeading;
        Draw2D_FontPrm sLabel;
    
        sHeading.fontIdx = 4;
        Draw2D_drawString(handle, 520, 5, "Valeo Vision Systems - Minerva Demo", &sHeading);
    
        sLabel.fontIdx = 3;
        Draw2D_drawString(handle, 380, 550, "Left camera", &sLabel);
        Draw2D_drawString(handle, 900, 300, "Front camera", &sLabel);
        Draw2D_drawString(handle, 1420, 550, "Right camera", &sLabel);
        Draw2D_drawString(handle, 900, 800, "Rear camera", &sLabel);
    
      }
    
      return;
    }
    #endif
    

    I have  used the sdk v8_02_00_05

  • Hi,

    Few observations in your source code

    1. vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[2]; 
        Here the array size is hard coded to 2, whereas one of the graph parameter is dependent on if (obj->en_out_img_write == 1), when this variable is 0 in the cfg file, then you'll get the error VX_ZONE_ERROR:[vxSetGraphScheduleConfig:218] user parameter list (2) > number of graph parameters (1)

    2. tivxSetNodeParameterNumBufByIndex(obj->imgMosaicObj.node, 1, 4); 
        As the imgMosaic index 1 is already a graph parameter, you cannot use the above api on it., else you'll get the error [ownGraphValidatePipelineParameters:948] Parameter image_175 of node MosaicNode has multiple buffers set both as a graph parameter and using tivxSetNodeParamx

    3. May I know on which target is the preProc node set to? Is it DSP1? Could you check if the kernel is registered on the target? i.e. is this function call is executed on the target tivxRegisterImgProcTargetC66Kernels() ?

    Regards,
    Nikhil
        

  • Hi Here is what I found out,

    1. Here in the .cfg file I have set the value of en_out_img_write as 1, so not getting the first error.

    2. Removed the  tivxSetNodeParameterNumBufByIndex(obj->imgMosaicObj.node, 1, 4);  so now not getting the second error.

    3. Its run on C66, and we have called the function tivxRegisterMinervaTargetC66Kernels in the kernel part.

    This is the new log I am getting after the changes.

    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
        59.925255 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
        59.931585 s:  VX_ZONE_INIT:Enabled
        59.931609 s:  VX_ZONE_ERROR:Enabled
        59.931620 s:  VX_ZONE_WARNING:Enabled
        59.935684 s:  VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
        59.935870 s:  VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!

    60.117613 s:  VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message returned failure cmd_status: -7
        60.117633 s:  VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
        60.117639 s:  VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMD_NODE_CREATE failed for node PreProcNode
        60.117645 s:  VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the target callbacks have been registered for this core
        60.117652 s:  VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
        60.117795 s:  VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 1, kernel com.ti.minerva.img.pre.proc ... failed !!!
        60.117808 s:  VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed
        60.117814 s:  VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
        60.118185 s:  VX_ZONE_ERROR:[tivxNodeSendCommandTimed:277] vxVerifyGraph should be called before tivxNodeSendCommand can be called on a node in the same graph
    MSC: Node send command failed!
    [C6x_1 ]     60.117503 s:  VX_ZONE_ERROR:[tivxTargetKernelInstanceAlloc:115] kernel com.ti.minerva.img.pre.proc has not been registered on this CPU
    [C6x_1 ]     60.117526 s:  VX_ZONE_ERROR:[tivxTargetKernelInstanceAlloc:116] Please register this kernel on the appropriate target core
    [C6x_1 ]     60.117547 s:  VX_ZONE_ERROR:[tivxTargetNodeDescNodeCreate:761] target_kernel_instance is NULL
    App Verify Graph Done!
        60.219914 s:  VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
        60.219927 s:  VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
        60.615271 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
        60.619645 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 108 alloc's of 34815780 bytes
    MEM: Free's : 108 free's  of 34815780 bytes
    MEM: Open's : 0 allocs  of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!

  • 1. Here in the .cfg file I have set the value of en_out_img_write as 1, so not getting the first error.

    2. Removed the  tivxSetNodeParameterNumBufByIndex(obj->imgMosaicObj.node, 1, 4);  so now not getting the second error.

    Great!!

    3. Its run on C66, and we have called the function tivxRegisterMinervaTargetC66Kernels in the kernel part.

    The kernel name that you are using for preProc node is com.ti.minerva.img.pre.proc, whereas in SDK, we have com.ti.img_proc.img.preprocess

    Are you using tivxImgPreProcNode() itself with kernel com.ti.minerva.img.pre.proc or have you created a user-defined node for PreProc with kernel com.ti.minerva.img.pre.proc ?

    If it is a user-defined PreProc node, is there any particular reason not to use tivxImgPreProcNode(), like if you have added some additional functionality.

    If it is a new kernel, please refer to below link, which explains how to add new target kernel. Kindly verify you have done all the steps on both host and target side

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/tiovx/docs/user_guide/TIOVX_TARGET_KERNEL.html



    Regards,
    Nikhil

  • Hi,

    We havent added any user defined Preproc node. We have used the tivxImgPreProcNode itself.

    Could you please support?

    I would like to know what can cause this zone error 

    VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message returned failure cmd_status: -7

    com.ti.minerva.od.post.proc

    and why I am only getting an error for the com.ti.img_proc.img.preprocess even though I have com.ti.minerva.od.post.proc kernel also.

  • Could you please support here?

    Regards,

    Amal

  • Hi Amal,

    As you could see in the error log "If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel"
    the kernel for which you have changed the name from com.ti.img_proc.img.preprocess to com.ti.minerva.img.pre.proc, The target callback functions such as create, process etc is not registered to this kernel name somehow...

    Could you confirm if you done the below?

    1. Are you using the same macro TIVX_KERNEL_IMG_PREPROCESS_NAME for your kernel com.ti.minerva.img.pre.proc?, If yes, then all the setup on host and target side should have been taken care automatically...

    2. If not, then have you updated this macro in 3 places, i.e. 
          - In the node function tivxImgPreProcNode()
          - On the host side, in the function tivxAddKernelImgPreProc() (or whichever your Add function is that is being called in the register function on host side )
          - On the target side, in the function tivxAddTargetKernelImgPreProc() (or whichever your Add function is that is being called in tivxRegisterMinervaTargetC66Kernels() )

    3. Please refer https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/tiovx/docs/user_guide/TIOVX_TARGET_KERNEL.html
        for all the changes to be done.

    why I am only getting an error for the com.ti.img_proc.img.preprocess even though I have com.ti.minerva.od.post.proc kernel also.


    From the logs, it looks like it has not reached the post proc create function yet. It has failed in the pre-proc itself and verify graph failed. May be that could be the reason you don't see post proc failing.

    Regards,
    Nikhil

  • Hi Nikhil,

    The issue was that I was not registering the kernels on the target side. I added the register function in the "app_init.c" file this seems to have resolved the target registering problem.

  • Hi Amal,

    Great!! Hope this resolved your issue.
    Shall I proceed with closing this ticket?

    Regards,
    Nikhil

  • I am getting an issue like this after the changes.

    103.048807 s: VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message returned failure cmd_status: -1
    103.048825 s: VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
    103.048832 s: VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMD_NODE_CREATE failed for node MosaicNode
    103.048837 s: VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the target callbacks have been registered for this core
    103.048843 s: VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
    103.048851 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 6, kernel com.ti.img_proc.img.mosaic ... failed !!!
    103.048867 s: VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed
    103.048872 s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed

    The mosaic node I have used it same as it is in the demo applications. What could cause this issue?

  • Hi,

    Could you provide the remote side logs too? i.e. there should an error log from [MCU2_0] in the logs....
    If not, you could run source ./vision_apps_init.sh before running your application in order to get [MCU2_0] logs in your application.

    Could you also confirm that the function tivxAddTargetKernelImgMosaicMsc() is being called, by putting some logs in it?

    Regards,
    Nikhil

  • This is the remote side logs. Will put some prints in the tivxAddTargetKernelImgMosaicMsc to see if it is called.
    [C6x_2 ] 18.329135 s: APP: OpenVX Target kernel init ... Done !!!
    [C6x_2 ] 18.329153 s: UDMA Copy: Init ... !!!
    [C6x_2 ] 18.332970 s: UDMA Copy: Init ... Done !!!
    [C6x_2 ] 18.332987 s: APP: Init ... Done !!!
    [C6x_2 ] 18.333727 s: APP: Run ... !!!
    [C6x_2 ] 18.333739 s: IPC: Starting echo test ...
    [C6x_2 ] 18.334973 s: APP: Run ... Done !!!
    [C6x_2 ] 18.335321 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[x] C66X_1[P] C66X_2[s] C7X_1[.]
    [C6x_2 ] 18.335359 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[x] C66X_1[P] C66X_2[s] C7X_1[P]
    [C6x_2 ] 18.349060 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[P] C66X_1[P] C66X_2[s] C7X_1[P]
    [C6x_2 ] 18.547010 s: IPC: Echo status: mpu1_0[x] mcu2_0[P] mcu2_1[P] C66X_1[P] C66X_2[s] C7X_1[P]
    [C7x_1 ] 4.716364 s: CIO: Init ... Done !!!
    [C7x_1 ] 4.716378 s: ### CPU Frequency = 1000000000 Hz
    [C7x_1 ] 4.716390 s: APP: Init ... !!!
    [C7x_1 ] 4.716398 s: SCICLIENT: Init ... !!!
    [C7x_1 ] 4.716603 s: SCICLIENT: DMSC FW version [22.1.1--v2022.01 (Terrific Llam]
    [C7x_1 ] 4.716617 s: SCICLIENT: DMSC FW revision 0x16
    [C7x_1 ] 4.716627 s: SCICLIENT: DMSC FW ABI revision 3.1
    [C7x_1 ] 4.716638 s: SCICLIENT: Init ... Done !!!
    [C7x_1 ] 4.716647 s: UDMA: Init ... !!!
    [C7x_1 ] 4.717744 s: UDMA: Init ... Done !!!
    [C7x_1 ] 4.717756 s: MEM: Init ... !!!
    [C7x_1 ] 4.717768 s: MEM: Created heap (DDR_SHARED_MEM, id=0, flags=0x00000004) @ 100000000 of size 268435456 bytes !!!
    [C7x_1 ] 4.717787 s: MEM: Created heap (L3_MEM, id=1, flags=0x00000001) @ 70020000 of size 8159232 bytes !!!
    [C7x_1 ] 4.717805 s: MEM: Created heap (L2_MEM, id=2, flags=0x00000001) @ 64800000 of size 458752 bytes !!!
    [C7x_1 ] 4.717822 s: MEM: Created heap (L1_MEM, id=3, flags=0x00000001) @ 64e00000 of size 16384 bytes !!!
    [C7x_1 ] 4.717838 s: MEM: Created heap (DDR_SCRATCH_MEM, id=4, flags=0x00000001) @ e4000000 of size 385875968 bytes !!!
    [C7x_1 ] 4.717857 s: MEM: Init ... Done !!!
    [C7x_1 ] 4.717864 s: IPC: Init ... !!!
    [C7x_1 ] 4.717878 s: IPC: 6 CPUs participating in IPC !!!
    [C7x_1 ] 4.717892 s: IPC: Waiting for HLOS to be ready ... !!!
    [C7x_1 ] 17.724984 s: IPC: HLOS is ready !!!
    [C7x_1 ] 17.727032 s: IPC: Init ... Done !!!
    [C7x_1 ] 17.727046 s: APP: Syncing with 5 CPUs ... !!!
    [C7x_1 ] 18.327126 s: APP: Syncing with 5 CPUs ... Done !!!
    [C7x_1 ] 18.327143 s: REMOTE_SERVICE: Init ... !!!
    [C7x_1 ] 18.327321 s: REMOTE_SERVICE: Init ... Done !!!
    [C7x_1 ] 18.327343 s: VX_ZONE_INIT:Enabled
    [C7x_1 ] 18.327354 s: VX_ZONE_ERROR:Enabled
    [C7x_1 ] 18.327365 s: VX_ZONE_WARNING:Enabled
    [C7x_1 ] 18.327626 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1
    [C7x_1 ] 18.327688 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1_PRI_2
    [C7x_1 ] 18.327797 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1_PRI_3
    [C7x_1 ] 18.327862 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1_PRI_4
    [C7x_1 ] 18.327938 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1_PRI_5
    [C7x_1 ] 18.328053 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1_PRI_6
    [C7x_1 ] 18.328121 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1_PRI_7
    [C7x_1 ] 18.328182 s: VX_ZONE_INIT:[tivxPlatformCreateTargetId:59] Added target DSP_C7-1_PRI_8
    [C7x_1 ] 18.328203 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
    [C7x_1 ] 18.328216 s: APP: OpenVX Target kernel init ... !!!
    [C7x_1 ] 18.328415 s: APP: OpenVX Target kernel init ... Done !!!
    [C7x_1 ] 18.328432 s: APP: Init ... Done !!!
    [C7x_1 ] 18.328441 s: APP: Run ... !!!
    [C7x_1 ] 18.328450 s: IPC: Starting echo test ...
    [C7x_1 ] 18.328608 s: APP: Run ... Done !!!
    [C7x_1 ] 18.334947 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[x] C66X_1[P] C66X_2[x] C7X_1[s]
    [C7x_1 ] 18.335330 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[x] C66X_1[P] C66X_2[P] C7X_1[s]
    [C7x_1 ] 18.349084 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[P] C66X_1[P] C66X_2[P] C7X_1[s]
    [C7x_1 ] 18.547063 s: IPC: Echo status: mpu1_0[x] mcu2_0[P] mcu2_1[P] C66X_1[P] C66X_2[P] C7X_1[s]

  • Hi,

    By remote side logs, I meant the remote side error logs available (if any from [MCU2_0] ) after running your application, i.e. in your application logs.

    Will put some prints in the tivxAddTargetKernelImgMosaicMsc to see if it is called

    Ok.. sure.

    I see that the thread status says "Resolved". Is the issue resolved?

    Regards,
    Nikhil

  • These are the logs from the remote side logs

    [MCU2_0] 797.607788 s: src/fvid2_drvMgr.c @ Line 867:
    [MCU2_0] 797.607839 s: EBADARGS: NULL pointer!!
    [MCU2_0] 797.607891 s: VX_ZONE_ERROR:[tivxKernelImgMosaicMscSetCoeffsCmd:855] tivxKernelImgMosaicMscSetCoeffsCmd: Failed to create coefficients
    [C7x_1 ] 797.608811 s: VX_ZONE_INFO:[tivxTargetKernelDelete:339] Executing delete callback for kernel [com.ti.tidl]
    [C7x_1 ] 797.609076 s: VX_ZONE_INFO:Disabled

    I am able to see prints from the tivxAddTargetKernelImgMosaicMsc during the init call

    Note: Issue is still there. Might have mistakenly marked as resolved.

  • Could you please check this?

  • Hi,

    This looks like there is an issue while creating the imgMosaic Handle.
    I'm unable to conclude with the above set of logs.

    It would be great if you could provide the full logs of your application along with the remote side logs.

    Also could you tell me which SDK version are you using?

    Regards,
    Nikhil

  • Using SDK v8.2. Sharing the full application logs here, Please note I have added a couple of prints for my debugging purposes.

    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
    64.361131 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
    64.367542 s: VX_ZONE_INIT:Enabled
    64.367565 s: VX_ZONE_ERROR:Enabled
    64.367576 s: VX_ZONE_WARNING:Enabled
    64.369883 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!!
    64.370030 s: VX_ZONE_ERROR:[tivxRegisterModule:118] Call of register module publish and un publsish is not NULL!!!
    64.370041 s: VX_ZONE_ERROR:[tivxRegisterModule:132] g_module_table[0]->name: openvx-core
    64.370056 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!!
    64.377857 s: VX_ZONE_ERROR:[tivxRegisterModule:118] Call of register module publish and un publsish is not NULL!!!
    64.377874 s: VX_ZONE_ERROR:[tivxRegisterModule:132] g_module_table[1]->name: hwa
    64.381099 s: VX_ZONE_ERROR:[tivxRegisterModule:118] Call of register module publish and un publsish is not NULL!!!
    64.382775 s: VX_ZONE_ERROR:[tivxRegisterModule:132] g_module_table[2]->name: img_proc
    64.382912 s: VX_ZONE_ERROR:[tivxRegisterModule:118] Call of register module publish and un publsish is not NULL!!!
    64.382920 s: VX_ZONE_ERROR:[tivxRegisterModule:132] g_module_table[3]->name: minerva
    64.382926 s: VX_ZONE_ERROR:[publishKernels:86] publishKernels call back
    64.382938 s: VX_ZONE_ERROR:[tivxAddKernelMinervaPreProc:191] Added User kernel pre proc minerva here status: 0
    64.382944 s: VX_ZONE_ERROR:[tivxAddKernelMinervaPreProc:205] Added Parameter 1 User kernel pre proc minerva here status: 0
    64.382951 s: VX_ZONE_ERROR:[tivxAddKernelMinervaPreProc:216] Added Parameter 2 User kernel pre proc minerva here status: 0
    64.382957 s: VX_ZONE_ERROR:[tivxAddKernelMinervaPreProc:227] Added Parameter 3 User kernel pre proc minerva here status: 0
    64.382963 s: VX_ZONE_ERROR:[tivxAddKernelMinervaPreProc:238] Added Parameter 4 User kernel pre proc minerva here status: 0
    64.382970 s: VX_ZONE_ERROR:[tivxAddKernelMinervaPreProc:245] Added User kernel pre proc minerva to target here status: 0
    64.382977 s: VX_ZONE_ERROR:[tivxAddKernelMinervaPreProc:251] Kernel finilized status: 0
    Computing checksum at 0x0000FFFF7FD98180, size = 699104
    Before Schedule Graph execution
    After Schedule Graph execution: 0

    ___________________Before waiting______________________

    ___________________Waiting done______________________
    Preproc OD tivxMinervaPreProcNode called here
    index = 1, ownnode = 6, numbuf = 2, ownnodeget = 1

    Scalar params 1
    index = 2, ownnode = 4, numbuf = 2, ownnodeget = 1
    preproc params 1
    index = 4, ownnode = 10, numbuf = 2, ownnodeget = 1
    tidl params 1
    index = 8, ownnode = 10, numbuf = 2, ownnodeget = 1
    tidl params 2
    index = 4, ownnode = 5, numbuf = 2, ownnodeget = 1
    seg params 1
    index = 3, ownnode = 4, numbuf = 2, ownnodeget = 1
    post proc 1
    index = 3, ownnode = 4, numbuf = 2, ownnodeget = 1
    obj detection 1
    App Create Graph Done!
    num_params = 2
    graph->parameters[param_idx].num_buf = 2 node->parameter_index_num_buf[node_idx] = 0
    graph->parameters[param_idx].num_buf = 2 node->parameter_index_num_buf[node_idx] = 0
    [C7x_1 ] 64.554712 s: VX_ZONE_INFO:Enabled
    [C7x_1 ] 64.561947 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:585] tidlObj->netSize = 4467808
    [C7x_1 ] 64.561970 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:586] pNet->dataFlowInfo = 3768704
    [C7x_1 ] 64.562916 s: VX_ZONE_INFO:[testChecksum:838] QC code match!
    [C7x_1 ] 64.562945 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:625] L1 = 16 KB, L2 = 448 KB, L3 = 7968 KB
    [C7x_1 ] 64.562968 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:281] Calling ialg.algNumAlloc ...
    [C7x_1 ] 64.562988 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:285] Allocating 14 memory records ...
    [C7x_1 ] 64.563010 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:295] Calling ialg.algAlloc ...
    [C7x_1 ] 64.563292 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 0 @ space = 17, size = 15208, align = 128 ...
    [C7x_1 ] 64.563327 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 0 @ space = 17 and size = 15208, addr = 100452800 ...
    [C7x_1 ] 64.563357 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 1 @ space = 17, size = 136, align = 128 ...
    [C7x_1 ] 64.563386 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 1 @ space = 17 and size = 136, addr = 100456500 ...
    [C7x_1 ] 64.563415 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 2 @ space = 0, size = 16384, align = 128 ...
    [C7x_1 ] 64.563444 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 2 @ space = 0 and size = 16384, addr = 64e00000 ...
    [C7x_1 ] 64.563472 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 3 @ space = 1, size = 458752, align = 128 ...
    [C7x_1 ] 64.563501 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 3 @ space = 1 and size = 458752, addr = 64800000 ...
    [C7x_1 ] 64.563529 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 4 @ space = 2, size = 8159232, align = 128 ...
    [C7x_1 ] 64.563558 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 4 @ space = 2 and size = 8159232, addr = 70020000 ...
    [C7x_1 ] 64.563587 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 5 @ space = 17, size = 3946112, align = 128 ...
    [C7x_1 ] 64.563645 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 5 @ space = 17 and size = 3946112, addr = 100456700 ...
    [C7x_1 ] 64.563674 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 6 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.563702 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 6 @ space = 17 and size = 256, addr = e4000000 ...
    [C7x_1 ] 64.563731 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 7 @ space = 17, size = 798708, align = 128 ...
    [C7x_1 ] 64.563767 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 7 @ space = 17 and size = 798708, addr = 100819f00 ...
    [C7x_1 ] 64.563796 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 8 @ space = 17, size = 128, align = 128 ...
    [C7x_1 ] 64.563823 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 8 @ space = 17 and size = 128, addr = e4000400 ...
    [C7x_1 ] 64.563859 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 9 @ space = 17, size = 3200, align = 128 ...
    [C7x_1 ] 64.563889 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 9 @ space = 17 and size = 3200, addr = e4000800 ...
    [C7x_1 ] 64.563917 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 10 @ space = 17, size = 5431680, align = 128 ...
    [C7x_1 ] 64.563995 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 10 @ space = 17 and size = 5431680, addr = 1008dd000 ...
    [C7x_1 ] 64.564024 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 11 @ space = 17, size = 413696, align = 128 ...
    [C7x_1 ] 64.564057 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 11 @ space = 17 and size = 413696, addr = 100e0b300 ...
    [C7x_1 ] 64.564085 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 12 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.564113 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 12 @ space = 17 and size = 256, addr = e4001800 ...
    [C7x_1 ] 64.564142 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 13 @ space = 17, size = 8388608, align = 128 ...
    [C7x_1 ] 64.564171 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 13 @ space = 17 and size = 8388608, addr = 100e70400 ...
    [C7x_1 ] 64.564260 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:306] Calling ialg.algInit ...
    [C7x_1 ] 64.580297 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:356] Created AlgiVision handle.
    [C7x_1 ] 64.580328 s: VX_ZONE_INFO:[tivxTargetKernelCreate:313] Done executing create callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.580392 s: VX_ZONE_INFO:[tivxTargetKernelInstanceAlloc:106] attempting to call kernel com.ti.tidl on this CPU
    [C7x_1 ] 64.580437 s: VX_ZONE_INFO:[tivxTargetKernelCreate:307] Executing create callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.580455 s: VX_ZONE_INFO:Enabled
    [C7x_1 ] 64.587447 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:585] tidlObj->netSize = 4467808
    [C7x_1 ] 64.587469 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:586] pNet->dataFlowInfo = 3768704
    [C7x_1 ] 64.588410 s: VX_ZONE_INFO:[testChecksum:838] QC code match!
    [C7x_1 ] 64.588439 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:625] L1 = 16 KB, L2 = 448 KB, L3 = 7968 KB
    [C7x_1 ] 64.588462 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:281] Calling ialg.algNumAlloc ...
    [C7x_1 ] 64.588481 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:285] Allocating 14 memory records ...
    [C7x_1 ] 64.588503 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:295] Calling ialg.algAlloc ...
    [C7x_1 ] 64.588778 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 0 @ space = 17, size = 15208, align = 128 ...
    [C7x_1 ] 64.588814 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 0 @ space = 17 and size = 15208, addr = 101ac2900 ...
    [C7x_1 ] 64.588851 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 1 @ space = 17, size = 136, align = 128 ...
    [C7x_1 ] 64.588882 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 1 @ space = 17 and size = 136, addr = 101ac6600 ...
    [C7x_1 ] 64.588911 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 2 @ space = 0, size = 16384, align = 128 ...
    [C7x_1 ] 64.588940 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 2 @ space = 0 and size = 16384, addr = 64e00000 ...
    [C7x_1 ] 64.588969 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 3 @ space = 1, size = 458752, align = 128 ...
    [C7x_1 ] 64.588997 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 3 @ space = 1 and size = 458752, addr = 64800000 ...
    [C7x_1 ] 64.589026 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 4 @ space = 2, size = 8159232, align = 128 ...
    [C7x_1 ] 64.589055 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 4 @ space = 2 and size = 8159232, addr = 70020000 ...
    [C7x_1 ] 64.589084 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 5 @ space = 17, size = 3946112, align = 128 ...
    [C7x_1 ] 64.589150 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 5 @ space = 17 and size = 3946112, addr = 101ac6800 ...
    [C7x_1 ] 64.589179 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 6 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.589207 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 6 @ space = 17 and size = 256, addr = e4000000 ...
    [C7x_1 ] 64.589236 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 7 @ space = 17, size = 798708, align = 128 ...
    [C7x_1 ] 64.589265 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 7 @ space = 17 and size = 798708, addr = 101e8a000 ...
    [C7x_1 ] 64.589294 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 8 @ space = 17, size = 128, align = 128 ...
    [C7x_1 ] 64.589321 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 8 @ space = 17 and size = 128, addr = e4000400 ...
    [C7x_1 ] 64.589350 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 9 @ space = 17, size = 3200, align = 128 ...
    [C7x_1 ] 64.589378 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 9 @ space = 17 and size = 3200, addr = e4000800 ...
    [C7x_1 ] 64.589406 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 10 @ space = 17, size = 5431680, align = 128 ...
    [C7x_1 ] 64.589463 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 10 @ space = 17 and size = 5431680, addr = 101f4d100 ...
    [C7x_1 ] 64.589507 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 11 @ space = 17, size = 413696, align = 128 ...
    [C7x_1 ] 64.589540 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 11 @ space = 17 and size = 413696, addr = 10247b400 ...
    [C7x_1 ] 64.589569 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 12 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.589597 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 12 @ space = 17 and size = 256, addr = e4001800 ...
    [C7x_1 ] 64.589626 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 13 @ space = 17, size = 8388608, align = 128 ...
    [C7x_1 ] 64.589655 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 13 @ space = 17 and size = 8388608, addr = 1024e0500 ...
    [C7x_1 ] 64.589736 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:306] Calling ialg.algInit ...
    [C7x_1 ] 64.605709 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:356] Created AlgiVision handle.
    [C7x_1 ] 64.605740 s: VX_ZONE_INFO:[tivxTargetKernelCreate:313] Done executing create callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.605803 s: VX_ZONE_INFO:[tivxTargetKernelInstanceAlloc:106] attempting to call kernel com.ti.tidl on this CPU
    [C7x_1 ] 64.605853 s: VX_ZONE_INFO:[tivxTargetKernelCreate:307] Executing create callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.605873 s: VX_ZONE_INFO:Enabled
    [C7x_1 ] 64.612958 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:585] tidlObj->netSize = 4467808
    [C7x_1 ] 64.612980 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:586] pNet->dataFlowInfo = 3768704
    [C7x_1 ] 64.613921 s: VX_ZONE_INFO:[testChecksum:838] QC code match!
    [C7x_1 ] 64.613949 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:625] L1 = 16 KB, L2 = 448 KB, L3 = 7968 KB
    [C7x_1 ] 64.613971 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:281] Calling ialg.algNumAlloc ...
    [C7x_1 ] 64.613990 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:285] Allocating 14 memory records ...
    [C7x_1 ] 64.614012 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:295] Calling ialg.algAlloc ...
    [C7x_1 ] 64.614288 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 0 @ space = 17, size = 15208, align = 128 ...
    [C7x_1 ] 64.614322 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 0 @ space = 17 and size = 15208, addr = 103132a00 ...
    [C7x_1 ] 64.614352 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 1 @ space = 17, size = 136, align = 128 ...
    [C7x_1 ] 64.614381 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 1 @ space = 17 and size = 136, addr = 103136700 ...
    [C7x_1 ] 64.614409 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 2 @ space = 0, size = 16384, align = 128 ...
    [C7x_1 ] 64.614438 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 2 @ space = 0 and size = 16384, addr = 64e00000 ...
    [C7x_1 ] 64.614467 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 3 @ space = 1, size = 458752, align = 128 ...
    [C7x_1 ] 64.614495 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 3 @ space = 1 and size = 458752, addr = 64800000 ...
    [C7x_1 ] 64.614524 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 4 @ space = 2, size = 8159232, align = 128 ...
    [C7x_1 ] 64.614552 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 4 @ space = 2 and size = 8159232, addr = 70020000 ...
    [C7x_1 ] 64.614581 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 5 @ space = 17, size = 3946112, align = 128 ...
    [C7x_1 ] 64.614614 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 5 @ space = 17 and size = 3946112, addr = 103136900 ...
    [C7x_1 ] 64.614668 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 6 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.614696 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 6 @ space = 17 and size = 256, addr = e4000000 ...
    [C7x_1 ] 64.614724 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 7 @ space = 17, size = 798708, align = 128 ...
    [C7x_1 ] 64.614753 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 7 @ space = 17 and size = 798708, addr = 1034fa100 ...
    [C7x_1 ] 64.614782 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 8 @ space = 17, size = 128, align = 128 ...
    [C7x_1 ] 64.614810 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 8 @ space = 17 and size = 128, addr = e4000400 ...
    [C7x_1 ] 64.614844 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 9 @ space = 17, size = 3200, align = 128 ...
    [C7x_1 ] 64.614873 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 9 @ space = 17 and size = 3200, addr = e4000800 ...
    [C7x_1 ] 64.614902 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 10 @ space = 17, size = 5431680, align = 128 ...
    [C7x_1 ] 64.614980 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 10 @ space = 17 and size = 5431680, addr = 1035bd200 ...
    [C7x_1 ] 64.615009 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 11 @ space = 17, size = 413696, align = 128 ...
    [C7x_1 ] 64.615038 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 11 @ space = 17 and size = 413696, addr = 103aeb500 ...
    [C7x_1 ] 64.615066 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 12 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.615094 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 12 @ space = 17 and size = 256, addr = e4001800 ...
    [C7x_1 ] 64.615123 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 13 @ space = 17, size = 8388608, align = 128 ...
    [C7x_1 ] 64.615153 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 13 @ space = 17 and size = 8388608, addr = 103b50600 ...
    [C7x_1 ] 64.615242 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:306] Calling ialg.algInit ...
    [C7x_1 ] 64.631241 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:356] Created AlgiVision handle.
    [C7x_1 ] 64.631272 s: VX_ZONE_INFO:[tivxTargetKernelCreate:313] Done executing create callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.631335 s: VX_ZONE_INFO:[tivxTargetKernelInstanceAlloc:106] attempting to call kernel com.ti.tidl on this CPU
    [C7x_1 ] 64.631380 s: VX_ZONE_INFO:[tivxTargetKernelCreate:307] Executing create callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.631398 s: VX_ZONE_INFO:Enabled
    [C7x_1 ] 64.638510 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:585] tidlObj->netSize = 4467808
    [C7x_1 ] 64.638532 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:586] pNet->dataFlowInfo = 3768704
    [C7x_1 ] 64.639481 s: VX_ZONE_INFO:[testChecksum:838] QC code match!
    [C7x_1 ] 64.639509 s: VX_ZONE_INFO:[tivxKernelTIDLCreate:625] L1 = 16 KB, L2 = 448 KB, L3 = 7968 KB
    [C7x_1 ] 64.639531 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:281] Calling ialg.algNumAlloc ...
    [C7x_1 ] 64.639550 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:285] Allocating 14 memory records ...
    [C7x_1 ] 64.639572 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:295] Calling ialg.algAlloc ...
    [C7x_1 ] 64.639852 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 0 @ space = 17, size = 15208, align = 128 ...
    [C7x_1 ] 64.639887 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 0 @ space = 17 and size = 15208, addr = 1047a2b00 ...
    [C7x_1 ] 64.639916 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 1 @ space = 17, size = 136, align = 128 ...
    [C7x_1 ] 64.639946 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 1 @ space = 17 and size = 136, addr = 1047a6800 ...
    [C7x_1 ] 64.639974 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 2 @ space = 0, size = 16384, align = 128 ...
    [C7x_1 ] 64.640003 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 2 @ space = 0 and size = 16384, addr = 64e00000 ...
    [C7x_1 ] 64.640032 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 3 @ space = 1, size = 458752, align = 128 ...
    [C7x_1 ] 64.640060 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 3 @ space = 1 and size = 458752, addr = 64800000 ...
    [C7x_1 ] 64.640089 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 4 @ space = 2, size = 8159232, align = 128 ...
    [C7x_1 ] 64.640118 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 4 @ space = 2 and size = 8159232, addr = 70020000 ...
    [C7x_1 ] 64.640147 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 5 @ space = 17, size = 3946112, align = 128 ...
    [C7x_1 ] 64.640212 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 5 @ space = 17 and size = 3946112, addr = 1047a6a00 ...
    [C7x_1 ] 64.640241 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 6 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.640269 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 6 @ space = 17 and size = 256, addr = e4000000 ...
    [C7x_1 ] 64.640297 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 7 @ space = 17, size = 798708, align = 128 ...
    [C7x_1 ] 64.640331 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 7 @ space = 17 and size = 798708, addr = 104b6a200 ...
    [C7x_1 ] 64.640360 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 8 @ space = 17, size = 128, align = 128 ...
    [C7x_1 ] 64.640387 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 8 @ space = 17 and size = 128, addr = e4000400 ...
    [C7x_1 ] 64.640416 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 9 @ space = 17, size = 3200, align = 128 ...
    [C7x_1 ] 64.640444 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 9 @ space = 17 and size = 3200, addr = e4000800 ...
    [C7x_1 ] 64.640472 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 10 @ space = 17, size = 5431680, align = 128 ...
    [C7x_1 ] 64.640520 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 10 @ space = 17 and size = 5431680, addr = 104c2d300 ...
    [C7x_1 ] 64.640573 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 11 @ space = 17, size = 413696, align = 128 ...
    [C7x_1 ] 64.640602 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 11 @ space = 17 and size = 413696, addr = 10515b600 ...
    [C7x_1 ] 64.640631 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 12 @ space = 17, size = 256, align = 128 ...
    [C7x_1 ] 64.640659 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 12 @ space = 17 and size = 256, addr = e4001800 ...
    [C7x_1 ] 64.640687 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:170] Allocating memory record 13 @ space = 17, size = 8388608, align = 128 ...
    [C7x_1 ] 64.640717 s: VX_ZONE_INFO:[tivxAlgiVisionAllocMem:179] Allocated memory record 13 @ space = 17 and size = 8388608, addr = 1051c0700 ...
    [C7x_1 ] 64.640804 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:306] Calling ialg.algInit ...
    64.661250 s: VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message returned failure cmd_status: -1
    64.661266 s: VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
    64.661272 s: VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMD_NODE_CREATE failed for node MosaicNode
    64.661278 s: VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the target callbacks have been registered for this core
    64.661284 s: VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbacks have been registered, please ensure no errors are occurring within the create callback of this kernel
    64.661416 s: VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for node 6, kernel com.ti.img_proc.img.mosaic ... failed !!!
    64.661432 s: VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed
    64.661438 s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
    64.663495 s: VX_ZONE_ERROR:[tivxNodeSendCommandTimed:277] vxVerifyGraph should be called before tivxNodeSendCommand can be called on a node in the same graph
    MSC: Node send command failed!
    [MCU2_0] 64.660988 s: src/fvid2_drvMgr.c @ Line 867:
    [MCU2_0] 64.661041 s: EBADARGS: NULL pointer!!
    [MCU2_0] 64.661090 s: VX_ZONE_ERROR:[tivxKernelImgMosaicMscSetCoeffsCmd:855] tivxKernelImgMosaicMscSetCoeffsCmd: Failed to create coefficients
    [C7x_1 ] 64.656763 s: VX_ZONE_INFO:[tivxAlgiVisionCreate:356] Created AlgiVision handle.
    [C7x_1 ] 64.656794 s: VX_ZONE_INFO:[tivxTargetKernelCreate:313] Done executing create callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.662022 s: VX_ZONE_INFO:[tivxTargetKernelDelete:339] Executing delete callback for kernel [com.ti.tidl]
    [C7x_1 ] 64.662286 s: VX_ZONE_INFO:Disabled
    App Verify Graph Done!
    64.765405 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    64.765418 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
    65.045554 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
    65.049921 s: VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... !!!
    REMOTE_SERVICE: Deinit ... Done !!!
    IPC: Deinit ... !!!
    IPC: DeInit ... Done !!!
    MEM: Deinit ... !!!
    MEM: Alloc's: 108 alloc's of 34815780 bytes
    MEM: Free's : 108 free's of 34815780 bytes
    MEM: Open's : 0 allocs of 0 bytes
    MEM: Deinit ... Done !!!
    APP: Deinit ... Done !!!

  • Could you please check this out?

  • Hi,

    Could you put a breakpoint at PSDKRA/vision_apps/kernels/img_proc/r5f/vx_img_mosaic_msc_target.c in the tivxKernelImgMosaicMscCreate() and check if the driver handle is created successfully in tivxKernelImgMosaicMscDrvCreate().
    As I don't see the log Fvid2_create failed above, I think, it should have been created successfully.
    After that please check the status of the handle in tivxKernelImgMosaicMscSetCoeffsCmd() and why is it NULL in Fvid2_control() inside this.

    Also could you share the configuration on the mosaic node in your code?
    Are you using, with the help of the module app_img_mosaic_module.c ?

    Regards,
    Nikhil

  • Hi,

    Are you suggesting to debug on the target or the simulator? and what exactly do you mean about the configuration of the mosaic node?

    If on the target could you share the steps on how to do that?

  • Hi,

    Please debug this on the target using the CCS tool.

    Attach the target MCU2_0 on CCS and load the corresponding symbol in it.
    Put the breakpoint in the tivxKernelImgMosaicMscCreate() function and run your application on the EVM.

    Once the breakpoint is hit, go till tivxKernelImgMosaicMscDrvCreate() and ensure that the driver handle has been created successfully.
    After that go to tivxKernelImgMosaicMscSetCoeffsCmd() and check why is the handle NULL there.

    Regards,
    Nikhil

  • Hi, 

    What debugger can I use here? I dont have a debugger setup with me. Is there any other possible way to debug this?

  • Hi,

    Attach the target MCU2_0 on CCS and load the corresponding symbol in it.
    Put the breakpoint in the tivxKernelImgMosaicMscCreate() function and run your application on the EVM.

    Once the breakpoint is hit, go till tivxKernelImgMosaicMscDrvCreate() and ensure that the driver handle has been created successfully.
    After that go to tivxKernelImgMosaicMscSetCoeffsCmd() and check why is the handle NULL there.

    You could use a CCS debugger here. You could refer the below document to setup the debugger and follow the above procedure.
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/08_02_00_05/exports/docs/psdk_rtos/docs/user_guide/ccs_setup_j721e.html


    Another way would be to put the logs and check why the handle is NULL here.

    Regards,
    Nikhil