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/TMS320F28388D: How to compare the existing run-time library for flash_Api ; F2838x_C28x_FlashAPI.lib with the custom made flash_api runtime library

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

Hi Ti,

I have created a custom run time library for flash_api using the flash API functions as listed in the document, spnu632.

I need to compare the library which I have created and what TI has provided(F2838x_C28x_FlashAPI.lib).

How to do that? Is there any procedure?

What are the compiler linker command options you have used?

Please reply asap.

Thanks & Regards,

Gurusha

  • Gurusha,

    What do you mean by custom run time library for flash api?  What does that do exactly?

    As long as you use the functions from Flash API library, you would have the same binary for those functions.  

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

    Custom made runtime library means, I have created the flash_api library through scripting language by using all the APIs listed in the spnu632, with some compiler/linker command options from compiler manual.\

    Regards,

    Gurusha

  • Gurusha,

    As long as you embed the library, there is no need to compare the binary.  Libraries does not get recompiled when you embed them in your application.

    Thanks and regards,
    Vamsi

  • Hi,

    I have created one run time library; rts_TMS320F28388D_FlashApi.lib by using script language which contains all source files compiled by using TI compiler v20.2.01.LTS, and object files are achieved into the run time library for flash API for my current project. I have attached a picture, for the batch file process.

    You can check the post in the below link, to understand the process I have performed to create for runtime library for ram and flash and same used for flash_api:

    https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/916940

    The source files which I have used are listed in the flash API manual Version 1.60.00.00.

    TI has also provided its flash API library which Is F2838x_C28x_FlashAPI.lib.

     


    I wish to compare the libraries, I tried using your  cgxml-2.61.00 tool, is there any other tool to compare?

     

  • Gurusha,

    1) Compiler flags look fine.  We used --gen_func_subsections=on as well.

        Where did you get the compiler options from?  

    2) For comaprison, you can use objdiff from the cg_xml package: http://software-dl.ti.com/ccs/esd/documents/sdto_cgt_cg_xml_overview.html

    If you have further questions on this, I can approach our compiler team to help you further.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    As I am Honeywell employee and you guys have shared the flash API projects (both for ARM and C28x) along with the source for F2838x.

    I have following doubts for you to resolve:

    1.  I want to create the same library,F2838x_C28x_FlashAPI.lib which is given in the following TI path: 

    C:\ti\C2000Ware_3_02_00_00_Software\libraries\flash_api\f2838x\c28x\lib 

    The flash API library which I have created and compared with the cg_xml tool, it actually doesn't match.

    Could you help me to point out the issue?

    I have shared the screenshot below: Please check that it says, files are different:

     

    2. Could you please also tell me which compiler version has been used in the project that you have shared with us?

     

  • Gurusha,

    That is the confusing part.  I did not know that you are from Honeywell.  We always spoke to Nagesh and hence is the confusion.

    I provided the compiler version as well in the project that I provided to Nagesh.  Please refer to it and use that compiler version and see if that helps to fix it.

    I am editing your post to remove the compiler flags that you copied.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Even I didn't know that you are already conversing with my colleague Nagesh.

    I checked the project folder, so where I should check explicitly the compiler version? Because anyway I am able to generate build from any of the compilers.

    Is there somewhere have you mentioned to use which compiler to be used?

    Also could you please answer my first doubt, that is, sh_size is only the difference which differentiating between the two different libraries which I have compared through cg_xml tool?

    Thanks!

  • Gurusha,

    You can right click on the project and look at build settings.  C28x flash API library is compiled using compiler version 18.1.3.LTS.

    On the comparison: I asked our compiler to help you. Please expect a reply in a day or two.

    Thanks and regards,
    Vamsi

  • Vamsi, 

    I checked in the latest code composer studio, V20.2.1.LTS was getting detected in the build settings. So I assumed that V20 might have used.

    So you have configured V18.1.3.LTS for your runtime library, isn't it?

    And about comparison, please take your time.

    Thanks and Regards,

    Gurusha

  • I can shed some light on these differences found by objdiff.

    gurusha nahar said:
    I have shared the screenshot below: Please check that it says, files are different:

    Please focus on the first difference shown in the first screen shot.  It is likely the cause of this one difference explains many of the other differences.

    It says the size of the section .text:Fapi_initializeAPI is 0xe6 words in one library, and 0xcc words in the other library.  A section name like that always means it contains one C function.  The name of the function matches the part of the section name after .text:.  So, explain why this function has a different size.  A difference of 26 words seems like a lot.  Is the compiler version the same?  The source code?  The build options?

    Thanks and regards,

    -George

  • Gurusha,

    Yes, I used V18.1.3.LTS.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    So the output format you are using is ELF?

    If it is eabi based, then the project will not compile because the ELF output-format is not supported by compiler version TI v18.1.3.LTS.

    Thanks & Regards,

    Vamsi

  • Hi George,

    I have changed the compiler version according to the TI based library file, F2838x_C28x_FlashAPI.lib

    I have used the following compiler linker options:

    SET COMPILER_FLAGS= -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0  --include_path="C:\ti\ccs1010\ccs\tools\compiler\ti-cgt-c2000_18.1.3.LTS\include" --include_path="C:/Users/h352524/Desktop/CGCU/C2000_F021_FlashAPI_V1.60_QT/C28x/F021DEV_C2000/API/Include/F021" --include_path="C:/Users/h352524/Desktop/CGCU/C2000_F021_FlashAPI_V1.60_QT/C28x/F021DEV_C2000/API/Include/Fapi" --advice:performance=all --define=_C28X --define=_LITTLE_ENDIAN --define=_F2838x --undefine=_CONCERTO --undefine=_F2838x_QT --undefine=_F28004x_FPGA --undefine=_F2837xD --undefine=_F2837xS --undefine=_BIG_ENDIAN --undefine=_F28004x -k -al -g --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --preproc_with_compile --preproc_dependency -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency


    And when I had compared with the following command, 

    objdiff.exe T:\EPS_CoreAssets\TMS320C28xx\C28xxRuntimeLibrary\SDF\LifeCycleData\Release\rts_TMS320F28388D_FlashApi.lib C:\ti\C2000Ware_3_02_00_00_Software\libraries\flash_api\f2838x\c28x\lib\F2838x_C28x_FlashAPI.lib ofd2000

    Still, the differences are visible, Please refer screenshot below in series: 

    There are two strange things which I have come across:

    1. I am using the same source file to compile the project with the same project settings, but why I am still getting the difference in the C functions(I think the compiler-linker option will help you to resolve this doubt).

    Also, I couldn't understand the current differences, though you have explained to some extent, could you please elaborate more.

    2. Also if according to @, you have used V18.1.3.LTS, so if we use the output format as elf abi as an output format with V18, it is giving an error in CCS properties,  the ELF output-format is not supported by compiler version TI v18.1.3.LTS.

     Please check the compiler-linker options to give me clarity for creating the flash_api library.

    Thanks & Regards

    Gurusha

  • Please understand that, with regard to this thread, the only applicable expertise I have is with objdiff.  I have no expertise with the flash libraries.

    When dealing with a large amount of output from objdiff, it is often best to pick one difference and focus on explaining how it happened.  At the start, ignore all the other differences.  

    In several of the files in each library, the section __TI_build_attributes shows a difference.  This section is not loaded to the target for execution.  It stores extra data that is used during the build.  Even so, there is no reason to expect a difference in the build attributes.  Here is a general form of a command to see the build attributes of a library.

    ofd2000 --obj_display=none,battrs name_of_library.lib

    This command uses the object file display utility ofd2000, which is documented in the C28x assembly tools manual. It dumps the build attributes for every file in the library.  Unless something very unusual happened, the build attributes are the same for every file in the library.  So, capture the build attributes for the first file.  It will appear similar to ...

    OBJECT FILE:  file.obj
    
     Build Attributes in "__TI_build_attributes"
    
        Format Version:  'A'
    
        <0>  Vendor Name:  "TI" (Texas Instruments, Inc.)
    
             Tag_File:
                Attributes:
                 Tag_Producer_Name    Assembler
                 Tag_Producer_VMajor  21         (Producer Major Version + 1)
                 Tag_Producer_VMinor  3          (Producer Minor Version + 1)
                 Tag_Producer_VPatch  2          (Producer Patch Version + 1)
                 Tag_Marked_Pro       1          (Marked as PRO tools)
    
        <1>  Vendor Name:  "c28xabi" (ABI for the Texas Instruments C28x Architecture)
    
             Tag_File:
                Attributes:
                 Tag_C28x         1  (C28x code present)
                 Tag_float_args   1
                 Tag_double_args  1

    Repeat this process for each library.  These build attributes should match, but they don't.  What is the difference you see?

    Thanks and regards,

    -George

  • Gurusha,

    For the V18.1.3.LTS, you can leave the output format as "legacy COFF" instead of changing it to eabi (ELF).  You can simply add the "--abi=eabi" flag in compiler flags.  Please use this compiler version if you want to compare.

    Thanks and regards,
    Vamsi

  • Hi Geroge,

    yes, I can see the difference between the TI_ATTRIBUTES between them.

    mostly these are:

    Tag_Producer_VMinor  13          (Producer Minor Version + 1)

     Tag_TMU   1  (TMU 0)

    differences are visible.

    As you can refer the screenshot below, in most of these object files, the difference are same kind of.

    What it is? Could you please explain this to me.

    And if this won't affect the functionality of my run time library for flash_api, I think I should be able to test it.

    Thanks & Regards

    Gurusha

  • Could you please also tell me the other two differences we can see as per the screenshot!

    1.FlashStateMachine.obj:

    sec-> .text: _Fapi_setupFlashStateMachine

    2.Info.obj:

    sec:-> .text: Fapi_getLibInfo 

    Raw data is different 


    I need to resolve this issue asap so that I could test it further. 

    Thanks

    Gurusha

  • Hi Vamsi,

    It is important for us to use "eabi" as a part of the TMS320F28388D project. So is it fine to just put abi="eabi" in compiler/linker options?

    Also, I need further help here:

    1. We have matched the library F2838x_C28x_FlashAPI.lib, which TI has provided and which what you had provided with the flash_api project to our team, we compared it and got the result as; 

    files are same.  we need the same result with the library which we have created. 

    2. also we wish to generate the library like how you have generated, can you please help me further to remove those differences and get me the correct compiler/linker options asap?

    Thanks in advance

    Regards

    Gurusha

  • The two libraries are built with different versions of the compiler.  One uses version 18.12.3.LTS and the other uses version 18.1.3.LTS.  Furthermore, the library built with version 18.12.3.LTS uses the compiler option --tmu_support=tmu0, while the other library does not use the compiler option --tmu_support.

    Differences like these cause other details in the build to be different.  I recommend you change the build of one library to match the other. Then compare again.

    Thanks and regards,

    -George

  • Gurusha,

    Yes, as I mentioned earlier, you can use that flag "--abi=eabi".  That should give you eabi.

    Thank you for confirming that the lib that we provided in C2000Ware matched with the library that you obtained by compiling the project/source that I provided.

    I already reviewed the compiler settings that you used and everything matched.  But, you need to use the same compiler version and use the eabi flag.  Can you confirm if this is the case?

    Not sure if you changed any code and hence are the differences.

    Thanks and regards,
    Vamsi

  • Thank you for your quick response,

    Actually I took those source files which are provided in the project as-is and then compiled with the compiler flags and the linked together to create the library.

    I am not sure what is the difference between our procedure of creating the library.

    Regards,

    Gurusha

  • Gurusha,

    You did not confirm whether or not you used the same compiler version and eabi flag.

    Thanks and regards,

    Vamsi

  • Hi,

    Yes I have compiled with the same compiler version you have told me.


    SET COMPILER_FLAGS= -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --include_path="C:\ti\ccs1010\ccs\tools\compiler\ti-cgt-c2000_18.1.3.LTS\include" --include_path="C:/Users/h352524/Desktop/CGCU/C2000_F021_FlashAPI_V1.60_QT/C28x/F021DEV_C2000/API/Include/F021" --include_path="C:/Users/h352524/Desktop/CGCU/C2000_F021_FlashAPI_V1.60_QT/C28x/F021DEV_C2000/API/Include/Fapi" --advice:performance=all --define=_C28X --define=_LITTLE_ENDIAN --define=_F2838x --undefine=_CONCERTO --undefine=_F2838x_QT --undefine=_F28004x_FPGA --undefine=_F2837xD --undefine=_F2837xS --undefine=_BIG_ENDIAN --undefine=_F28004x -k -al -g --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency

    But one thing I have noticed here is, 

    while I was compiling with coff abi( now I have changed to eabi) and compared, it says, the compilers are different. This difference should likely now come because you have also used coff abi right?

  • Gurusha,

    Below are the compiler flags I used. 

    Could you confirm the compiler version you used?  

    Thanks and regards,
    Vamsi

    -v28 -ml -mt --float_support=fpu32 --include_path="C:/ti/CCS_preReleases/ccs1000/ccs/tools/compiler/ti-cgt-c2000_18.1.3.LTS/include" --include_path="C:/Users/a0271901/Desktop/C2000_F021_FlashAPI_V1.60_QT/C28x/F021DEV_C2000/API/Include/F021" --include_path="C:/Users/a0271901/Desktop/C2000_F021_FlashAPI_V1.60_QT/C28x/F021DEV_C2000/API/Include/Fapi" --advice:performance=all --define=_C28X --define=_LITTLE_ENDIAN --define=_F2838x --undefine=_CONCERTO --undefine=_F2838x_QT --undefine=_F28004x_FPGA --undefine=_F2837xD --undefine=_F2837xS --undefine=_BIG_ENDIAN --undefine=_F28004x -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi

  • Thanks, Vamsi for sharing the compiler options.

    I have used the same compiler flags, again compiled and compared. The only difference is the compiler path.

    Still getting the following differences.

    Hi Geroge,

    I need to test the library asap and also to meet the deadline but couldn't accomplish it because of the difference as listed below:

    PS: This is the fresh comparison, which I performed using the compiler flags that Vamsi has provided.

    Regards,

    Gurusha

  • You are building the libraries with different versions of the compiler.  The first library uses 18.1.x.LTS and the second one uses 18.12.x.LTS.  I can't tell what the x digit is, though I can tell it is the same. 

    Thanks and regards,

    -George 

  • Hi,

    I am not using a different compiler.

    you can check the above post. I shared the screenshot of the comparison of the compiler linker option.

    I am using the same what  Vamsi has provided, V18.1.3.LTS

  • The only way to see that output from objdiff is to use different versions of the compiler.  Here is a scaled down demonstration ...

    C:\work>type file.c
    int a;
    
    C:\work>\ti\compilers\ti-cgt-c2000_18.1.3.LTS\bin\cl2000 file.c
    
    C:\work>copy file.obj f_18_1_3.obj
            1 file(s) copied.
    
    C:\work>\ti\compilers\ti-cgt-c2000_18.12.3.LTS\bin\cl2000 file.c
    
    C:\work>copy file.obj f_18_12_3.obj
            1 file(s) copied.
    
    C:\work>objdiff f_18_1_3.obj f_18_12_3.obj ofd2000
    Processing f_18_1_3.obj ...
    Processing f_18_12_3.obj ...
    Comparing files ...
    
    ======================================================================
    Comparing Sections : section = $build.attributes
    ======================================================================
            Raw data is different
    ======================================================================
    Comparing Sections : section = $build.attributes : build_attributes : vendor_section : vendor_name = TI : attribute_section : attribute_list : tag = Tag_Producer_VMinor : arguments
    ======================================================================
             Differences:         f_18_1_3.obj              f_18_12_3.obj
                   const:                  0x2                        0xd
    
    Files are different

    gurusha nahar said:
    I shared the screenshot of the comparison of the compiler linker option.

    The build options are the same.  But the compiler shell cl2000 must be coming from different directories.

    Thanks and regards,

    -George

  • Hi Geroge,

    I have tried again, but still, the problem is the same. I am not sure why it is not compiling with the same compiler, though the path and everything required is the same.

    Can we have a quick discussion with your team about this problem?

    One thing I don't understand

    Also, does cg_xml tool has the functionality to check the compiler version of the library.

    Regards,

    Gurusha

  • gurusha nahar said:
    I am not sure why it is not compiling with the same compiler

    I do not know the details of how these libraries are built.  So, I cannot help with this question.  I'll notify the C2000 experts who can help.

    gurusha nahar said:
    does cg_xml tool has the functionality to check the compiler version of the library.

    In this forum post earlier in this thread, I show how to use ofd2000 to see the build attributes of a library.  Among those attributes is the version of the compiler used.

    Thanks and regards,

    -George

  • I have used the same flow to create the library which I mentioned above.

    and used the following compiler include path

    C:\ti\ccs1010\ccs\tools\compiler\ti-cgt-c2000_18.1.3.LTS\include

    Before the same directory consist of v18.12.3.LTS, which I deleted, I thought maybe because it is redirecting to this directory for invoking cl2000.

    Since I have only this compiler option, it should work, but again it's not matching while comparing.

    One other issue I would also like to add is,

    The project we got from TI, it is based on the compiler v18.1.3.LTS and output format is coffabi. But It is using the runtime library F2838x_C28x_FlashAPI.lib

    which is also built on version 18.1.3.LTS, but using eabi as an output format. I couldn't understand here this idiosyncrasy. Is it possible to use the library of different output formats??

    attached is the screenshot of the properties of the project shared by TI.

    Regards

    Gurusha

  • Hi George,

    Also, I have checked the compiler version of the library I have created.

    Only assembler version is displayed for each object file in the following screenshot, this means the same as compiler version right?

    But again, why V18.12.3.LTS? 

  • Gurusha,

    Yes, that assembler version is the compiler version.

    Regarding EABI generation using v18.1.3.LTS:  As I mentioned earlier, CCS is not updated to allow the selection of "EABI" output format for this compiler version.  However, the compiler itself can accept the eabi as an additional option in the compiler flags.  I shared that with you.  Hence, don't worry about it.

    Regarding your project getting compiled with V18.12.3.LTS:  Please right click on your project -> Show Build Settings -> General -> Project tab -> Project type and tool-chain -> Compiler version:  What compiler version do you see here for your project?  Is it TI v18.1.3.LTS or not?  

    Thanks and regards,

    Vamsi

  • FYI for others that may refer to this post:  I am closing this post.  I worked with the customer offline.  Compiler path chosen for the batch file is incorrect and is fixed.

    Thanks and regards,

    Vamsi