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.

PROCESSOR-SDK-DRA8X: J721E-TDA4-YOCTO

Part Number: PROCESSOR-SDK-DRA8X

HI TI

can you  tell the right way to add log in csi Driver.

I try  add print log in /psdk_rtos_auto_j7_06_01_00_15/pdk/packages/ti/drv/csirx/src/csirx_drvUdma.c 489:

GT_0trace(
CsirxTrace, GT_ERR,
"TEST for log\n");   // I add  this log
qObj = (CsirxDrv_QueObj *) Fvid2Utils_dequeue(bmObj->curQ);
GT_assert(CsirxTrace, (qObj != NULL));
if(qObj != NULL)
{
GT_assert(CsirxTrace,
(chObj->chCfg->chId == qObj->chObj->chCfg->chId));
/* Check returned descriptor pointer */
GT_assert(CsirxTrace, (pDesc == ((uint64_t) qObj->trpd)));
#if (CSIRX_DRV_ENABLE_DEBUG == 1U)
gCsirxCommonObj.frmChId[gCsirxCommonObj.frmCnt] =
qObj->chObj->chCfg->chId;
gCsirxCommonObj.frmInstId[gCsirxCommonObj.frmCnt] =
qObj->chObj->instObj->drvInstId;
if (gCsirxCommonObj.getTimeStamp != NULL)
{
gCsirxCommonObj.frmTS[gCsirxCommonObj.frmCnt] =
(uint32_t)(timeStamp / 1000U);
}

when I add log print,I found the app_single_cam_main.out can't work, it will  get stuck somewhere,so can you tell the right way to add log in csi Driver.

  • Hi,

    You should not add print logs in this function for the normal scenario as this function is executed in the ISR context and we cannot/should not have prints in the ISR context.

    If your intention behind adding this log is to know if and when this function is executed then you can have a global variable that will be incremented each time this function is executed.

    Thanks & Regards,
    Vivek Dhande.

    Texas Instruments (India) Pvt Ltd

  • Hi Vivek

    I want to save the variable (qObj ),so can I  use a global variable to hold this variable? Or do you have a better suggestion?

  • Hi,

    May I know the purpose behind saving the 'qObj' variable? 

    Yes, you can use the global variable to hold the value of the above variable. You can try putting break-point otherwise if feasible.

    The same data can be attained from 'gCsirxCommonObj' variable which is global.

    Thanks & Regards,
    Vivek Dhande.

    Texas Instruments (India) Pvt Ltd

  • Hi 

    The 'qObj' variable is in TDA4 RTOS-SDK 1.0 release version:

    \psdk_rtos_auto_j7_06_01_00_15\pdk\packages\ti\drv\csirx\src\csirx_drvUdma.c : 488 lines

    function: void CsirxDrv_udmaCQEventCb(Udma_EventHandle eventHandle,

                                uint32_t eventType,
                                void *appData)
     qObj = (CsirxDrv_QueObj *) Fvid2Utils_dequeue(bmObj->curQ);
    can you help me?
    Thanks!
  • Hi,

    May I know the purpose behind knowing the 'qObj' variable value? 

    Since this is a local variable to the function, what is the intention behind saving this variable value?

    Thanks & Regards,
    Vivek Dhande.

    Texas Instruments (India) Pvt Ltd

  • Hi

     The 'qObj' variable represents the starting address of a picture memory, this is the DMA interrupt subsystem, I now is an external one camera on TDA4, if camera application to work properly, this address can be preserved by XDS560 debugger, then through 7yuvplayer (Linux version) can view camera images taken, but I have no current XDS560 debugger, so I want to manually save the address in the program, and then save to a local file, again by 7yuvplayer view, do not know whether can?If possible, please tell me how to achieve it. Thank you.

  • Hi,

     Instead of taking frame address from 'qObj', you can achieve the same from 'Fvid2_dequeue()' API.

    You can call this API in/after the application call-back issued by CSIRX driver. This API returns the list of frames that are completely captured. 

    Then you can look at 'frmList.frames[frmIdx].addr[0U]' to store the image.

    I hope this answers your questions.

    Thanks & Regards,
    Vivek Dhande.

    Texas Instruments (India) Pvt Ltd