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/TMS320C6678: how to enable System analyser (UIA) for a C/C++ project

Part Number: TMS320C6678

Tool/software: Code Composer Studio

In order to reduce compilation time, I have one project (Project A) with .cfg file and it is referenced in another C/C++ project (Project B). My entire code resides in project B and it references the Project A in its properties. This has worked well so far but now I want to enable System analyser to check CPU loading when my code runs in Debug mode.

My .cfg file has LoggingSetup as shown in general guides but when I load my .out file and try to run System analyser, it does not 'detect UIA configuration'.

var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
LoggingSetup.loadLogging = true;
LoggingSetup.loggerType = LoggingSetup.LoggerType_STOPMODE;

var Load = xdc.useModule('ti.sysbios.utils.Load');
 Load.windowInMs = 100; // configure to log every 100ms instead of the default period of 500ms.
var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');

The uia.xml and rta.xml file exist in project_A\Debug\configPkg\package\cfg.

The XDC tool version is 3.50.2.20.

SYS/BIOS 6.46.5.55.

UIA Target 2.0.6.52

CCS version 7.2.0.

Is it possible to have .cfg file in one project and call the system analyser through Debug mode in another project?

  • Hi Sherry,

    I tried this in with CCS 7.3, and it worked ok.  I had a project A with the .cfg file, and another project B without a .cfg file, that was dependent on project A.  RTOS analyzer worked correctly.  I then tried this in CCS 7.2, and encountered the problem that you described.

    Can you try using CCS 7.3 and see if the problem goes away?

    Best regards,

    Janet

  • Hi Sherry,

    Another thing you can try (for CCS 7.2), is to create a custom UIA config and point to the uia.xml, rta.xml files from project A.

    Best regards,

    Janet

  • I tried it with CCS 7.3 and it still says 'Could not detect a UIA configuration'. I cannot go back to CCS 7.2 because I had to uninstall it to have CCS 7.3.

    I can see PorjectA\Debug\configPkg\package\cfg contains a host of files including uta.xml and rta.xml files. projectA is also ticked in project B's References, but project B's Debug mode on Blackhawk USB-Mezzanine emulator is still unable to pick up UIA configuration.

    When I create my own UIA config file of format .usmxml, then it says 'Cannot determine' for CPU load, Task Load etc in Instrumentation status

     

  • This is my .cfg file to run on C6678

    var Edma 		= xdc.loadPackage ("ti.sdo.edma3.drv.sample");
    
    var Task = xdc.useModule ("ti.sysbios.knl.Task");
    var BIOS = xdc.useModule ("ti.sysbios.BIOS");
    BIOS.heapTrackEnabled = true;
    BIOS.libType = BIOS.LibType_Custom;
    var ECM = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");
    var C64_Hwi = xdc.useModule ("ti.sysbios.family.c64p.Hwi");
    var Startup = xdc.useModule ("xdc.runtime.Startup");
    var System = xdc.useModule ("xdc.runtime.System");
    var SysStd = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;
    var Log = xdc.useModule ("xdc.runtime.Log");
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Cache = xdc.useModule('ti.sysbios.hal.Cache');
    var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
    var Timer = xdc.useModule('ti.sysbios.hal.Timer');
    
    var Error = xdc.useModule ("xdc.runtime.Error");
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Memory = xdc.useModule('xdc.runtime.Memory');
    Memory.defaultHeapSize = 65536;
    Program.heap = 0x10000;
    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    
    ECM.eventGroupHwiNum[0] = 7;
    ECM.eventGroupHwiNum[1] = 8;
    ECM.eventGroupHwiNum[2] = 9;
    ECM.eventGroupHwiNum[3] = 10;
    var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
    var Load = xdc.useModule('ti.sysbios.utils.Load');
    Load.windowInMs = 100; // configure to log every 100ms instead of the default period of 500ms.
    
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    LoggingSetup.loadLoggerSize = 1024;
    LoggingSetup.mainLoggerSize = 32768;
    LoggingSetup.sysbiosLoggerSize = 32768;
    
    /* Enable CPU Load logging */
    LoggingSetup.loadLogging = true;
    LoggingSetup.loggerType = LoggingSetup.LoggerType_JTAGRUNMODE;
    LoggingSetup.loadTaskLogging = true;
    LoggingSetup.enableTaskProfiler = true;
    LoggingSetup.benchmarkLogging = true;
    LoggingSetup.sysbiosHwiLogging = true;
    LoggingSetup.sysbiosHwiLoggingRuntimeControl = true;
    

  • By copying the 'configPkg' folder (and all of its content) that is residing in {WORKSPACE}/ProjectA/Debug/ folder and Importing it in {WORKSPACE}/ProjectB/Debug, the Tools -> RTOS analyser -> Execution analysis opens UIA dialog. It successfully detects UIA configuration (yayy) but it does not display anything in 'CPULoad' or 'Live session' windows upon running the code. I do realise it is a cheat and it is still not connected to the .out file of ProjectB.

    Is there any way I can make ProjectB see the UIA in Project A and be linked to it so I can check CPUload?
  • Hi Sherry,

    Can you click on the "Cannot determine" displayed next to CPU load and see what it says?  Also, have you added project A as a dependency in the CCS build of project B?  It should look something like this:

    The .cfg file looks good to me, but there is a known issue in CCS where data doesn't show up when using JTAG RunMode with Log buffers in external memory.  See this post for how to get around it:

    Basically, try JTAG StopMode, or put Log buffers in L2SRAM.

    Best regards,

    Janet

  • Yes in Project B -> (Right click) Properties -> CCS Build -> Dependencies, I can see Project A listed.

    When I expand 'Cannot Determine' in Custom UIA configuration, I get the message as follows

    My UIA is newer than 2.0. It is UIA 2.0.6. So I ignore it and click on 'Run' button to execute my code. I have changed JTAG from RunMode to StopMode and just to be safe I have added the following lines to my PorjectA .cfg as well

    BIOS.logsEnabled = true;
     LoggingSetup.memorySectionName = "L2SRAM";
     LoggingSetup.sysbiosLoggerSize = 1024;
    LoggingSetup.loadLoggerSize = 512;

    There is enough memory in L2RAM for it. Still No success. 

  • Hi Sherry,
    Can you check the products that are going into your project A build? Under project properties, select General -> Products and Repositories. Could you post a screen shot of that?
    Thanks,
    Janet
  • Project A repositories below

    Project B , that depends on Project A for UIA is below

  • Hi Sherry,

    That looks ok to me.  Can you try cleaning project A (also remove the Debug and src directories), and rebuilding?  Then rebuild project B and see if that solves the problem.

    Thanks,

    Janet

  • I did that and also restarted Debug, CCS and my computer. It has not worked. We had a host of projects split like this; Project A/ project B scheme. I suppose I shall have to go back to a basic system where all cfg libraries and code are under one hood.

  • This is so disappointing. Even after merging the cfg files, include paths and C/C++ files into one project, I cannot get CPU load timeline. Once I open RTOS Analyser, I get the following window

    I get a pop up window 'Invalid UIA configuration, Error items: Event transport: Undefined'. Even though I have the following line in my cfg file.

    LoggingSetup.loggerType = LoggingSetup.LoggerType_STOPMODE;

    Please help.

  • 1. The Transport column at top right says 'None' as the screenshot shows in my reply above. It should show JTAG Run mode or Stop mode by automatic detection in my .cfg file within the same project. Could this be the reason why I can start my UIA session but I get nothing in the Live session once the code runs?

    2. When I create a custom UIA config, I select JTAG as my transport Event. Once a custom UIA session is started, it shows 'Run mode JTAG' in Transport column. This is in conflict with my .cfg command of.

    LoggingSetup.loggerType = LoggingSetup.LoggerType_STOPMODE;

    I know no way of changing this when I create a custom UIA configuration. it has been recommended to use Stop mode, not run mode, for UIA session. So what can I do next?

  • Hi Sherry,

    I'm not sure what you meant by 'merging the .cfg files'.  Only one project can have a .cfg file.  If project A has a .cfg file, then project B must not have a .cfg file.   Does your project B have a .cfg file?

    Thank,

    Janet

  • Now I have discarded Project A and project B method in desperation for UIA to work. I copied project B (code only) into project C, and copied the .cfg file from project A into project C. I said Yes to the prompt by CCS where it asked me to enable XDC tools for project C. It compiles fine and System analyser of project C gives the UIA configuration window as shown above (the screenshot where I complained about no 'Transport' setting)
  • I want following commands to show in the Live session window of RTOS analyser. The semaphores are dynamically created in the program after Task is called. Even in the main before BIOS_start(), I want some logs to display

    Log_print0(Diags_ENTRY, "This is print0.");
    Log_info0("This is log_info");

    But 'Live session' shows nothing when the program is paused after running for some time. The code performs normally otherwise, it gives UART output and updates other buffers in L2M as expected.

  • It works now. I had invoked another line in cfg file

    Program.linkTemplate = "<Network drive>/my_memory_section.txt";

    This overwrites the default 'memory' and 'sections' settings of the L2M and DDR3 with my customised memory sections. I found this is the only way from this thread to be able to keep using PDK but have my own memory sections

    After updating the text file with new uia links copied from automatically generated linker.cmd, it works.