3.1.34. waf_tools.ti_arm_cgt

Integration of the TI ARM Code Generation Tools into the Waf build system.

This waf tool configures the TI ARM CGT compiler toolchain (https://www.ti.com/tool/ARM-CGT) for cross-compiling C code targeting ARM Cortex-R microcontrollers. It replaces the standard GCC-based cc tool and provides additional features such as hex/binary generation, preprocessing, symbol listing, and linker-script handling.

3.1.34.1. Usage

  1. Load the tool during options and configure:

    def options(opt):
        opt.load("ti_arm_cgt", tooldir=TOOLDIR)
    
    def configure(ctx):
        ctx.load("ti_arm_cgt", tooldir=TOOLDIR)
    
  2. Build a program target using the TI ARM CGT toolchain:

    def build(bld):
        bld.objects(
            source="abc.c",
            target="abc",
        )
    
  3. Optionally enable preprocessing or listing generation:

    waf build_app_ti_arm_cgt --preprocess-files
    waf build_app_ti_arm_cgt --generate-listings
    

3.1.34.2. Dependencies

  • TI ARM CGT (armcl, armar, armasm, armhex, armofd, tiobj2bin, …)

  • Ruby (for HALCoGen code generation in related tools)

  • waf tools: nm, size, hexgen, bingen (this toolchain)

Functions

add_additional_targets(self)

Register XML link-info and map-file as additional link task outputs.

add_cmd_file_as_deps(self)

Inject command files as --cmd_file= flags and register them as dependencies.

add_hexgen_task_ti(self)

Add a hex-file generation task after linking.

add_lib_markers(self)

Wrap library lists in --start-group / --end-group markers.

add_preinclude_deps(self)

Add preinclude dependencies to C and assembly tasks.

add_preprocess_flags_for_armasm(self)

Adjust assembler flags for .asm compilation tasks.

add_preprocess_flags_for_ti(self)

Adjust task.env.CFLAGS depending on the task output file type.

configure(ctx)

Configure the TI ARM CGT embedded compiler toolchain.

find_arm_tools(ctx)

Locate additional tools distributed with the TI ARM CGT compiler.

find_armar(ctx)

Find the TI ARM CGT archiver and store it in ctx.env.AR.

find_armasm(ctx)

Find the TI ARM CGT assembler and store it in ctx.env.AS.

find_armcl(ctx)

Find the TI ARM CGT compiler and store it in ctx.env.CC.

find_armnm(ctx)

Find the TI ARM CGT symbol listing tool and store it in ctx.env.NM.

find_armsize(ctx)

Find the TI ARM CGT size tool and store it in ctx.env.SIZE.

find_bingen(ctx)

Find the TI ARM CGT binary generation tool and store it in ctx.env.OBJ2BIN.

find_hexgen(ctx)

Find the TI ARM CGT hex generation tool and store it in ctx.env.HEX.

get_cc_version_ti_arm_cgt(ctx)

Detect the TI ARM CGT compiler version.

make_flags(self)

Create preprocessing tasks for each C source file.

options(opt)

Register command-line options for TI ARM CGT builds.

prepend_cflags_to_linkflags(self)

Copy the compiler flags into the link task's flags, stripping --compile_only, so that the linker invocation inherits all relevant compiler settings.

process_linker_script(self)

Add the linker script to the link command and register it as a dependency.

ti_arm_cgt_common_flags(ctx)

Set default compiler, linker, and assembler flags for the TI ARM CGT toolchain on ctx.env.

ti_arm_cgt_common_paths(ctx)

Set default include and library search paths for the TI ARM CGT toolchain on ctx.env.