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.

Recomended way to do a release [sysbios] build.

Other Parts Discussed in Thread: SYSBIOS

I have a project that includes sysbios, there is a config file which pulls in lots of debug stuff (logs, CPU load etc) and the debug library, for release I could go and change all this but I would prefer for it to build differently for release.

I can see I could have 2 cfg files and use build exclusions but that seems messy.

For the library there is a custom option which says it is based on your config but I cannot see how it works, it offers a cmd line but that hardcodes debug or release options, are there macros here?

Chris

  • I posted this over in the ccs forum but it got moved here - sorry - it looked like the tools doing the driving to me...

  • Hi Chris,

    Which version of SYS/BIOS and XDC are you using?

    Are you adding in much debug items in your code (e.g. Log_print in your main() function). If you are just worried about turning on and off the SYS/BIOS logging and Load module, you can switch between the instrumented and non-instrumented SYS/BIOS libraries.

    The custom LibType, basically recompiles the SYS/BIOS source code based on the two checkboxes (enable asserts and logs) and the custom compiler options fields. The compiler options are defaulted with the ones that are used to build the SYS/BIOS libs. You can change these if you want.

    Your question was what is the easiest way to move between the two setups. In the Project Properties->Build->XDCTools->Advanced Options you can add a Java "-D". Then in the .cfg flle, you can check that environment variable and make decisions based on that variable.

    Then in the .cfg, I put the following line

    print("chris = " + environment["chris"]);

    During the build, the following printed out.

    C:\ti\ccsv5\utils\bin\gmake -k all
    'Building file: ../hello.cfg'
    ...
    chris = 4
    ...

    So in your .cfg, you do something like the following:

    if (environment["BIOSLIBTYPE"] == "release") {
        BIOS.libType = BIOS.LibType_NonInstrumented;
    }
    else {
        BIOS.libType = BIOS.LibType_Instrumented;
    }

    Then in release project setting, set BIOSLIBTYPE to "release" and in your debug one, set it to "debug".

    Todd

  • Thanks, that does what I want, mosty, it would be nice if the UI knew what was happening..

    I have lots of stuff on for debugging, asserts and the RTA agent (UIA would be nice too but....). Previous people working on this code have run the app logs thru the logger so that needs to stay on.

     

    So I have

    if (environment["BIOSLIBTYPE"] == "DEBUG")
    {
     var Load = xdc.useModule('ti.sysbios.utils.Load');
     var Agent = xdc.useModule('ti.sysbios.rta.Agent');

     Defaults.common$.diags_ASSERT = Diags.ALWAYS_ON;
     Defaults.common$.diags_INTERNAL = Diags.ALWAYS_ON;
     
     Main.common$.diags_INFO = Diags.ALWAYS_ON; 
    }
    else
    {
     Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
     Defaults.common$.diags_INTERNAL = Diags.ALWAYS_OFF;
     
     /* .. and an old-style LOG_Printf() is at level INFO */
     Main.common$.diags_INFO = Diags.RUNTIME_ON; 
    }

    if (environment["BIOSLIBTYPE"] == "DEBUG")
    {
     BIOS.assertsEnabled = true;
     BIOS.libType = BIOS.LibType_Debug;

     Program.gen.debuggerFiles = true;

     Agent.sysbiosSwiLogging = true;
     Agent.sysbiosSwiLoggingRuntimeControl = true;

     Agent.sysbiosHwiLogging = true;
     Agent.sysbiosHwiLoggingRuntimeControl = true;

     Agent.sysbiosLoggerBufferSection = "offchip_text";
     Agent.sysbiosLoggerSize = 16384;

     Agent.loadLoggerBufferSection = "offchip_text";
     Agent.loadLoggerSize = 2048;
     Load.hwiEnabled = true;
     Load.swiEnabled = true;

     Agent.mainLoggerBufferSection = "offchip_text";
     Agent.mainLoggerSize = 4096;
     Agent.mainLogging = true;
    }
    else
    {
     BIOS.assertsEnabled = false;
     BIOS.libType = BIOS.LibType_NonInstrumented;
    }

    I wonder if there is any milage in switching the release to sysmin, I am pressed for performance on this one.

    Chris

  • We generally recommend SysMin over SysStd for performance reasons. Also you can call System_printf from a Hwi or Swi.

    At a point you might want to consider removing the System calls or changing them to Log_print calls. Log calls are much faster than System_printf. You can look at the Log calls in ROV. The Log calls also show up in RTA or System Analyzer (depending on which version of CCS and your configuration for your application).

    Todd