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.

Log_printx() in SYS/BIOS

Other Parts Discussed in Thread: SYSBIOS

I'm migrating from DSP/BIOS to SYS/BIOS (CCSv5.2.2, BIOS 6.33.05.46, XDC Tools  3.23.03.53) and can't get the Log_printx(...) function to work. I am following the example in SPRAAS7G Migrating a DSPBIOS 5 Application to SYSBIOS 6.pdf. At the top of page 38, I have applied the example to my *.cfg file but I get the following error (11) in the Problems window wherever I have a Log_printx(...) function:

#20 identifier "diags_USER2" is undefined    ContinuousSpi.cpp    /VibrationMonitorSYSBIOS/Common/Drivers/Module    line 47    C/C++ Problem

What am I doing wrong?

  • Mark,

    If I can take you literally here, it appears that you should change 'diags_USER2' to 'Diags_USER2' (capital 'D').

    Alan

  • Thanks, Alan.

    I've tried that - both upper and lower case (diags_USER2 and Diags_USER2) but still get the same error. I've also tried using "mask" but get the same results.

    Not sure if this is related but I've noticed this: these are the first 13 lines of my *.cfg file (attached)

    1 /* Load platform file for evm6748 */
    2 //bios.enableMemoryHeaps(prog);
    3 xdc.loadPackage('ti.bios.tconf');
    4
    5 /* Enable Time Stamp Logging */
    6 bios.LOG.TS = true;
    7
    8 /* Enable common BIOS features used by all examples */
    9 bios.enableRealTimeAnalysis(prog);
    10 bios.enableMemoryHeaps(prog);
    11 bios.enableRtdx(prog);
    12 bios.enableTskManager(prog);
    13 bios.setMemCodeSections(prog, prog.get("DDR"));

    With the first 13 lines as noted above, I'm seeing this error:

    Description    Resource    Path    Location    Type
    "LoggerBuf" is not defined.    VibrationMonitor.cfg    /VibrationMonitorSYSBIOS    Configuration Validation    XDCTools Configuration Marker

    If I uncomment line 2 but comment line 10 then save the file, I see this error:

    Description    Resource    Path    Location    Type
    "bios" is not defined.    VibrationMonitor.cfg    /VibrationMonitorSYSBIOS    Configuration Validation    XDCTools Configuration Marker

    Simply commenting/uncommenting (or vice versa) lines 2 and 10 and saving the file will cause either error to alternately occur.

    Does the "LoggerBuf" error have anything to do with the problem I'm seeing?

  • 1) Are you #including xdc/runtime/Diags.h?

        #include <xdc/runtime/Diags.h>

    2) Line 2 can not be placed before line 3 because line 3 is where 'bios' gets defined.

    3) Are there other references to LoggerBuf in your config file? If so, there has to be a corresponding var assignment prior to the reference:

        var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

    I am not seeing this problem when I build using the .cfg file I sent you yesterday. Minus your new line 2, my .cfg file seems identical to yours for the first 13 lines.

    Alan

  • 1) adding #include <xdc/runtime/Diags.h> in my files where Log_printx(...) is being called, worked.

    2) With line 2 uncommented (bios.enableMemoryHeaps(prog);) and line 10 commented (//bios.enableMemoryHeaps(prog);) the HeapMem tree is visible but I get the following error (very first error):

    Description    Resource    Path    Location    Type
    "bios" is not defined.    VibrationMonitor.cfg    /VibrationMonitorSYSBIOS    Configuration Validation    XDCTools Configuration Marker

    With line 2 commented and line 10 uncommented, the HeapMem tree is not visible in the Outline window. There is a LoggerBuf tree (blue bullet) with one child labeled "trace" and two red  bullets labeled "Program", each has no children. I also get the following error (very first error):

    Description    Resource    Path    Location    Type
    "Main" is not defined.    VibrationMonitor.cfg    /VibrationMonitorSYSBIOS    Configuration Validation    XDCTools Configuration Marker

    3) There is a reference to LoggerBuf in the config file so I added your var statement above and am not seeing the LoggerBuf error any more.

    Any ideas on #2?

  • Make sure that ALL xdc.useModule() invocations occur AFTER all the bios.xx settings in your config file.

    The xdc.useModule() lines are being generated by the GUI which appears to not know that for converted tcf files it must place them after all the bios.xxx assignments.

    Again, I'm not having this issue with the .cfg file I sent yesterday. Perhaps you can post your latest version?

    Alan

  • I moved all xdc.useModule() invocations to the bottom of the file and am seeing no related errors (LoggerBuf and bios not defined). However, my HeapMem tree is no longer visible (line 2 commented, line 10 uncommented).

    1 /* Load platform file for evm6748 */
    2 //bios.enableMemoryHeaps(prog);
    3 xdc.loadPackage('ti.bios.tconf');
    4
    5 /* Enable Time Stamp Logging */
    6 bios.LOG.TS = true;
    7
    8 /* Enable common BIOS features used by all examples */
    9 bios.enableRealTimeAnalysis(prog);
    10 bios.enableMemoryHeaps(prog);
    11 bios.enableRtdx(prog);
    12 bios.enableTskManager(prog);
    13 bios.setMemCodeSections(prog, prog.get("DDR"));

    Config file attached (5078.VibrationMonitor.cfg).

  • I found a number of problems with the config file:

    1) 'bios' had been redefined here:

         var bios = xdc.useModule('ti.sysbios.BIOS');

     I renamed it to 'BIOS' to avoid conflicting with 'bios'.

    2) The 'Main' module had not been defined so I added:

        var Main = xdc.useModule('xdc.runtime.Main');

    3) The Main module's common$ config parameter is called 'diags_USER2', not 'Diags_USER2';

    4) The value 'Diags.RUNTIME' assigned to Main.common$.diags_USER2 can not be referenced until 'Diags' has been defined with:

        var Diags = xdc.useModule('xdc.runtime.Diags');

    5) You have FAST_HEAP and DDR_HEAP defined twice for some reason.

    They are defined at the top of the cfg file using the legacy bios syntax:

        bios.MEM.instance("DDR").heapLabel = "DDR_HEAP";

        bios.MEM.instance("IRAM").heapLabel = "FAST_HEAP";

    And then again here:

        Program.global.DDR_HEAP = HeapMem.create(heapMem0Params);
        Program.global.FAST_HEAP = HeapMem.create(heapMem1Params);

    The heaps seem to have identical definitions so I commented out the above two lines.

    I've attached the modified version of the .cfg file.

    Alan

    0714.VibrationMonitor.cfg