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.

  • TI Thinks Resolved

DRA72XEVM: Switching from EarlyCaptureLateweston usecase running on IPU to Custom usecase developed to be run on A15

Intellectual 480 points

Replies: 7

Views: 216

Part Number: DRA72XEVM

Hi TI Forum,

We are using custom board having TDA2xx SoC. We are using Vision SDK 3.0.7

Our requirement is when User puts Reverse Gear in his car, we run early_capture_late_weston usecase so that within 5-6 seconds User could see the Rear Camera display. Thenafter, once User puts to Neutral, User should be able to see other cameras displayed(Front/Cabin..etc totally we have 5 cameras apart from from Reverse camera)

According to the Steps as specified in VisionSDK_Linux_UserGuide.pdf - > 3.5 - Early M4 based chains for VSDK-Linux builds

enabled the EARLY_USECASE_ENABLE to "yes" in the below cfg.mk file

vision_sdk/apps/configs/tda2xx_evm_linux_all/cfg.mk

#Enable/Disable early use-cases (yes/no)
EARLY_USECASE_ENABLE=yes

And also enabled early_capture_late_weston usecase in uc_cfg.mk file and configuring early loading of respective video driver we are able to view the camera displayed on the screen successfully during the bootup sequence.

Our next part of the requirement is to make our custom 6-Camera usecase to be run on A15 after showing reverse camera. How could we switch from early_capture_late_weston to our developed custom usecase(6-Channel Camera Display) that runs in A15(HLOS ). Our custom usecase works fine when we run apps.out having disabled the Early Usecase(EARLY_USECASE_ENABLE = no).

According to our findings, early_capture_late_weston runs on IPU2 whereas our custom is developed to be run on A15(HLOS)

At the moment after  Linux bootup is completed, we are trying to execute apps.out and below Assert is seen:

Line: 246 in dispcore/src/vpscore_dctrl.c: (DctrlCoreInfo.numPipes < VPSHAL_DSS_DISPC_PIP)

Our custom usecase is below: [totally 6 cameras including Reverse camera)

Capture -> VPE -> Display

Could you please suggest if there is a way to achieve this switching from early_capture_late_weston usecase to our custom Usecase which runs in A15? Please suggest if any Application Note available for this scenario..!!!

Thanks & Regards,

Sudhi

  • HI,

    When you exit from early usecase by pressing 'e' then it will go to system deinit and shutdown all cores.

    So if you run apps.out after that then it will fail as other cores are not running.

    As this is a custom requirement so i am not aware of perfect solution but you can try with below option.

    Modify below file

    apps/src/hlos/adas/src/common/chains_main.c

    remove #else from line no 279

    Regards,

    Anuj

  • In reply to Anuj Gupta:

    HI,

    Its been long since any update on this thread.

    I hope the issues are resolved.

    If not then please reply below or create a new thread for a different kind of query.

    Regards,

    Anuj

  • In reply to Anuj Gupta:

    Hi Anuj,

    Thanks fr the inputs. Infact I am doing the same, removed #else in chains_main.c so that our usecase gets invoked.

    However, when executed with the changes noticed that the Early Use case is again getting called before our usecase gets executed. During debugging identified that in Chains_main() [vision_sdk/apps/src/rtos/common/chains_main_linux.c] Earlyusecase is invoked again when run apps.out. Because the EARLY_USECASE_ENABLE is defined to enable Early Usecase. If the below is commented the Early usecase will not get executed during Kernel load and we would not be able to see the camera display. 

    #ifdef EARLY_USECASE_ENABLE
             Chains_EarlyUsecase(&gChains_usecaseCfg);
    #endif

    With further debugging found that the same code path is executed during kernel load and also when apps.out is run by us manually.

    main_common() //vision_sdk/links_fw/src/rtos/bios_app_common/tda2xx/ipu2/src/main_common_ipu2.c

            |

    #ifdef IPU_PRIMARY_CORE_IPU2    //We have enabled IPU2 so System_start(Chains_main) is invoked
    System_start(Chains_main);
    #else
    System_start(IPU2_main);
    #endif

    System_start() creates a task System_main

    In System_main(), gSystem_objCommon.chainsMainFunc((xdc_UArg)NULL, (xdc_UArg)NULL); statement invokes chains_main() 

    In Chains_main() the below Chains_EarlyUsecase is getting invoked. The above steps are to be executed during kernel load to enable early usecase, it is fine. However, the same is being executed again when apps.out is run. 

    #ifdef EARLY_USECASE_ENABLE
             Chains_EarlyUsecase(&gChains_usecaseCfg);
    #endif

    To avoid the above, I tried to use the below which will indicate to Chains_main() that Linux Init [gChains_usecaseCfg.linux_InitComplete = TRUE ] is complete so that using this I could stop execution of Early Usecase. However, this message is reaching the Chains_main() little late before which the Early Usecase has already started execution. 

    System_linkControl(SYSTEM_LINK_ID_APP_CTRL,
    APP_CTRL_LINK_CMD_LINUX_INIT_COMPLETE,
    NULL,
    0,
    TRUE);

    case APP_CTRL_LINK_CMD_LINUX_INIT_COMPLETE: //in AppCtrl_cmdHandler() - vision_sdk/apps/src/rtos/common/chains_main_linux.c
    gChains_usecaseCfg.linux_InitComplete = TRUE;

    So I tried to include delay as below, so that within  Task_sleep(30000)  time gChains_usecaseCfg.linux_InitComplete = TRUE and then the usecase execution is avoided. But Since the same code path is being executed during kernel loading early usecase execution gets delayed and hence delaying reverse camera video display.

    Void chains_earlyCaptureLateWeston(Chains_Ctrl *chainsCfg)
    {

          Task_sleep(30000);      

          printf("Entered chains_earlyCaptureLateWeston\n");

    if(chainsCfg->linux_InitComplete != TRUE)
    {

        chainsObj.chainsCfg = chainsCfg;

        chains_earlyCaptureLateWeston_Create(&chainsObj.ucObj, &chainsObj);

        chains_earlyCaptureLateWeston_StartApp(&chainsObj);
        while(!done)
        {
           Task_sleep(100);

            if(chainsCfg->linux_InitComplete && printNotDone)
            {
                chains_earlyCaptureLateWeston_CreateLate(&chainsObj.ucObj, &chainsObj);
                chains_earlyCaptureLateWeston_StartLate(&chainsObj.ucObj);
                printNotDone = FALSE;
                done = FALSE;
            }
    }

    }

    So could you please help me how could I make the gChains_usecaseCfg.linux_InitComplete = TRUE before early usecase is invoked.

    Below is the log extract depicting above scenario:[Attached the complete log also]nov14rvc09.txt

    [HOST] [IPU2 ] 17.169127 s: CHAINS_main(): Before AppCtrl_init()...!!!
    [HOST] [IPU2 ] 17.171536 s: CHAINS_main(): After AppCtrl_init()...!!!
    [HOST] [IPU2 ] 17.171628 s: CHAINS: Application Started !!!
    [HOST] [IPU2 ] 17.171689 s: FS Debug Chains_main : Calling non IPU1 !!!
    [HOST] [IPU2 ] 17.171780 s: CHAINS: Application Started !!!
    [HOST] [IPU2 ] 17.180564 s: BOARD: Board Init in progress !!!
    [HOST] [IPU2 ] 17.181022 s: BOARD: Board Init Done !!!
    [HOST] [IPU2 ] 17.189227 s: 
    [HOST] [IPU2 ] 17.189318 s: CHAINS: Calling Chains_EarlyUsecase ....!!!
    [HOST] [IPU2 ] 17.189379 s: Entered chains_earlyCaptureLateWeston
    [HOST] [IPU2 ] 134.600866 s: FS Debug: AppCtrl_cmdHandler() 
    [HOST] [IPU2 ] 134.600957 s: FS Debug: gChains_usecaseCfg.linux_InitComplete is set to TRUE !!!
    [HOST] [IPU2 ] 134.939791 s: FS Debug: AppCtrl_cmdHandler()

    Regards,

    Sudhi

    8814.nov14rvc09.txt

  • In reply to Sudhi Sudhi:

    Hi,

    IPU2 core will be loaded only once and by the kernel.

    So if you run apps.out manually then IPU2 code will not get executed again.

    apps.out will just run a15 core application and do IPC initialization with IPU2 core.

    So when you close early boot usecase and run apps.out again it should not call chains_main().

    For confirmation you can put a print and check its timestamp or better put a static variable and check its count and this should be 1 as it is running only once,

    If it is 2 then it is running twice.

    Regards,

    Anuj 

  • In reply to Anuj Gupta:

    Hi Anuj,

    Thanks for the inputs.

    I incorporated debug statements inside Chains_main() function and found that it is invoked when we run apps.out manually. I tried using static variable, but since the Chains_main() runs as task the previous value is not retained. When manually apps.out is run, Chains_main() is invoked and static variable gets initialised again for this context and hence prints 0 only.

    Void Chains_main(UArg arg0, UArg arg1) //vision_sdk/apps/src/rtos/common/chains_main_linux.c
    {
        static short earlyUCFlag;

        printf("Chains_main(): earlyUCFlag = %d\n", earlyUCFlag); //prints as 0

    }

    As you have mentioned to close early use case, how do I close it as it is being running in IPU2 core.

    And is there a way I could send an IPC command from apps.out running on A15 to Chains_main() running on IPU2 core. Like could I use API similar to the one below:

    System_linkControl(
    SYSTEM_LINK_ID_IPU1_0,
    SYSTEM_COMMON_CMD_GET_IP_ADDR,
    &ipuIpAddr,
    sizeof(SystemCommon_IpAddr),
    TRUE
    );

    Thanks & Regards,

    Sudhi

  • In reply to Sudhi Sudhi:

    Hi,

    When you added this print statement the how many time it got printed?

    Regards,

    Anuj

  • In reply to Anuj Gupta:

    Hi,

    Its been long since any update on this threads.

    I hope the issue is resolved.

    if not then please reply below or create a new thread for different issue.

    Regards,

    Anuj

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.