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.

TDA4VEN-Q1: TIOVX : kernel init for node 0, kernel com.ti.csitx ... failed !!!

Part Number: TDA4VEN-Q1

Hi TI experts:

SDK link [here](www.ti.com/.../TDA4VEN-Q1

    When I tried  to use app_multi_cam demo to test csitx driver : 

   I confront such error: 

   

main.c file of app_multi_cam containing my code is attathed below

8407.main.c

Hope for your help! 

BR

stream

  • Hi  TI experts:

        I opened the Debug log print , Here is more error infomation from MCU20:

       

    BR

    stream

  • Hi Nikhil : 

        Thank u for reply! 

        I reflash my sdcard and replace only vx_arm_app_multi_cam.out ,  vxVerifygraph passed. 

       But it stucks at  `vxGraphParameterDequeueDoneRef` Now

      I look into this function ,it stucks at  `ownDataRefQueueWaitDoneRef`

       Can u analyse possible cause?

    Hope for your help!

    BR

    stream

  • Hi TI experts: 

        I try to use `vxProcessGraph` instead of  using TIOVX pipeline enqueue&deque.
        And vxProcessGraph will also stuck 

       Here is the log:
       

    and my code attached here:

    0160.main.c

    Really hope your help.  This is much meaningful for me.

    BR

    stream

  • Hi :  

    Will  `addr_translate` module impact tiovx process?

    I notice that before and after I comment the following code in  example.syscfg of mcu20 :

    capture and csitx and display node show diffrent errors .

    BR

    stream

  • Yes, it should be required, as per system memory map, DDR_SHARED_MEM is available at 0xC0000000 location. 

    This essentially configures RAT on R5F, But CSITX does not require this translation, because it does not access this memory form R5F. 

    I will raise the bug on it.

    Regards,

    Brijesh

  • If possible, can you please print both of these addresses in tivxCsitxEnqueueFrameToDriver API in video_io\kernels\video_io\csitx\vx_csitx_target.c file with above translation enabled and share the log? 

    transmit_frame = tivxMemShared2PhysPtr(
    (image->mem_ptr[0].shared_ptr + (uint64_t)tivxComputePatchOffset(0, 0, &image->imagepatch_addr[0U])),
    TIVX_MEM_EXTERNAL);

    VX_PRINT(VX_ZONE_ERROR, " CSITX: Target Buffer %x Shared Buffer %x!!!\n", transmit_frame, image->mem_ptr[0].shared_ptr);

    Regards,

    Brijesh

  • Hi Brijesh :

    Thank u for explaination!!

    I add the VX_PRINT but code seems not running  into  `tivxCsitxEnqueueFrameToDriver` which is subcall func of  `tivxCsitxProcess`

    Am i wrong ?

    BR

    stream

  • Hi Brijesh :

    Test code attached above.

    And 

    example.syscfg of mcu20: 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /**
    * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
    * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    * @cliArgs --device "J722S_TDA4VEN_TDA4AEN_AM67" --package "AMW" --part "Default" --context "main-r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    * @versions {"tool":"1.20.0+3562"}
    */
    /**
    * Import the modules used in this configuration.
    */
    const dss = scripting.addModule("/drivers/dss/dss", {}, false);
    const dss1 = dss.addInstance();
    /* Not required
    const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false);
    const gpio1 = gpio.addInstance();
    */
    const i2c = scripting.addModule("/drivers/i2c/i2c", {}, false);
    const i2c1 = i2c.addInstance();
    const i2c2 = i2c.addInstance();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    BR

    stream

  • Hi Stream,

    Do you see any other print from the mcu_0 core? It seems none of the prints are coming. Are you running vision_apps_init.sh script to run remote log service?

    Regards,

    Brijesh

  • Hi Brijesh :

       Yes,  I do run ./vision_app_init.sh before run_app_multi_cam.sh . And I did see the print from the mcu cores :

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [MCU2_0] 5.500580 s: CIO: Init ... Done !!!
    [MCU2_0] 5.500623 s: CPU is running FreeRTOS
    [MCU2_0] 5.500635 s: APP: Init ... !!!
    [MCU2_0] 5.500646 s: SCICLIENT: Init ... !!!
    [MCU2_0] 5.503839 s: SCICLIENT: DMSC FW version [9.0.6--w2023.01-j722s (Kool Koa]
    [MCU2_0] 5.503857 s: SCICLIENT: DMSC FW revision 0x9
    [MCU2_0] 5.503870 s: SCICLIENT: DMSC FW ABI revision 3.1
    [MCU2_0] 5.503883 s: SCICLIENT: Init ... Done !!!
    [MCU2_0] 5.503895 s: MEM: Init ... !!!
    [MCU2_0] 5.503908 s: MEM: Created heap (DDR_LOCAL_MEM, id=0, flags=0x00000004) @ b5800000 of size 33554432 bytes !!!
    [MCU2_0] 5.503935 s: MEM: Init ... Done !!!
    [MCU2_0] 5.503946 s: IPC: Init ... !!!
    [MCU2_0] 5.503959 s: IPC: 4 CPUs participating in IPC !!!
    [MCU2_0] 5.504162 s: IPC: Waiting for HLOS to be ready ... !!!
    [MCU2_0] 17.987635 s: IPC: HLOS is ready !!!
    [MCU2_0] 17.987700 s: IPC: Init ... Done !!!
    [MCU2_0] 17.987719 s: APP: Syncing with 3 CPUs ... !!!
    [MCU2_0] 17.987739 s: APP: Syncing with 3 CPUs ... Done !!!
    [MCU2_0] 17.987753 s: REMOTE_SERVICE: Init ... !!!
    [MCU2_0] 17.988712 s: REMOTE_SERVICE: Init ... Done !!!
    [MCU2_0] 17.988736 s: FVID2: Init ... !!!
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

       The part in picture I cuted out  is from last part of the log from run_app_multi_cam.sh . 

      

    BR

    stream

  • oh, why is then the prints from R5F not coming? Can you please then put this print in the caller of this API tivxCsitxEnqueueFrameToDriver? 

    Regards,

    Brijesh

  • Hi Brijesh :

       Sorry, I got the rough conclusion. The truth is :

      Code runs into the tivxCsitxEnqueueFrameToDriver  ,but the  varible `prms->numOfInstUsed ` is 0 , so loop end directly.

       code : 

        

    log :

    BR

    stream

  • Hi Brijesh :

       I add some log print in func tivxCsitxSetCreateParams like this :

    the result :

    It seems 

        csitx_config_target_ptr = tivxMemShared2TargetPtr(&obj_desc->mem_ptr);
    gets the wrong values  while  the correct value should be like this :

    BR

    stream

  • Hi :

    csitx_config_target_ptr = tivxMemShared2TargetPtr(&obj_desc->mem_ptr);

    I  print the ptr addr of this :

    code refer:

    BR

    stream

  • Hi TI experts :

    Any progress in this issue ? Looking forwards to your reply.  

    BR

    stream

  • Hi stream,

    That's very strange that number of instances is set 0. It should not be if it is set correctly. Let me check the driver code in SDK9.2 and get back to you.

    Regards,

    Brijesh 

  • Hi Brijesh:

    I  print the ptr addr of this :

    Can you help check the result of  `tivxMemShared2TargetPtr` in the log? 

    BR

    stream

  • Hi stream,

    ok, i see below comment in ti-processor-sdk-rtos-j722s-evm-09_02_00_05/vision_apps/platform/j722s/rtos/gen_linker_mem_map.py. Most likely, the buffer space is mapped to 0x900000000 higher memory and it is mapped to 0xC0000000 location in mcu2_0. So when mcu2_0 would like to access it will access using 0xC0000000 location and so in the above print, csitx_config_target_ptr is correct. 

    # Shared memory for DMA Buf FD carveout
    ddr_shared_mem_addr = 0xC0000000; # This will be the virtual address used for R5F's / C7X's
    ddr_shared_mem_size = 512*MB;

    Buffer address conversion also seems to be correct. This API flow convers local address starting from 0xC0000000 to physical address..

    tivxMemShared2PhysPtr -> appMemShared2PhysPtr -> appTarget2SharedConversion

    Can you please somehow print the buffer addresses in the CSITX node to see if this conversion is happening correctly?

    Regards,

    Brijesh

  • Hi Brijesh :

    Thank u for the validation.

    I traced

        csitx_config = vxCreateUserDataObject(obj->context, "tivx_csitx_params_t", sizeof(tivx_csitx_params_t), &local_csitx_config);

     by adding  the print log in func `vxCopyUserDataObject() `   of  `vx_user_data_object.c` 

    and this is the result log:

    Can you please tell me if there is anywhere else I can add the print log to trace the conversion of buffer addresses.

    I notice that : 
     -  start_ptr is from mem_ptr. host_ptr , it write local_csitx_config into the shared mem of host_ptr addr

    and I cannot find the `mem_ptr.shared_ptr`  getting value.  csitx_config_target_ptr is get the value from mem_ptr.shared_ptr directly.

    -  if the conversion is correctly ,  I debug with lauterbach tools ,  the address in  (tivx_csitx_params_t *)0xc0001000 (csitx_config_target_ptr ) is totaly empty.  Seems ptr from shared_ptr  is wrong itself.

    I wish the infomation can help you debug

    Looking forwars to your reply

    BR

    stream

  • Hi stream,

    Can you please tell me if there is anywhere else I can add the print log to trace the conversion of buffer addresses.

    But this copy happens on the A72 core, ie on Linux user space.. isn't it? That's why it needs to use host_ptr, because this buffer needs to be mapped in the Linux memory/process space.. This is different from the address conversion that is happening on the R5F core. 

    and I cannot find the `mem_ptr.shared_ptr`  getting value.  csitx_config_target_ptr is get the value from mem_ptr.shared_ptr directly.

    Shared_ptr is initialized in this API ownAllocReferenceBufferGeneric, when memory for the user data object is allocated.. That's typically set the physical memory location. 

    -  if the conversion is correctly ,  I debug with lauterbach tools ,  the address in  (tivx_csitx_params_t *)0xc0001000 (csitx_config_target_ptr ) is totaly empty.  Seems ptr from shared_ptr  is wrong itself.

    But does laauterback access the memory via RAT? I think it doesnot. Instead of looking at this locaiton, you can check variables at 0x900001000 location, which is the corresponding mapped address. 

    Regards,

    Brijesh

  • Hi Brijesh :

    Thank u , I will check this next day . 

    you can check variables at 0x900001000 location, which is the corresponding mapped address

    BR

    stream

  • Sure, i will move this ticket to "waiting" state. 

  • Hi Brijesh:

       Sorry for the delay.

       1. I checked  the addr of  mem_ptr-> host_ptr where local config just copied into in `vxCopyUserDataObject` at  A53 core side

       I can get the correct value which I set,  you can also see the log which records the host_ptr and shared_ptr and according phy_ptr

    reference code :

    2.  Meanwhile I track the shared_ptr at R5f core side in lauterbach , both 0xc03f6000 and 0x9003f6000 (which is the conversion of 0xc03f6000) is empty 


    Looking forwards to your reply

    BR

    stream

  • Hi stream,

    Can you please check if the cache operation is properly performed on this user data object at the offset 0xc03f6000? I am wondering if this is some cache issue. Is it possible to check the physical location from some other core? Lets say C7x can access 0x9003f6000 location directly? Can we check if it has some valid contents from C7x? 

    Regards,

    Brijesh

  • Hi Brijesh :

    Sorry,  How to check the cache operation is properly performed ?

    Can you please check if the cache operation is properly performed on this user data object at the offset 0xc03f6000?

    BR

    stream

  • Hi Stream,

    I meant, after copying the user data object, is cache written back? or before accessing user data object on R5F side, is cache invalidated? 

    Regards,

    Brijesh 

  • Hi Brijesh :

    I think it's harder for me to look into this issue further now.

    Let's make it simple.  

    - TDA4VEN Demo board
    - Raw version LINUX&RTOS SDK download from here 

    Add csitx code to main.c of app_multi_cam demo and didnot modify any other files in SDK

    5684.main.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    *
    * Copyright (c) 2020 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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Flash SDcard

    compile rtos sdk by 'make sdk '  and the  `make linux_fs_install_sd ` to apply modification

    Error occured.  I mentioned above that  I fixed this issue by removing the addr_translate in example.syscfg which seems not correct way.

    How to fix this ?

    Thank you in advance.

    BR

    stream

  • Hi stream,

    ok, let me check it on the EVM. I will check some later this week. 

    Regards,

    Brijesh

  • Hi Brijesh : 

    Can you reproduce the issue I mentioned?

    BR

    stream

  • Hi Stream,

    I see no reason why the code in SDK9.2 will not work. 

    It essentially calls two APIs

    1, tivxMemShared2PhysPtr: This is used to convert shared address to physical address. It calls tivxMemShared2PhysPtr -> appMemShared2PhysPtr -> target2SharedFxn -> appTarget2SharedConversion, which essentially returns the same physical address as given shared address.

    2, tivxMemShared2TargetPtr: This is used to convert shared address to local mapped address. It calls tivxMemShared2TargetPtr -> appMemShared2TargetPtr -> shared2TargetFxn -> appShared2TargetConversion, which essentially maps physical address to local mapped address.

    So it should work fine. What exactly issue are you facing? Are you seeing incorrect output buffer or are you seeing some incorrect programming in the CSITX? 

    Regards,

    Brijesh

  • Hi Brijesh :

    What exactly issue are you facing?

    Sorry, let  me make it  clear :

     All my confusion is :

     I add my code to enable csitx to  new SDK9.2 , vision_apps/apps/basic_demos/app_multi_cam/main.c   , and copy the compiled app to SDcard.

     using TDA4VEN EVM  , SDcard boot mode,

     After run `vx_app_arm_multi_cam.out`  under /opt/vision_apps/ , log showed that: 

     tivxMemShared2PhysPtr: This is used to convert shared address to physical address

    I also think the function itself should be work fine , temporarily forget the discussion about this function. Let's get the the error above I confronted in the beginning passed . 

    By the way , Have you tested the new SDK9.2 with the code I provided ? All  works fine ? 

    BR

    stream 

  • ok, let me check it out on EVM.

    Rgds,

    Brijesh

  • Hi Brijesh :

    Any result on checking the code on EVM.

    BR

    stream 

  • Hi Stream,

    I still have not got the chance to try it out on EVM.

    Regards,

    Brijesh

  • Hi,

    Sorry for the delay.

    We are able to re-produce the issue.

    Please use below changes in "SDK/video_io/kernels/video_io/host/vx_scitx_host.c" under "tivx_csitx_params_init" API, and build the sdk using sdkbuilder and run CSITx demo.



    Best Regards,
    Sudheer

  • Hi TI experts:

    I add your modification into my code ,and  have validated the video data loop : SoC csitx --> serializer --> deserializer --> device that received csi mipi data

    Finally, we have got the correct ouput from the end , it means that the modification works . 

    Thank you for your efforts!!

    BR

    stream

  • Hi Stream,

    Thanks for the Update.

    Best Regards,
    Sudheer