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.

Build multiple targets at once

Assume a TI-RTOS project with multiple build targets (binaries), but a similar kernel configuration and hw platform. Which cases are achievable with the current build tools?

  1. Build all targets at once with the exact same .cfg file
  2. Build all targets at once with code generation for tasks, events, etc.

By building at once I mean, that the TI-RTOS kernel is only built once for all targets. I guess that only the first one is possible, since the second requires multiple slightly different .cfg files which again require multiple invocations of xs/configuro.

  • Hi Rick,

    Rick W. said:
    1. Build all targets at once with the exact same .cfg file

    It is possible to share the same *.cfg file between different targets as long as the script is pulling in modules and configuring them in a way that is supported on all targets. If you need to use the same *.cfg file for all targets, it is also possible to distinguish between targets based on the target name and do different things for different targets. Here's some example *.cfg code showing the same:

    if (Program.build.target.name == "C66") {
        // Do something
    }
    else if (Program.build.target.name == "M4") {
        // Do something else
    }
    

    Rick W. said:

    2. Build all targets at once with code generation for tasks, events, etc.

    By building at once I mean, that the TI-RTOS kernel is only built once for all targets. I guess that only the first one is possible, since the second requires multiple slightly different .cfg files which again require multiple invocations of xs/configuro.

    I am not sure I understand your question. Since the compiler generates different assembly for different targets, it is not possible to share the same compiled kernel library between different targets.

    Best,

    Ashish

  • By "targets" I meant just different applications for the same controller. E.g. one app implements a transmitter while the other one is a receiver. These applications might share some source code which needs to be build only once in that case. Only the cfg file might differ in case 2.

  • Hi Rick,

    If you plan on using the same *.cfg file for different projects targeted to the same board, it is possible to build the kernel only once. You would basically need to run the configuro tool once and then repeat the link stage for each application.

    Here's an example Makefile for building a TI-RTOS kernel project from command line (see comments):
    
    CGTOOLS = C:/CCStudio_v3.3/C6000/cgtools
    CC = $(CGTOOLS)/bin/cl6x
    LNK = $(CGTOOLS)/bin/lnk6x
    RTS = $(CGTOOLS)/lib/rts6400.lib
    CONFIG = hello
    XDCTARGET = ti.targets.C64
    XDCPLATFORM = ti.platforms.sim6xxx:TMS320C6416
     
    .PRECIOUS: %/compiler.opt %/linker.cmd
     
    %/compiler.opt: %/linker.cmd ;
    %/linker.cmd : %.cfg              <-------- This rule needs to be run once for a given *.cfg file and will build the kernel library
            xs xdc.tools.configuro -c $(CGTOOLS) -t $(XDCTARGET) -p $(XDCPLATFORM) $<
     
    %.obj : %.c $(CONFIG)/compiler.opt
            $(CC) -@$(CONFIG)/compiler.opt -c $<
     
    hello.out : hello.obj $(CONFIG)/linker.cmd        <------------ This step is repeated for each application. The app source changes but linker script remains the same.
            $(LNK) -o hello.out -c hello.obj $(CONFIG)/linker.cmd $(RTS)
     
    test: hello.out
            @$(CGTOOLS)/bin/load6x $<

    Best,

    Ashish

  • Thank you for taking the time to provide a detailed answer. So it looks like use case 1 is supported out of the box, but use case 2 is not. That is, because xs configuro does not separate kernel build and generating sources for the application (static creation of tasks, events, semaphores...).