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.

TDA3XEVM: display controller driver creation

Part Number: TDA3XEVM
Other Parts Discussed in Thread: TFP410

I am trying to use DssApp example from PDK


In this project procedure "Fvid2_create" try open driver for display controller:
//---------------------------------------------------------------------------------------------------------------------
printf( ": System Init norm -> Fvid2 create...\r\n" );
// Create DCTRL handle, used for common driver configuration
appObj->dctrlHandle = Fvid2_create(
FVID2_VPS_DCTRL_DRV,
VPS_DCTRL_INST_0,
NULL, // NULL for VPS_DCTRL_INST_0
NULL, // NULL for VPS_DCTRL_INST_0
NULL); // NULL for VPS_DCTRL_INST_0

//---------------------------------------------------------------------------------------------------------------------
but fails because of no proper gFdmObj.fdmDriverObjects[...] element inside Fvid2_create procedure:
//---------------------------------------------------------------------------------------------------------------------
Fvid2_Handle Fvid2_create(UInt32 drvId,
UInt32 instanceId,
Ptr createArgs,
Ptr createStatusArgs,
const Fvid2_CbParams *cbParams )
{
Fdm_Driver *drv = NULL;
UInt32 cnt;
Fdrv_Handle drvHandle = NULL;
Fdm_Channel *channel = NULL;
Fvid2_DrvCbParams fdmCbParams, *tempCbParams;

gFdmObj.fdmDriverObjects[5].isUsed = 1;
gFdmObj.fdmDriverObjects[5].drvOps->drvId = drvId;

BspOsal_semWait( gFdmObj.lockSem, BSP_OSAL_WAIT_FOREVER );

printf("Fvid2_create : Getting the matching driver object from %d one... \n\n", FVID2_CFG_FDM_NUM_DRV_OBJS );
for( cnt = 0u; cnt < FVID2_CFG_FDM_NUM_DRV_OBJS; cnt++ )
{
printf("No:%2d, IsUsed:%d, DriverID:0x%4X - ", cnt, gFdmObj.fdmDriverObjects[cnt].isUsed, gFdmObj.fdmDriverObjects[cnt].drvOps->drvId );
if( TRUE == gFdmObj.fdmDriverObjects[cnt].isUsed )
{
if( gFdmObj.fdmDriverObjects[cnt].drvOps == NULL ) printf("Fvid2_create : [%d].drvOps is NULL !!!\n", cnt );

if( drvId == gFdmObj.fdmDriverObjects[cnt].drvOps->drvId )
{
drv = &gFdmObj.fdmDriverObjects[cnt];
// Allocate channel object
printf("ID is right! Try to fdmAllocChannelObject");
channel = fdmAllocChannelObject(); break;
} else printf("wrong ID");

} else printf("No Use...");

printf("\n");
}
//---------------------------------------------------------------------------------------------------------------------
The program prints:
//---------------------------------------------------------------------------------------------------------------------

Build time : [18:07:29 Feb 14 2018]
FVID2 Version : [FVID_02_01_00_01]
BSP Version : [PDK_01_08_00_xx]
: System Init done.
: System Init norm -> Fvid2 create...
Fvid2_create : Getting the matching driver object from 40 one...

No: 0, IsUsed:1, DriverID:0x 400 - wrong ID
No: 1, IsUsed:1, DriverID:0x 100 - wrong ID
No: 2, IsUsed:1, DriverID:0x 302 - wrong ID
No: 3, IsUsed:1, DriverID:0x1300 - wrong ID
No: 4, IsUsed:1, DriverID:0x1100 - wrong ID
No: 5, IsUsed:0, DriverID:0x 0 - No Use...
No: 6, IsUsed:0, DriverID:0x 0 - No Use...
No: 7, IsUsed:0, DriverID:0x 0 - No Use...
No: 8, IsUsed:0, DriverID:0x 0 - No Use...
No: 9, IsUsed:0, DriverID:0x 0 - No Use...
No:10, IsUsed:0, DriverID:0x 0 - No Use...
No:11, IsUsed:0, DriverID:0x 0 - No Use...
No:12, IsUsed:0, DriverID:0x 0 - No Use...
No:13, IsUsed:0, DriverID:0x 0 - No Use...
No:14, IsUsed:0, DriverID:0x 0 - No Use...
No:15, IsUsed:0, DriverID:0x 0 - No Use...
No:16, IsUsed:0, DriverID:0x 0 - No Use...
No:17, IsUsed:0, DriverID:0x 0 - No Use...
No:18, IsUsed:0, DriverID:0x 0 - No Use...
No:19, IsUsed:0, DriverID:0x 0 - No Use...
No:20, IsUsed:0, DriverID:0x 0 - No Use...
No:21, IsUsed:0, DriverID:0x 0 - No Use...
No:22, IsUsed:0, DriverID:0x 0 - No Use...
No:23, IsUsed:0, DriverID:0x 0 - No Use...
No:24, IsUsed:0, DriverID:0x 0 - No Use...
No:25, IsUsed:0, DriverID:0x 0 - No Use...
No:26, IsUsed:0, DriverID:0x 0 - No Use...
No:27, IsUsed:0, DriverID:0x 0 - No Use...
No:28, IsUsed:0, DriverID:0x 0 - No Use...
No:29, IsUsed:0, DriverID:0x 0 - No Use...
No:30, IsUsed:0, DriverID:0x 0 - No Use...
No:31, IsUsed:0, DriverID:0x 0 - No Use...
No:32, IsUsed:0, DriverID:0x 0 - No Use...
No:33, IsUsed:0, DriverID:0x 0 - No Use...
No:34, IsUsed:0, DriverID:0x 0 - No Use...
No:35, IsUsed:0, DriverID:0x 0 - No Use...
No:36, IsUsed:0, DriverID:0x 0 - No Use...
No:37, IsUsed:0, DriverID:0x 0 - No Use...
No:38, IsUsed:0, DriverID:0x 0 - No Use...
No:39, IsUsed:0, DriverID:0x 0 - No Use...
EALLOC: Invalid driver ID!!
//---------------------------------------------------------------------------------------------------------------------

So you can see no proper driver for FVID2_VPS_DCTRL_DRV, and no creation new one for it

//---------------------------------------------------------------------------------------------------------------------

I have couple of question:

1) How workaround this?

2) Where global value "gFdmObj" is initiated? I search all PDK - no assignments in PDK.

I attached CCS7 project to rewiev code.

VencRT.17.02.2018.zip

  • Looks like the DCTRL driver init with driver ID 0x101 is not registered.

    The various driver ID is part of pdk/packages/ti/drv/vps/include/vps.h file

    /** \brief Display controller driver ID used at the time of FVID2 create. */
    #define FVID2_VPS_DCTRL_DRV             (VPS_DISP_DRV_BASE + 0x00000001U)

    The display controller driver init is automatically done with Vps_init() API call.

    Can you review your init sequence with BspUtils_appDefaultInit() as provided in the application utility function present in pdk\packages\ti\drv\vps\examples\utility\src\bsputils_app.c

  • static Fdm_Object        gFdmObj; // FDM objects

    this struct has 

    typedef struct
    {
    Char *versionString; // FVID2 drivers version number as string
    UInt32 versionNumber; // FVID2 drivers version number as string
    Fdm_Driver fdmDriverObjects [FVID2_CFG_FDM_NUM_DRV_OBJS]; // FDM Driver objects
    Fdm_Channel fdmChannelObjects[FVID2_CFG_FDM_NUM_CH_OBJS ]; // FDM Channel objects
    BspOsal_SemHandle lockSem; // Semaphore to protect function calls and other memory allocation
    } Fdm_Object;

    And:

    typedef struct
    {
    const Fvid2_DrvOps *drvOps; // Driver operation table pointer
    UInt32 numOpens; // Number of times the driver is opened using create API
    UInt32 isUsed; // Flag indicating whether the object is used or not
    } Fdm_Driver;

    Why const Fvid_DrvOps ???????

    And I cannot find this driver option init steps. 

  • I removed const from driver object, set init directly:
    gFdmObj.fdmDriverObjects[5].isUsed = 1;
    gFdmObj.fdmDriverObjects[5].drvOps->drvId = 0x101;

    But I cannot find any createFxn function,
    search in VSDK brings nothing,
    drvHandle = drv->drvOps->createFxn( drvId,instanceId,createArgs,createStatusArgs,tempCbParams );

    So driver init fails.

    Where driver object data inited? No souce c code?? Only in *.obj files?
  • Hi,

    You are not supposed to change any of the driver files.
    Did you review your init sequence? Can you set through Vps_init() function and see why DCTRL init is not called as I have mentioned in my first post.
    This is in file pdk\packages\ti\drv\vps\src\vpsdrv\src\vpsdrv_init.c and function Vps_dispInit() and VpsDrv_dctrlInit().

    Regards
    Sivaraj R
  • Yes!  All these functions is executed before work and no error messages was after it.

    But....

    I use VpsDrv_dctrlInit  from  C:\ti\pdk\packages\ti\drv\vps\src\vpslib\drv\src\vps_dctrlDrv.c

    This is too small:

    Int32 VpsDrv_dctrlInit(const VpsDrv_DctrlInitParams *initPrms)
    {
    gDctrlDrvObj.drvInstId = 0;
    gDctrlDrvObj.coreInstObj = initPrms->coreInstObj;
    gDctrlDrvObj.coreOps = initPrms->coreOps;

    gDrvInit = 1U;
    return BSP_SOK;
    }

    And I saw another reincarnation of this function at C:\ti\pdk\packages\ti\drv\vps\src\vpsdrv\dispdrv\src\vpsdrv_dctrl.c:

    Int32 VpsDrv_dctrlInit(const VpsDrv_DctrlInitParams *initPrms)
    {
    Int32 retVal = FVID2_SOK;
    VpsDrv_DctrlCommonObj *pObj;
    Int32 initValue;

    pObj = &gVpsDctrlCommonObj;
    BspUtils_memset(pObj, 0, sizeof (VpsDrv_DctrlCommonObj));

    /* Initialize instance object members */
    pObj->instObj = &gVpsDctrlInstObj;

    pObj->instObj->coreInstObj = initPrms->coreInstObj;
    pObj->instObj->coreOps = initPrms->coreOps;

    /* Allocate instance semaphore */
    initValue = 1;
    pObj->instObj->lockSem = BspOsal_semCreate(initValue, FALSE);
    if (NULL == pObj->instObj->lockSem)
    {
    GT_0trace(VpsDrvDctrlTrace, GT_ERR,
    "Instance semaphore create failed!!\r\n");
    retVal = FVID2_EALLOC;
    }

    pObj->instObj->state.isInit = (UInt32) TRUE;
    pObj->instObj->state.isOpened = (UInt32) FALSE;
    pObj->instObj->state.isStarted = (UInt32) FALSE;

    if (FVID2_SOK == retVal)
    {
    /* Initialize Driver operations */
    Fvid2DrvOps_init(&pObj->fvidDrvOps);

    pObj->fvidDrvOps.drvId = FVID2_VPS_DCTRL_DRV;
    pObj->fvidDrvOps.createFxn = &VpsDrv_dctrlCreate;
    pObj->fvidDrvOps.deleteFxn = &VpsDrv_dctrlDelete;
    pObj->fvidDrvOps.controlFxn = &VpsDrv_dctrlControl;

    retVal = Fvid2_registerDriver(&pObj->fvidDrvOps);
    if (FVID2_SOK != retVal)
    {
    GT_0trace(VpsDrvDctrlTrace, GT_ERR,
    "Registering to FVID2 driver manager failed\r\n");
    }
    else
    {
    /* Init successful */
    pObj->isRegistered = (UInt32) TRUE;
    }
    }

    return (retVal);
    }

    Maybe I use improper function?

  • Hi,

    These two init functions are actually for the two different layer. The first one is for the the lower layer, ie vps lib layer. the second one is for the FVID2 layer. 

    Please call the init function depending on which layer you are using in your application.

    Rgds,

    Brijesh

  • Also I am wondering why you are calling the DCTRL init directly without calling Vps_init(). Under VPS component there are many sub components and inter dependencies which is taken care by the Vps_init() function. So TI doesn't recommend to call any internal functions directly from user application. All the interface for the user application is well separated out and is part of vps/include folder. So user application should call only those functions which exposed in those header files.

    Can you explain what are you trying to achieve? We can guide you better if we know what is the usecase and where to start with. I would suggest that you start from one of the DSS example present in vps/examples/dss folder and then modify based on your usecase.

  • No direct calls. I call Vps_init() only.
    I simply want to transfer Dss example makefile project to CCS7,
    so I need to deside which *.c source I must add to project.
  • Hi Alexander,

    Do you want to move all the library source files to CCS project?
    There are many compile flags which are defined in the makefile and depending on the flags different code is executed.
    Best recommendation will be to take the VPS library compiled using makefile and link it with CCS project having source files for DSS example.

    Regards,
    Rishabh
  • I wish to move all library sources to CCS (for 1 time to forget furver), but have no enough time yet to it. So I move only necessary set of sources.
    Can you advice some software utils and pdf docs to navigate well incide set of PDK makefiles ??
  • I excluded vps_dctrlDrv.c from compilation, now vpsdrv_dctrl.c is instead. Compile is success.

    In bsputils_App.c
    there are 2 types of I2C Init, choosen by VPS_TI_RTOS_I2C compile key:

    #if defined (VPS_TI_RTOS_I2C)
    I2C_init( SOC_I2C1_BASE );
    #else
    printf( "I2C: %d instances", i2cData->numInst );
    for( instCnt = 0U; instCnt < i2cData->numInst; instCnt++ )
    {
    i2cInstData = &i2cData->instData[instCnt];

    i2cInitParams[instCnt].opMode = HSI2C_OPMODE_INTERRUPT;
    i2cInitParams[instCnt].isMasterMode = TRUE;
    i2cInitParams[instCnt].is10BitAddr = FALSE;
    i2cInitParams[instCnt].i2cBusFreq = (lld_i2c_busspeed) i2cInstData->busClkKHz;
    i2cInitParams[instCnt].i2cIntNum = i2cInstData->intNum;
    i2cInitParams[instCnt].i2cOwnAddr = 0xCC;

    gI2cDevInitParams[instCnt].initParams = &i2cInitParams[instCnt];
    gI2cDevInitParams[instCnt].hsi2c_sem = BspOsal_semCreate((Int32) 1, (Bool) TRUE);
    gI2cDevInitParams[instCnt].instId = i2cInstData->instId;
    }
    printf( "I2C: param init done." );

    if( i2cData->numInst > 0 )
    {
    retVal += I2c_GlobalInit( i2cData->numInst, &gI2cDevInitParams[0U] );
    if ( BSP_SOK != retVal ) printf("Error: I2C Init failed!!\r\n");
    else printf(" I2C Init done. \r\n");
    }
    #endif


    Can I deactivate VPS_TI_RTOS_I2C compile key? Now I use SYS/BIOS.
  • Here is hierarhy of VPS DSS Init:


    void DSS_Init_Path( void )
    {
    DispApp_Obj *appObj = NULL;

    DispApp_init( appObj );
    // ->>> -------------------------------------------------------------
    BspUtils_appDefaultInit( isI2cInitReq );
    // ->>> ---------------------------------------------
    // Объявляется - commonInitPrms
    BspCommonInitParams_init( &commonInitPrms ); // Почти без действий
    Bsp_commonInit ( &commonInitPrms ); // Совершенно пустая (см. ниже)
    // ->>>
    BspUtils_init(); // Совершенно пустая

    BspBoardInitParams_init ( &boardInitPrms ); // 3 общих параметра для - boardInitPrms
    Bsp_boardInit ( &boardInitPrms );
    // ->>>
    BspBoardInitParams_init( &localInitPrms ); // Если boardInitPrms нулевой (повтор)
    Bsp_boardTda3xxInit(); // При необходимости - но тоже пустая

    BspPlatformInitParams_init( &platInitPrms ); // 5 параметров
    Bsp_platformInit ( &platInitPrms );
    // ->>>> -------------------------
    BspPlatformInitParams_init(); // Повторный вызов - если пустые параметры
    Bsp_platformTda3xxInit(); // Pin MUX, Xbar, IRQ
    Bsp_platformTda3xxGetCpuRev();
    Bsp_platformTda3xxGetPackageType();
    //---------------------------------
    // Инициализация обобщенного драйвера FVID2
    // Для Display Controller
    Fvid2_init( NULL ); // Общие поля - gFdmObj
    VpsInitParams_init( &vpsInitPrms ); // Общие параметры

    Vps_init( &vpsInitPrms );
    // ->>> ------------------------------------
    vpsInitTda3xxPlatData(); // Параметры - gVpsDrvPlatDataTda3xx
    VpsInitParams_init( &localInitPrms ); // если не проинициализировано до
    VpsLib_init(&vpsLibInitPrms);
    // ->>> -------------------------------
    VpsLibInitParams_init( &localInitPrms ); // Параметры
    VpsHal_init( &halInitPrms );
    // ->>> -------------------------------------
    VpsHal_getPlatformData(); // Возвращает - gVpsHalPlatDataTda3xx
    VpsHal_dssVidInit(); // Инициализирует VID Objects
    // ->>> ----------------
    halDssVidInitInstance(); // Создает и настраивает объекты для всех VID
    //----------------------
    VpsHal_dssOvlyInit(); // Создает объект для оверлеев
    // --->>> -----------------------------
    halDispcOvlyInitInstance(dispcOvlyObj); // Создает объект для оверлеев
    halDispcReset(); // Сброс контроллера дисплея
    halDispcSetDefIntfWidth(); // Set the DPI interface width to 24bit
    //-------------------------------------
    //-------------------------------------------
    VpsHal_open();
    // ->>> -------------------------------
    VpsLib_getPlatformData();
    VpsHal_dssVidOpen( &vidPipeOpenPrms ); // Несколько раз открывает Video Pipe
    //-------------------------------------
    Vps_commonInit(initPrms);
    // ->>> ------------------
    VpsLib_getPlatformData(); // Во второй раз
    //------------------------
    Vps_dispCoreInit(initPrms);
    // ->>> -------------------------
    VpsLib_getPlatformData(); // В третий раз
    VpsCore_dssInit ( &dssCoreInitPrms );
    // ->>> ------------------------------
    BspUtils_initPool();
    //------------------------------------
    VpsCore_dssWbInit( &dssWbCoreInitPrms);
    // ->>> ------------------------------
    BspUtils_initPool();
    //------------------------------------


    VpsCore_dctrlInit( &dctrlCoreInitPrms );
    // ->>> -----------------------------
    VpsCore_DctrlInit(pNewObj);
    // ->>> ------------------
    VpsCore_DctrlGraphInit();
    // ->>> ------------------
    Vgraph_Init();
    // ->>> -------------------------------
    Vgraph_Connect(inNodeList, inEdgeList); // Автономная
    //-------------------------------------
    //------------------------
    //------------------------
    BspOsal_clearIntr();
    BspOsal_registerIntr();
    //-----------------------------------



    //-------------------------------
    //-------------------------------------
    //------------------------------------------

    //
    BspUtils_memInit();
    BspUtils_prfInit();
    BspUtils_appInit();
    BspUtils_uartInit();
    BspOsal_Init( &bspOsalInitPrms );
    Bsp_platformPrintInfo();
    Bsp_boardPrintInfo();
    //---------------------------------------------------
    appObj->dctrlHandle = Fvid2_create;
    DispApp_configureVideoPllAndClkSrc( appObj, defPixelClk );
    Bsp_platformEnableHdmiPll(TRUE);
    DispApp_LoadBuf( appObj, &gDispDssLoadBufCfg[bufCfgId] );
    //--------------------------------------------------------------------
    Bsp_boardGetId();
    // Далее в цикле определяется номер теста
    testId = DispApp_getTestId( appObj );
    // И выполняется соответствующий тест
    DispApp_runTest( appObj, testPrms );
    // И заканчиваем
    DispApp_deInit( appObj );
    };
  • [Cortex_M4_IPU1_C0] enter main()
    Error Init >>>
    Task create >>>
    BIOS start >>>
    enter taskFxn()
    Start Display ....
    Start Display DSS...
    : Sample Application - STARTS !!!
    inside DispApp_init -> try BspUtils_appDefaultInit...
    Starting BspUtils_appDefaultInit
    Starting Bsp_commonInit
    ...over...start BspBoardInitParams_init
    --- No initPrms->customData => call Bsp_boardTda3xxInit();
    Board Init normal.
    BspPlatformInitParams_init done.
    : CPU Rev.1.0
    : Package 15x15
    Platform Init done.
    FVID2 Empty Init Done.
    VpsInitParams_init done.
    start Vps_init...
    Inside Vps_init - try vpsInitTda3xxPlatData
    inside vpsInitTda3xxPlatData...
    End vpsInitTda3xxPlatData...
    Try VpsLib_init...
    Inside VpsLib_init...->BspUtils_memset
    VpsHal_init done.
    VpsLib_getPlatformData done.
    *** VIDEO PIPES ***
    The number of Video Pipes - 3Start to Open VIDEO Pipeline HALs...
    The number of video Pipes - 3
    Trying to dssVid Open HAL count - 0
    Open VIDEO Pipeline HALs done.
    Trying to dssVid Open HAL count - 1
    Open VIDEO Pipeline HALs done.
    Trying to dssVid Open HAL count - 2
    Open VIDEO Pipeline HALs done.
    The number of WB Pipes - 1Start to Open WB Pipeline HALs...
    Open WB Pipeline HALs done.
    --- The number of Overlay Managers - 2
    Start to Open Overlay HALs...
    Open Overlay HALs done.
    Open Overlay HALs done.
    VpsHal_open done.
    Vps_commonInit done.
    VpsLib_init done.
    VpsDrv_ctrlInit done.
    Vps_dispInit done.
    VPS Init done.

    ------------------------------------
    Bsp_boardGetI2cData start...... Bsp_boardGetI2cData done.
    BspDeviceInitParams_init done.
    Device Init done.
    App MEM Utils Init done.
    App PRF Utils Init done.
    App Utils Init done.
    BspOsal_Init done.

    Build time : [13:32:33 Feb 21 2018]
    FVID2 Version : [FVID_02_01_00_01]
    BSP Version : [PDK_01_08_00_xx]
    Platform : [EVM]
    SOC : [TDA3XX]
    SOC Revision : [ES1.0]
    FT Revision : [0]
    Package : [15x15]
    Core : [M4]
    Board Detected : [UNKNOWN]
    I2C0: Instance NOT enabled during init ... ERROR !!!
    I2C0: Instance NOT enabled during init ... ERROR !!!
    EEPROM read failed!!
    Base Board Revision : [REV A]
    Daughter Card Revision: [REV A]



    : System Init done.

    : System Init norm -> Fvid2 create...
    Fvid2_create : Getting the matching driver object from 40 one...

    No: 0, IsUsed:1, DriverID:0x 400
    No: 1, IsUsed:1, DriverID:0x 101
    --- ID is right !!! Try to fdmAllocChannelObject
    fdmAllocChannelObject : free channel object is allocated

    Load 4 YUV422I_YUYV video frames of size 1920x1080 to location: 0x80000000
    Trying to Load buffer from SD card.

    Load 4 BGR24_888 video frames of size 1920x1080 to location: 0x80fd2000
    Trying to Load buffer from SD card.


    : DispApp_init() - DONE !!!
    Display App Init done !!!




    --- TEST N4
    : HANDLES 1: RUN COUNT 30: INPUT:1 !!!
    Invalid device driver ID!!
    Invalid device driver ID!!
    Invalid device driver ID!!
    I2C0: Instance NOT enabled during init ... ERROR !!!
    I2C write failed!!
    I2C0: Instance NOT enabled during init ... ERROR !!!
    I2C write failed!!
    I2C0: Instance NOT enabled during init ... ERROR !!!
    I2C read failed!!
    Device select mode failed
    e: 0x8f012da8.
    Task stack size: 0x800.
    R0 = 0xffff0000 R8 = 0xffffffff
    R1 = 0xffff0004 R9 = 0xffffffff
    R2 = 0x00000000 R10 = 0xffffffff
    R3 = 0x00000000 R11 = 0xffffffff
    R4 = 0x5e5c5d80 R12 = 0x8f018030
    R5 = 0x0000000f SP(R13) = 0x8f013468
    R6 = 0x2f2e2ec0 LR(R14) = 0x8f02d6df
    R7 = 0xffffffff PC(R15) = 0x0000009e
    PSR = 0x81000000
    ICSR = 0x0440f803
    MMFSR = 0x00
    BFSR = 0x86
    UFSR = 0x0000
    HFSR = 0x40000000
    DFSR = 0x00000001
    MMAR = 0xffff0038
    BFAR = 0xffff0038
    AFSR = 0x00000000
    Terminating execution...




    Maybe all right for Display Controller Init?
    DispApp_init() - Is done with no errors....
  • Hi,

    Can you step inside and see why this is failing?

    Regards

    Sivaraj R

  • Now It seems Display controller works - I see this driver (0x101) In sequence.

    Now I call DispApp_configureLCD( DispApp_Obj *appObj )
    This procedure call
    Procedure Bsp_boardGetVideoDeviceInstId returns Invalid device driver ID :
    //---------------------------------------------------------------------------------------------------------------------
    UInt32 Bsp_boardGetVideoDeviceInstId( UInt32 devDrvId, UInt32 drvId, UInt32 drvInstId )
    {
    UInt32 instId = BSP_BOARD_INVALID_INST_ID;
    UInt32 devCnt;
    const Bsp_BoardData *boardData;
    const Bsp_BoardDeviceData *devData;

    boardData = Bsp_boardGetData();
    GT_assert(BspBoardTrace, (boardData != NULL));

    for( devCnt = 0U; devCnt < boardData->numDev; devCnt++ )
    {
    GT_assert(BspBoardTrace, (boardData->devData != NULL));
    devData = &boardData->devData[devCnt];
    if( (devData->devDrvId == devDrvId ) &&
    (devData->drvId == drvId ) &&
    (devData->drvInstId == drvInstId) )
    {
    instId = devData->instId;
    break;
    }
    }

    if( BSP_BOARD_INVALID_INST_ID == instId ) printf("Invalid device driver ID!! (instId)\r\n");

    return( instId );
    }
    //---------------------------------------------------------------------------------------------------------------------

    I want not to use LCD, only external DPI HDMI encoder SII9022 (1 variant)

    Next variant - TDA3xx inner PAL encoder.

    Now I use test ID = 14 for PAL
    and test ID = 4 for HDMI

  • Maybe simply switch off LCD? How it could be done simply?
  • If you are using the DSS example provided in the PDK package (pdk\packages\ti\drv\vps\examples\dss\displayDss\src), then just set the encDrvId in the corresponding option in gDispAppTestPrms[] test variable to 0. This will skip all LCD configuration from example. You need to then program the HDMI controller using I2C.
    BTW are you using TDA3xx TI EVM? Then the example already supports HDMI SIL9022A display present in the base board. You can just run the right option.
  • yes - that board on my table and sil9022 (You are calligraphy education person (right manner) - everywere in code - "sii"...9022 - dont now why).

    I want to know - if a want PAL inner decoder - why avoid LCD counre points?
  • has sil9022 - Starter Kit 15x15 TDA3x ES1.0 GP (EVMTDA3G-01-40-00 01NOV16 703754-1101 REV A)
  • Alex,

    TDA3x Starter Kit is not yet officially supported in PDK. This is planned in Apr'18 release.

    In the meanwhile I have asked our partner D3 Engineering to check and help you.

    Regards

    Sivaraj R

  • Yes - I try launch test N14:

    { //-------------------------------------------------------------------------
    14U, // Test case id
    "DSS Video1 (YUY422I) -> DPI1 -> SD-VENC(PAL)", // testDescStr
    1U, // num of encoders
    { 0, }, // encDrvId[]
    { VPS_DCTRL_DSS_VENC_LCD1, }, // vencId[]
    { FVID2_STD_PAL, }, // standard[]
    TRUE, // isSdVenc
    FALSE, // isRtParamUpdateTest
    1U, // numofHandles
    { VPS_DISP_INST_DSS_VID1, }, // instId[]
    { FVID2_DF_YUV422I_YUYV, }, // inDataFmt
    { 720, }, // inWidth
    { 576, }, // inHeight
    { 0U, }, // Posx
    { 0U, }, // Poxy
    { FVID2_SF_INTERLACED, }, // Scan Format
    { TRUE, }, // Field Merge
    DISP_APP_RUN_COUNT, // runCount
    BSP_BOARD_MODE_DEFAULT, // boardMode
    (BSP_BOARD_BASE_TDA3XX | BSP_BOARD_MULTIDES), // boardId
    },


    So - it seemed encDrvId==14 already as default.
  • --- TEST N14
    : HANDLES 1: RUN COUNT 150: INPUT:1 !!!
    Try to call DispApp_create
    Try to call DispApp_initParams
    DispApp_initParams Done.
    Inside DispApp_create() -> 1 encoders to configure
    DispApp_create : Encoder - 0
    Encoder driver - LCD or HDMI SII9022A or DS90UH925
    Pin Muxing Done
    Encoder driver - LCD
    Start DispApp_configureLCD
    Invalid device driver ID!! (instId)
    DispApp_configureLCD()-Try: Power on LCD controller (Bsp_boardPowerOnDevice)
    DispApp_configureLCD()-Try: select lcd Controller at board level mux (Bsp_boardSelectDevice)
    DispApp_configureLCD()-Try: Perform any reset needed at board level (Bsp_boardResetDevice)
    DispApp_configureLCD()-Try: Select specific mode ()


    So is it normal - instId = 0 - so - Invalid device driver ID!!
  • Below is the response I got from D3

    The Starterkit does not use the SIL9022, it uses the TFP410. To initialize the TFP410 the PDn signal must be set high to bring the TFP410 out of reset. This is done by setting IO1_7 high of the GPIO expander (TCA9539PW) located at U22 and I2C addess 0xE4 (7-bit). The writes to perform this are

     

        UInt8 regAddr;

        UInt8 regData;

     

    #define RVP_IOEXP_I2C_ADDR  (0x74)

            /* TFP410 enable */

            /* enable TFP410 output, bit 7 of Expander set to output */

            regAddr = 7;

            regData = 0x0;

            retVal = Bsp_deviceRead8(

                                BSP_DEVICE_I2C_INST_ID_1,

                                RVP_IOEXP_I2C_ADDR,

                                &regAddr,

                                &regData,

                                1);

            regData &= 0x7F;

            retVal = Bsp_deviceWrite8(

                                BSP_DEVICE_I2C_INST_ID_1,

                                RVP_IOEXP_I2C_ADDR,

                                &regAddr,

                                &regData,

                                1);

     

     

    No other initialization is necessary to configure the TFP410

  • No No! 

    I use Spectrum Digital TDA3x EVM ES1.0 GP Kit with  Sil9022

  • Then the DSS example should work out of the box without any change. I am bit lost here. Can you reexplain what your problem is?

  • Note: When I say out-of-the-box I mean no change in drivers and examples are needed. If you have the original PDK version with you, then they should work as is if you build and run through CCS. You need to select the right example option through UART to display in the HDMI. What version of PDK are you using?
  • VencRT.28.02.2018.zipNice!!!

    Now we are at most interest and important point.

    All examples are linux-make-file style projects. 

    And no guidelines how quickly convert such project to CCS project. Here was advices "carefully take some files and form CCS project manually". So I am have done it, but encounter to some features of code:

    1) A part of #include directives is wrong - I suppose this compensates by linux and make behavour - I correct it (with some probability to make a mistake).

    2) Some TDA3x files need constants from TDA2x one - I manually deside which one to add.

    3) Similar procedures from different files from different levels - need to decide which one is dedicated for.

    We need compact set of functions to work with TDA3x, this example is only starting point for work. PDK are too huge to use it as is, with no change. 

    Now I complete convertion to CCS, project compiles and launches but works improper in some points. I attached this project. 

    I can see console output:

    [Cortex_M4_IPU1_C0] enter main()
    Error Init >>>
    Task create >>>
    Start Display ....
    Start Display DSS...
    : Sample Application - STARTS !!!
    inside DispApp_init -> try BspUtils_appDefaultInit...
    Starting BspUtils_appDefaultInit
    Starting Bsp_commonInit
    ...over...start BspBoardInitParams_init
    --- No initPrms->customData => call Bsp_boardTda3xxInit();
    Board Init normal.
    BspPlatformInitParams_init done.
    : CPU Rev.1.0
    : Package 15x15
    Platform Init done.
    FVID2 Empty Init Done.
    VpsInitParams_init done.
    start Vps_init...
    Inside Vps_init - try vpsInitTda3xxPlatData
    inside vpsInitTda3xxPlatData...
    End vpsInitTda3xxPlatData...
    Try VpsLib_init...
    Inside VpsLib_init...->BspUtils_memset
    VpsHal_init done.
    VpsLib_getPlatformData done.
    *** VIDEO PIPES ***
    The number of Video Pipes - 3Start to Open VIDEO Pipeline HALs...
    The number of video Pipes - 3
    Trying to dssVid Open HAL count - 0
    Open VIDEO Pipeline HALs done.
    Trying to dssVid Open HAL count - 1
    Open VIDEO Pipeline HALs done.
    Trying to dssVid Open HAL count - 2
    Open VIDEO Pipeline HALs done.
    The number of WB Pipes - 1Start to Open WB Pipeline HALs...
    Open WB Pipeline HALs done.


    --- The number of Overlay Managers - 2
    Start to Open Overlay HALs...
    Open Overlay HALs done.
    Open Overlay HALs done.
    VpsHal_open done.
    Vps_commonInit done.
    VpsLib_init done.
    VpsDrv_ctrlInit done.
    Vps_dispInit done.
    VPS Init done.

    ------------------------------------
    App MEM Utils Init done.
    App PRF Utils Init done.
    App Utils Init done.
    BspOsal_Init done.

    Build time : [14:50:29 Feb 27 2018]
    FVID2 Version : [FVID_02_01_00_01]
    BSP Version : [PDK_01_08_00_xx]
    Platform : [EVM]
    SOC : [TDA3XX]
    SOC Revision : [ES1.0]
    FT Revision : [0]
    Package : [15x15]
    Core : [M4]
    Board Detected : [UNKNOWN]
    Base Board Revision : [UNKNOWN]
    Daughter Card Revision: [UNKNOWN]
    : System Init done.
    : System Init norm -> Fvid2 create...
    Fvid2_create : Getting the matching driver object from 40 one...

    No: 0, IsUsed:1, DriverID:0x 400
    No: 1, IsUsed:1, DriverID:0x 101
    --- ID is right !!! Try to fdmAllocChannelObject
    fdmAllocChannelObject : free channel object is allocated
    : DCTRL Create after Fvid2_create done.
    Start Bsp_platformSetPllFreq...
    Inside Bsp_platformTda3xxSetPllFreq....Try PMLIBVideopllSetFreq...
    : Configuring Pll done.
    : Setting Venc clock source done.
    Load 4 YUV422I_YUYV video frames of size 1920x1080 to location: 0x80000000
    Trying to Load buffer from SD card.
    Load buffer done.
    Load 4 BGR24_888 video frames of size 1920x1080 to location: 0x80fd2000
    Trying to Load buffer from SD card.
    Load buffer done.
    : DispApp_init() - DONE !!!
    Display App Init done !!!

    vvv --- TEST N14 ------------------------------------------------ vvv
    : HANDLES 1: RUN COUNT 150: INPUT:1 !!!
    Try to call DispApp_create
    Try to call DispApp_initParams
    DispApp_initParams Done.
    Inside DispApp_create() -> 1 encoders to configure
    DispApp_create : Encoder - 0
    Encoder driver - LCD or HDMI SII9022A or DS90UH925
    Pin Muxing Done
    Encoder driver - LCD
    Start DispApp_configureLCD
    Invalid device driver ID!! (instId)
    DispApp_configureLCD()-Try: Power on LCD controller (Bsp_boardPowerOnDevice)
    Device Power On Done.
    DispApp_configureLCD()-Try: select lcd Controller at board level mux (Bsp_boardSelectDevice)
    Device select done.
    DispApp_configureLCD()-Try: Perform any reset needed at board level (Bsp_boardResetDevice)
    Device reset done.
    DispApp_configureLCD()-Try: Select specific mode ()
    Bsp_boardSelectMode: Bsp_boardLock()
    Bsp_boardLock() Done.
    Board Mode is real
    Bsp_boardSelectMode: Bsp_boardUnlock()
    Bsp_boardUnlock() done.
    Device select specific mode done.
    Start DispApp_configDctrl
    VpsDctrlConfig_init done.
    Start Fvid2ModeInfo_init (LCD1)
    Fvid2ModeInfo_init done.
    Core control: Set venc output failed!!
    : DCTRL Set Venc Output IOCTL Failed!!!
    : DCTRL Set ADV TDM Pramas done.
    Unsupported standard!!
    Mode not supported
    Core control: Set Config failed!!
    : DCTRL Set Config IOCTL Failed!!!
    : DCTRL Set Pipeline params IOCTL done.
    DispApp_configDctrlPipe done.
    Start Bsp_platformSetPllFreq...
    Inside Bsp_platformTda3xxSetPllFreq....Try PMLIBVideopllSetFreq...
    : Configuring Pll Failed!!!
    : Configuring Video PLL Failed!!!
    DispApp_configDctrl Done
    Fvid2_create : Getting the matching driver object from 40 one...

    No: 0, IsUsed:1, DriverID:0x 400
    No: 1, IsUsed:1, DriverID:0x 101
    No: 2, IsUsed:1, DriverID:0x 100
    --- ID is right !!! Try to fdmAllocChannelObject
    fdmAllocChannelObject : free channel object is allocated
    Invalid in queue length(0)
    Driver create failed!!
    : Display Create Failed!!!
    : Starting display ... !!!
    : Display in progress ... DO NOT HALT !!!
    EBADARGS: NULL pointer!!
    : Display Start Failed!!!
    --- TEST END ---------------------------------------------------------------
    Display DSS done.

  • Maybe it should be better to stady hierarch of make-files (127 ones in PDK) to garantee proper set of predefined symbols and filesets in CCS project. Can you point to according document with imprehensive description of PDK make file set?
  • PDK makefile is build hierarchically. We have a top level makefile which define generic "-D" options. You can look at the files (build_config.mk, component.mk) in pdk/packages/ti/build/makerules for these. Search for -D in these files. Or alternative find the options by remove -s while doing make.

    Next each of the sub-module define it's own component.mk file at the base of the module folder. For example refer pdk/packages/ti/csl/csl_component.mk and pdk/packages/ti/drv/vps/vps_component.mk.

    While building these modules, the compiler flags are added on top of the generic compiler flags defined in makerules folder.

    Since the VPS module has multiple drivers, we have provided options to selectively compiler only required files/drivers based on -D option. So I think while building the VPS files, some of the required -D options are omitted. Kindly refer to pdk/packages/ti/drv/vps/vps_component.mk and see if you have missed any of the option in the CCS project.

    Specifically you will need below compiler options for VPS module build for TDA3xx.

    -DTRACE_ENABLE
    -DASSERT_ENABLE
    -DVPS_VIP_BUILD
    -DVPS_CAPT_BUILD
    -DVPS_VIP1_BUILD
    -DVPS_DSS_BUILD
    -DVPS_DISP_BUILD
    -DVPS_CAL_BUILD
    -DVPS_CAPT_BUILD
    -DVPS_ISS_BUILD
    -DVPS_ISS_ISP_DEF
    -DVPS_ISS_BUILD
    -DVPS_SIMCOP_BUILD

    Again the files to build is present in the various .mk files present in each of the folder based on the package/driver selection which gets propagated through the make system.

  • OK - At first. You are, in the nike windows macine - only VSDK and CCS - do you can quickly show way to make quickly analog of DSS example??? The matter does it exist or it may be only in linux macine with neigbour effects ??? I really need to know.
  • Sorry. Can you refine your question? I could not follow
  • OK... Let's I will try to convert manually DSS project from make form to CCS form. And I will be ask your help in some critical points.

    You insist DSS example project can be converted with no changes.

  • We don't have one currently. But we are planning to create a wiki by the end of this month about the PDK make system. I will post it once it is done.

  • Only how to launch DSS - to see how Display works

    It would be wery appretiate you depict how quickly transfer project to CCS.

    1) Predefined symbols

    2) File list

  • Can I simply copy pdk with only 1 example DSS project?
    Does CCS can understand structure of make files?
  • CCS can't understand the makefile present in PDK.

    BTW the wiki page for makefile used in PDK will be done by 20th April 2018 only. I will keep you posted when its done.