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.

RTOS/TDA2: opencv cross compile , missing bios cmake.

Part Number: TDA2

Tool/software: TI-RTOS

I would like to cross-compile opencv for TDA2x.

I follow TI cross compile document.

1) git clone git://git.ti.com/opencv/tiopencv.git

2) git checkout -b opencv_3.1 remotes/origin/tiopencvrelease_3.1

I cannot get cmake file -  arm-gnueabi_bios.toolchain.cmake

Can you upload the file to here?

Thank you

  • Hi Chee Peng,

    PFA cmake file

    Please remember to modify components paths to point before build

    arm-gnueabi_bios.toolchain.zip

    Regards

    Surya

  • Hi Surya,

    Thanks for the file.
    I edited the path.
    But when run, it stuck at endiness test.

    Detected version of GNU GCC: 72 (702)
    Check if the system is big endian
    Searching 16 bit integer
    CMake Error at /usr/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (message):
    no suitable type found
    Call Stack (most recent call first):
    CMakeLists.txt:527 (test_big_endian)



    I read the cross compile document.
    It seems TI have some patch.

    7. Edit the cmakelists.txt if necessary (optional, not required, taken care in the patch)
    a. Opencv performs tests to identify if the endianness is big endian. However, this test doesn’t run
    b. So, similar to setting endianness to IOS and not performing test add the following line (search for BIGENDIAN)
    i. If (IOS)…. Elseif(GENERIC) set(WORDS_BIGENDIAN 0)  (this is because A15 view memory in little endian fashion in TDA2xx)


    Could you upload the patch?
  • Hi Chee Peng,
    Any progress on this
    Are you able to run ?

    Regards
    Surya
  • Hi Surya,

    The patch is working!
    I can configure and generate cmake now!

    However, when i try to crosscompile opencv i stuck at

    In file included from /home/cheepeng/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/dirent.h:7:0,
    from /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:134:
    /home/cheepeng/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported"
    #error "<dirent.h> not supported"
    ^~~~~
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:140:43: error: 'DIR' has not been declared
    static bool isDir(const cv::String& path, DIR* dir)


    What do you think?

    regards
    Chee Peng
  • Hi Chee Peng,
    Could you please try with tool chain "gcc-arm-none-eabi-4_9-2015q3" ?

    Regards
    Surya
  • Hi Chee Peng,
    Are you able to compile with "gcc-arm-none-eabi-4_9-2015q3" ?

    Regards
    Surya
  • Hi Surya,

    Thank you for suggestion
    I using gcc-arm-none-eabi-4_9-2015q3, but still stuck at dirent,h

    What do you think?

    Best regards
    CHee Peng


    [ 16%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/split.cpp.obj
    [ 16%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/downhill_simplex.cpp.obj
    [ 16%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/tables.cpp.obj
    [ 16%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/glob.cpp.obj
    In file included from /home/cheepeng/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/dirent.h:6:0,
    from /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:134:
    /home/cheepeng/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported"
    #error "<dirent.h> not supported"
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:140:43: error: 'DIR' has not been declared
    static bool isDir(const cv::String& path, DIR* dir)
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp: In function 'void glob_rec(const cv::String&, const cv::String&, std::vector<cv::String>&, bool)':
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:222:5: error: 'DIR' was not declared in this scope
    DIR *dir;
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:222:10: error: 'dir' was not declared in this scope
    DIR *dir;
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:225:42: error: 'opendir' was not declared in this scope
    if ((dir = opendir (directory.c_str())) != 0)
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:230:39: error: 'readdir' was not declared in this scope
    while ((ent = readdir (dir)) != 0)
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:232:39: error: invalid use of incomplete type 'struct glob_rec(const cv::String&, const cv::String&, std::vector<cv::String>&, bool)::dirent'
    const char* name = ent->d_name;
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:223:12: error: forward declaration of 'struct glob_rec(const cv::String&, const cv::String&, std::vector<cv::String>&, bool)::dirent'
    struct dirent *ent;
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:252:25: error: 'closedir' was not declared in this scope
    closedir(dir);
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:255:21: error: 'closedir' was not declared in this scope
    closedir(dir);
    ^
    make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/glob.cpp.obj] Error 1
    make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
  • Hi Surya,

    In my opinion gcc-arm-none-eabi-4_9-2015q3 is bare-metal without os.
    Dirent,h operation is based on OS which is TI-RTOS.

    I review document and found need Bios 6.45.01.29 (fail with 6.46.000.23)

    May I know where can i find Bios 6.45.01.29?
  • Hi Chee Peng,
    You can download Bios 6.45.01.29 from below TI link
    software-dl.ti.com/.../index_FDS.html

    Regards
    Surya
  • Hi Surya,

    Tried Bios 6.45.01.29.
    Same error

    [ 16%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/glob.cpp.obj
    In file included from /home/cheepeng/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/dirent.h:6:0,
    from /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:134:
    /home/cheepeng/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported"
    #error "<dirent.h> not supported"
    ^
    /home/cheepeng/ti/opencv/tiopencv/modules/core/src/glob.cpp:140:43: error: 'DIR' has not been declared
    static bool isDir(const cv::String& path, DIR* dir)


    The file at
    /home/cheepeng/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/sys/dirent.h
    have some comment

    /* <dirent.h> includes <sys/dirent.h>, which is this file. On a
    system which supports <dirent.h>, this file is overridden by
    dirent.h in the libc/sys/.../sys directory. On a system which does
    not support <dirent.h>, we will get this file which uses #error to force
    an error. */


    Gcc-arm-none-eabi-4_9-2015q3 is bare-metal.
    Dirent.h operation should be supplied by bios.....
    What do you think?

    regards
    cheepeng
  • Hi
    Sorry for late reply
    Yes you are right "gcc-arm-none-eabi-4_9-2015q3 is bare-metal"
    You should use linaro tool chain instead
    Please refer the Linux User guide to install linaro tool chain (the supported one) & then try building

    Regards
    Surya