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.

TDA2EG: How to use OpenCV features on TDA2Ex?

Part Number: TDA2EG

Hi 

   I am studying how to use OpenCV features on TDA2Ex board.

   First, i compiled the SDK with the configuration "tda2xx_evm_bios_opencx", and it finished with no errors.

   Then, i want to append OpenCV on configuration  "tda2ex_evm_bios_all", as my board is based on TDA2Ex.

   According to "tda2xx_evm_bios_opencx", i changed the configuration files of "tda2ex_evm_bios_all" as folow:

   \vision_sdk\apps\configs\tda2ex_evm_bios_all\cfg.mk: (append following codes)

   OPENCV_OPENCL=yes

   OPENCL_INCLUDE=yes

   ENABLE_OPENCV=yes
   ENABLE_OPENCV_TESTS=yes
   BUILD_OPENCV_SRC=no
   TREAT_WARNINGS_AS_ERROR = no

   \vision_sdk\apps\configs\tda2ex_evm_bios_all\uc_cfg.mk: (append following codes)

ifeq ($(ENABLE_OPENCV),yes)
UC_vip_single_cam_opencvcanny=yes
UC_vip_single_cam_opencvopencldilation=yes
ifeq ($(ENABLE_OPENCV_TESTS),yes)
UC_vip_single_cam_opencvtests=yes
endif
endif

   But the compiling failed with the following errors:

.......

Starting build of library sources ...

making D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/ipc.ae66 ...
gmake[1]: Entering directory `D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/ipc'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/ipc'
making D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/utils.ae66 ...
gmake[1]: Entering directory `D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/utils'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/utils'
making D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/sysbios/sysbios.ae66 ...
gmake[1]: Entering directory `D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/sysbios'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/c66xdsp_1/release/vision_sdk_configuro/package/cfg/MAIN_APP_c6xdsp1_pe66.src/sysbios'
Build of libraries done.
# Configuro done!
# Making tda2ex-evm:c66xdsp_1:release:vision_sdk_lib...
# Compiling tda2ex-evm:c66xdsp_1:release:vision_sdk: D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/apps/src/common/app_init/app_init_dsp.c
# Compiling generated MAIN_APP_c6xdsp1_pe66.oe66
# Linking into D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/vision_sdk/bin/tda2ex-evm/vision_sdk_c66xdsp_1_release.xe66...

undefined first referenced
symbol in file
--------- ----------------
rtos_init_ocl_dsp_monitor D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/lib/tda2ex-evm/c66xdsp_1/release/links_common_system.ae66<system_common.oe66>

error: unresolved symbols remain
error: errors encountered during linking;
"D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bio
s_all/vision_sdk/bin/tda2ex-evm/vision_sdk_c66xdsp_1_release.xe66" not
built
gmake[7]: *** [D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/vision_sdk/bin/tda2ex-evm/vision_sdk_c66xdsp_1_release.xe66] Error 1
gmake[6]: *** [c66xdsp_1] Error 2
gmake[5]: *** [apps_dsp1] Error 2
gmake[4]: *** [apps] Error 2
gmake[3]: *** [apps] Error 2
gmake[2]: *** [apps_exe] Error 2
gmake[1]: *** [apps] Error 2
gmake: *** [vision_sdk] Error 2

    Please help me find where the problem is, thank you~

Thanks

xuanbo

 

  • when i comment the rtos_init_ocl_dsp_monitor call at vision_sdk\links_fw\src\rtos\links_common\system\system_common.c, the undefined symbol error above is not exist.

    But other link errors happen when creating the image of A15:

    D:\PROCESSOR_SDK_VISION_03_01_00_00\vision_sdk\links_fw\src\rtos\bios_app_common\tda2ex\a15_0>D:/PROCESSOR_SDK_VISION_03_01_00_00/ti_components/os_tools/windows/xdctools_3_32_01_22_core/xs xdc.tools.configuro --generationOnly -o D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/obj/vision_sdk/tda2ex-evm/a15_0/release/vision_sdk_configuro -t gnu.targets.arm.A15F -p ti.platforms.evmDRA7XX:Cortex_A15 -r release -b D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/build/rtos/tda2ex/config_a15.bld --cfgArgs "{mode: \"\", coreName:\"A15-0\", platformMem: \"DDR_MEM_512M\"}" MAIN_APP_a15_0.cfg
    # Configuro done! xuanbo
    # Making tda2ex-evm:a15_0:release:vision_sdk_lib...
    # Linking into D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/vision_sdk/bin/tda2ex-evm/vision_sdk_a15_0_release.xa15fg...
    #
    D:/PROCESSOR_SDK_VISION_03_01_00_00/ti_components/cg_tools/windows/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-ld: D:/PROCESSOR_SDK_VISION_03_01_00_00/vision_sdk/binaries/apps/tda2ex_evm_bios_all/vision_sdk/bin/tda2ex-evm/vision_sdk_a15_0_release.xa15fg section `.bss' will not fit in region `A15_0_DATA_MEM'
    D:/PROCESSOR_SDK_VISION_03_01_00_00/ti_components/cg_tools/windows/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-ld: region `A15_0_DATA_MEM' overflowed by 208008 bytes
    D:/PROCESSOR_SDK_VISION_03_01_00_00/ti_components/open_compute/opencv/opencv-3.1.0/libs_bios/libopencv_core.a(system.cpp.obj): In function `cv::Mutex::~Mutex()':
    system.cpp:(.text._ZN2cv5MutexD2Ev+0x60): undefined reference to `pthread_mutex_destroy'
    D:/PROCESSOR_SDK_VISION_03_01_00_00/ti_components/open_compute/opencv/opencv-3.1.0/libs_bios/libopencv_core.a(system.cpp.obj): In function `cv::Mutex::lock()':
    system.cpp:(.text._ZN2cv5Mutex4lockEv+0x24): undefined reference to `pthread_mutexattr_init'
    system.cpp:(.text._ZN2cv5Mutex4lockEv+0x30): undefined reference to `pthread_mutexattr_settype'
    system.cpp:(.text._ZN2cv5Mutex4lockEv+0x3c): undefined reference to `pthread_mutex_init'
    system.cpp:(.text._ZN2cv5Mutex4lockEv+0x44): undefined reference to `pthread_mutexattr_destroy'
    system.cpp:(.text._ZN2cv5Mutex4lockEv+0x58): undefined reference to `pthread_mutex_lock'

    ...........

    D:/PROCESSOR_SDK_VISION_03_01_00_00/ti_components/open_compute/opencv/opencv-3.1.0/libs_bios/libopencv_core.a(ocl.cpp.obj): In function `cv::ocl::selectOpenCLDevice()':
    ocl.cpp:(.text._ZN2cv3oclL18selectOpenCLDeviceEv+0x36c): undefined reference to `clGetPlatformIDs'
    ocl.cpp:(.text._ZN2cv3oclL18selectOpenCLDeviceEv+0x3a8): undefined reference to `clGetPlatformIDs'
    ocl.cpp:(.text._ZN2cv3oclL18selectOpenCLDeviceEv+0x3f8): undefined reference to `clGetPlatformIDs'
    ocl.cpp:(.text._ZN2cv3oclL18selectOpenCLDeviceEv+0x9b8): undefined reference to `clGetDeviceIDs'
    ocl.cpp:(.text._ZN2cv3oclL18selectOpenCLDeviceEv+0xaf8): undefined reference to `clGetDeviceIDs'
    ocl.cpp:(.text._ZN2cv3oclL18selectOpenCLDeviceEv+0xba8): undefined reference to `clGetDeviceInfo'
    ocl.cpp:(.text._ZN2cv3oclL18selectOpenCLDeviceEv+0xc2c): undefined reference to `clGetDeviceInfo'

    It seems that BIOS/Pthread and OpenCL related libraries are not linked into the final A15 image, so above errors were happen.

    So please tell me how to solve above problems, thank you~

    Thanks

    xuanbo

     

  • Hello
    Are you trying to build and run the excising VSDK OpenCL UC or planing to add your-own OpenCL functions/features?

    regards, Shiju
  • Hi

       yes, i want to add my own opencv features on rtos 2D SRV usecase.

    Thanks

    xuanbo

  • Hi Xuanbo,
    Apart from changes made to enable openCV on tda2ex-evm, few more changes required
    grep for "OPENCL_INCLUDE" & "ENABLE_OPENCV" flag in vision_sdk folder
    You need to port changes in cfg files & memsegment.xs file changes of tda2xx to tda2ex

    Regards
    Suryamani Jena
  • Hi Suryamani

    Ok, i got it, thank you~

    Rgds
    xuanbo