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.

CCS/AM3359: Read Project Options From Code

Part Number: AM3359

Tool/software: Code Composer Studio

How can my code get the actual CCS Optimize options that were used to build it? This way, my code can report this to other processes. I don't want to hard code this as part of the build configuration or #define but get it from the actual tool settings that built that code.

This link is similar to what I want to do but I have no idea how to do this with CCS so I need step-by-step instructions. The idea is the compiler settings get bundled into an object file which can then be accessed from code.

stackoverflow.com/.../get-the-compiler-options-from-a-compiled-executable

  • CCS ships with a GCC ARM compiler.  If you use that compiler, then you can use the same solution you show at that stackoverflow link.

    The TI ARM compiler has no solution that works in a similar manner.  You can see some, but not all, of the build options in the build attributes.  For example ...

    C:\work\dir>armofd --obj_display=none,battrs file.out
    
    OBJECT FILE:  file.out
    
     Build Attributes in ".ARM.attributes"
    
        Format Version:  'A'
    
        <0>  Vendor Name:  "TI" (Texas Instruments, Inc.)
    
             Tag_File:
                Attributes:
                 Tag_Producer_Name     Linker
                 Tag_Producer_VMajor   6       (Producer Major Version + 1)
                 Tag_Producer_VMinor   3       (Producer Minor Version + 1)
                 Tag_Producer_VPatch   10      (Producer Patch Version + 1)
                 Tag_ABI               3       (ARM EABI)
                 Tag_ISA               10      (ARM v7)
                 Tag_CPU_arch_profile  65      (Application profile)
                 Tag_BE_enc            1       (BE-8 encoding)
                 Tag_Bitfield_layout   2       (Compatible with any Bitfield Layout)
                 Tag_ARM_Mode          34      (# input files built in this mode)
                 Tag_DATA_syms_exist   1       (Data mapping symbols are present)
    
        <1>  Vendor Name:  "aeabi" (ABI for the ARM Architecture)
    
             Tag_File:
                Attributes:
                 Tag_CPU_arch                10  (ARM v7)
                 Tag_CPU_arch_profile        65  (Application profile)
                 Tag_ARM_ISA_use             1   (Some ARM instructions used)
                 Tag_PCS_config              1   (Bare platform config)
                 Tag_ABI_PCS_wchar_t         2   (Size of wchar_t is 2)
                 Tag_ABI_FP_number_model     1   (Only IEEE 754 format FP numbers used)
                 Tag_ABI_align_needed        1   (8-byte alignment of 8-byte data required)
                 Tag_ABI_align_preserved     1   (All required 8-byte alignments are preserved, except for SP in leaf function)
                 Tag_ABI_optimization_goals  4   (Optimized aggressively for small size, speed and debug illusion sacrificed)
                 Tag_CPU_unaligned_access    1   (Unaligned data accesses were permitted)
                 Tag_DIV_use                 1   (SDIV and UDIV instructions were not permitted)

    The command armofd is the object file display utility.  It can only be run from the command line.  It is one of the executables in the compiler package.  It is documented in the ARM assembly language tools manual.

    Thanks and regards,

    -George