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.

Compiler/TDA3MD: How to package the "chain Code" into library files

Part Number: TDA3MD

Tool/software: TI C/C++ Compiler

Hello Experts,

recently,I create a application base on TI PROCESSOR_SDK_VISION3.07(TDA3 HW & TI BIOS), as the TI develop docs and architecture rules that My Application Codes include two parts as below.

  1. Arp32 Code for Algorithm plugins
  2. M4 Code that to make a "chain" to control workflow or dataflow

So, I Can Build a CCS Project to package the Arp32 Code into a Libs, But I Can't understand how to package the "Chain Code" into a static library or dynamic libraries!

If anybody can help? Thanks a lot!

  • I'm not sure what you mean by the term chain code.  But I can tell you how to start a static library project in CCS.   When you start your project, expand the Tool-chain part of the dialog box.  Set the drop-down selection titled Output type to Static Library.  Use the screen shot below as a guide.

    Thanks and regards,

    -George

  • Hi George,

    Yes,I can find this tool chains also,and as your ways to build a library for test.

    So,i Integrated it into the visionSDK(TDA3) , add the libs route at M4 MAKEFILE(~vision_sdk\build\rtos\makerules\rules_m4.mk) ,and rebuild the SDK again.

    But ,the program crashed at the function which package in the library,and the test code as following:

    void UART_DEBUG_KSColdinit(void)
    {
    printf("there is UART_DEBUG_KSColdinit!!!\r\n");
    return;
    }

    And ,I find that if i delete the function calling,the program can running normally.

    So,I have checked the System also, the UART_DEBUG_KSColdinit function is compile and linked to system file,the message as following:

    1. When I open the file(~/vision_sdk/binaries/apps/tda3xx_evm_bios_all/vision_sdk/bin/tda3xx-evm/vision_sdk_ipu1_0_release.xem4) ,I can find the function name;
    2. And i can find the function name also at the library;

    Thanks

    Nick.

  • Hi George,

    Yes,I can fond this tool chains also,and as your ways to build a library for test.

    So,i Integrated it into the visionSDK(TDA3) , add the libs route at M4 MAKEFILE(~vision_sdk\build\rtos\makerules\rules_m4.mk) ,and rebuild the SDK again.

    But ,the program crashed at the function which package in the library,and the test code as following:

    void UART_DEBUG_KSColdinit(void)
    {
    printf("there is UART_DEBUG_KSColdinit!!!\r\n");
    return;
    }

    And ,I find that if i delete the function calling,the program can running normally.

    So,I have checked the System also, the UART_DEBUG_KSColdinit function is compile and linked to system file,the message as following:

      1. When I open the file(~/vision_sdk/binaries/apps/tda3xx_evm_bios_all/vision_sdk/bin/tda3xx-evm/vision_sdk_ipu1_0_release.xem4) ,I can find the function name;
      2. And i can find the function name also at the library;

    Thanks

    Nick.

  • Nick,

    First, the M4 toolchain version we verify in Vision SDK is ti-cgt-arm_16.9.2.LTS. For library build, it should be ok to use different version but it would be good to use the same compiler version as the rest of M4 components in Vision SDK.

    Second, could you comment out "printf" and try again? Maybe it was not linked properly to rts library. We use Vps_printf() for printing trace in Vision SDK.

    Regards,
    Stanley

  • hi Stanley,

    yes,i have a try with comment out "printf",but the issues is still there.

    ///////

    My test libs code as follows:

    void ArcTestinit(void)
    {
    return;
    }
    unsigned char ArcTestinit_output(void)
    {
    unsigned char tmp = 123;
    return tmp;
    }

    and I can find the func in the .map files

    ...

    85be60b8 ArcTestinit_output
    85be60c0 ArcTestinit

    ...

    ///////////////

    My Chains code as follows:

    #if 1
    Vps_printf("\n ArcTestinit addr: %p\n",&ArcTestinit);
    Task_sleep(1000);
    Vps_printf("\n Do ArcTestinit \n");
    Task_sleep(1000);
    ArcTestinit();
    Task_sleep(1000);
    Vps_printf("\n UART_DEBUG_KSColdinit_ts addr: %p\n",&ArcTestinit_output);
    Task_sleep(1000);
    Vps_printf("\n Do ArcTestinit_output\n");
    UINT8 tmv = ArcTestinit_output();
    Task_sleep(1000);
    Vps_printf("\n chains_ArcAlgComm: %s,%s:::%d\n",__DATE__,__TIME__,tmv);
    #endif

    and I get the results as follows:

    [IPU1-0] ArcTestinit addr: 85be60c0
    [IPU1-0] 4.713963 s:
    [IPU1-0] Do ArcTestinit

    //the program crashed here

    So,Should I config the “rts library”? And how?

    thanks

    Nick

  • >> So, I Can Build a CCS Project to package the Arp32 Code into a Libs, But I Can't understand how to package the "Chain Code" into a static library or dynamic libraries!

    Was the test library code built for ARP32 or M4?

  • Hi Stanley,

    Yes,the test library code build for M4 Core(IPU_0) which the chain & link pre-build in vision SDK needed,for example:(~\PROCESSOR_SDK_VISION_03_07_00_00\vision_sdk\apps\src\rtos\usecases\vip_single_cam_subframe_copy\chains_vipSingleCameraSubFrameCopy.c)

    I need package the part of user code into test library.

    anyway, (PROCESSOR_SDK_VISION_03_07_00_00\vision_sdk\build\rtos\makerules\rules_m4.mk)the makerules is too complicated to me.

    And I think that the M4 Core can access functions but can't execute in success based on the UART print logs. I don't know the why Core crash down also.

    thanks

    Nick

  • Nick,

    Instead of building library, could you add your function in AlgorithmLink plugin functions to be built as part of VSDK?

    Let's first make sure the function is working properly before building it as library.

    Regards,
    Stanley

  • Hi Stanley,

    i think my test code is very simple for test, and i think it maybe work fine in my experience. 

    In other words,It is not achievable that  package the "chain Code" into library files, and i did not find any sample code in VSDK or develop guide.

    My test libs code as follows:

    void ArcTestinit(void)
    {
    return;
    }
    unsigned char ArcTestinit_output(void)
    {
    unsigned char tmp = 123;
    return tmp;
    }

  • Thank you for paying attention.

  • You can refer the attached example for building a library in Vision SDK.

    Unzip it to ~/vision_sdk/ folder and you can build it as library with gmake.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/algorithms.7z

  • In addition, this library is getting used by algorithm plugin under ~\vision_sdk\apps\src\rtos\alg_plugins\edgedetection and use case ~\vision_sdk\apps\src\rtos\usecases\vip_single_cam_edge_detection.

    You can follow this example and reuse the makefile and replace the source code with yours.

  • Please let us know if you have any more question. Thanks.

  • Hi Stanley,

    at first,thanks for your help. but the algorithms Demo build failed,when i do gmake that i get nothing as below:

    and i heard that package chain code into library will conflict with vision SDK framework,maybe it's just because the libs include same code module form different customer. So,the method is not recommended.

    and in TDA4 OpenVX framework will don't have that problems.

    thanks

    Nick

  • Hi Nick,

    Please build it with the following steps.

    - Go to ~/vision_sdk/build directory

    - Use "gmake -s -j algorithmslib" to build the algorithm libraries under "algorithms" folder

    - Use "gmake -s -j" to build the rest of the link and application code.

    I am not clear about your statement regarding package chain code into library.

    By chain code, do you mean the use case source code which creates the chain?

    In that case, it is application code and calling only APIs from link framework.

    The link framework and its components/modules are built into a separate library.

    Algorithm and algorithm plug-in code are built in another libraries.

    Regards,
    Stanley

    Regards,
    Stanley

  • Hi Stanley,

    I think I've got the right answer, thanks for your help.