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.

McFW about the parameters passed

Hi all,

I am using DVRRDK3.0 with DM8168EVM.Now I am developing my algorithm in DSP.Now when the algorithm is finished,I set a flag =1,now I want to send the flag from dsp to arm,so I can disable some functon According to the flag.

Can I use System_linkControl cmd to send the flag and other parameters from dsp to arm?

Then in ARM side,how can I get the parameters,the Utils_msgGetPrm cmd seems is not supported ?

So how can I solve the problems?Please give me some suggestion on this,Thanks.

Junqing Zhao

  • Yes you can use System_linkControl from DSP side to send events back to ARM. You can refer code for sending event in

    /dvr_rdk/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c

    System_linkControl(SYSTEM_LINK_ID_HOST, 
                                     VSYS_EVENT_DECODER_ERROR, 
                                      &(pChObj->decErrorMsg),
                                      sizeof(DecLink_ChErrorMsg), 
                                      TRUE);

     

    You will get a callback to the application specified callback that was registered using Vsys_registerEventHandler.

    You can refer /dvr_rdk/demos/mcfw_api_demos/mcfw_demo/demo.c

    Demo_eventHandler for example code.

     

     

  • Thanks for your reply. I have try the method,  but it seems not work.
    In the codes of DSP sides, I added the following code:
     Vps_printf("zhao: video_object_detection num = %d \n ",obj_num);

    System_linkControl(SYSTEM_LINK_ID_HOST, DSP_EVENT_OBJECT_DETECT, &obj_num, sizeof(int), TRUE);

    The DSP_EVENT_OBJECT_DETECT command is defined by me,.

    #define DSP_EVENT_OBJECT_DETECT 0xABABAB20

    In ARM sides, demo.c, in function Demo_eventHandler, I added the following codes:

    // added by zhao
    if(eventId == DSP_EVENT_OBJECT_DETECT)
    {
    printf(" \n");
    printf(" Zhao: Received event DSP_EVENT_OBJECT_DETECT [0x%04x]\n", eventId);

    Zhao_GetObjectDetectStatus(pPrm);

    }

    The DSP_EVENT_OBJECT_DETECT is also defined : #define DSP_EVENT_OBJECT_DETECT 0xABABAB20

    However,when I run the demo codes, the console only output:

    [c6xdsp ]  zhao: video_object_detection num = 5

    It did not print the infomation that I added in demo.c, and it did not run the function "Zhao_GetObjectDetectStatus(pPrm);".

    I do not know how to deal with it? Pls give me some help.

    Thanks.

        Junqing Zhao

  • Can you add a print in

    /dvr_rdk/mcfw/src_linux/links/system/systemLink_tsk.c.

    Int32 SystemLink_tskMain(struct OSA_TskHndl *pTsk, OSA_MsgHndl *pMsg, Uint32 curState)

     

        Uint16 cmd = OSA_msgGetCmd(pMsg);

        printf("\n!!!Receive cmd :%d\n",cmd );

  • Thanks for your reply.

    I added the following codes in SystemLink_tskMain function:

    printf("Zhao: Host Cmd [0x%08x]\n",OSA_msgGetCmd(pMsg));

    The console output is :

    Zhao: Host Cmd [0x0000ab20].

    However, the cmd I sent from DSP is 0xABABAB02. It seems that OSA_msgGetCmd() return value is 16bits cmd,but I set a 32bits cmd . Then the demo is not work. Is my understand Right?

    But I have another doubt,in DSP sides(algLink_tsk.c),the codes cmd = Utils_msgGetCmd(pMsg);  the return cmd is a 32 bits  value. So what makes this difference?

    Thanks for your reply.

    Junqing Zhao

  • You are right msgCmd is  defined as16 bit in OSA_MsgHndl. I think you can change osa_msgq.h ro make

    typedef struct OSA_MsgHndl {

      OSA_MsgqHndl *pTo;
      OSA_MsgqHndl *pFrom; 
      void         *pPrm;
      int           status;
      Uint16        cmd;
      Uint16        flags;

    } OSA_MsgHndl;

    to

    typedef struct OSA_MsgHndl {

      OSA_MsgqHndl *pTo;
      OSA_MsgqHndl *pFrom; 
      void         *pPrm;
      int           status;
      UInt32        cmd;
      UInt32        flags;

    } OSA_MsgHndl;