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.

diags_USER1 is undefined

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 am seeing the following error:

Description    Resource    Path    Location    Type
#20 identifier "diags_USER1" is undefined    main.cpp    /Vibration Monitor    line 826    C/C++ Problem

In my main.cpp, I have the following include files:

#include <xdc/runtime/System.h>
#include <xdc/runtime/Log.h>
#include <xdc/runtime/Diags.h>
#include <ti/sysbios/BIOS.h>
#include <xdc/cfg/global.h>

In my .cfg file I have the following defined:

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Log = xdc.useModule('xdc.runtime.Log');
/* create trace logger */
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var trace = LoggerBuf.create();

/* Set trace to be the default logger for the application. */
var Main = xdc.useModule('xdc.runtime.Main');
Main.common$.logger = trace;
/* Enable diagnostics for USER1 events for our program. Logging in the C
* Code will be done using USER1 events. Disabling this would disable all of
* the logging done in mailbox.c */
Main.common$.diags_USER1 = Diags.RUNTIME_ON;
BIOS.common$.diags_USER1 = Diags.RUNTIME_ON;

(NOTE: Although I posted a problem similar to this (Log_printx() in SYS/BIOS), this is not the same project. This is a brand new project but similar error.) Little help. Thanks.

.cfg file attached (6014.VibrationMonitor.cfg)

  • Mark Skidmore said:
    identifier "diags_USER1" is undefined

    Is this C/C++ code being complained about?

    If so, I believe you need an upper-case 'D', e.g., Diags_USER1.

    .cfg code uses 'diags_USER1' but in C-land it's 'Diags_USER1'.

    Regards,

    - Rob

     

  • Yes, this is C/C++ code. Changed 'diags_USER1' to 'Diags_USER1' and made sure I had both

    • #include <xdc/runtime/Log.h>
    • #include <xdc/runtime/Diags.h>

    in any file that made reference to 'Diags_USER1' and the error went away. SPRAAS7G, Migrating a DSP/BISO 5 Application to SYS/BIOS 6 , (p. 43, Step 2, Step 4) makes reference to the following header files

    • #include <xdc/runtime/System.h>
    • #include <ti/sysbios/BIOS.h>
    • #include <xdc/cfg/global.h>

    My project does not include these files (commented out) and I still don't get my original reported error:

    Description    Resource    Path    Location    Type
    #20 identifier "diags_USER1" is undefined    main.cpp    /Vibration Monitor    line 826    C/C++ Problem

    Thanks!

  • Mark Skidmore said:

    and made sure I had both

    • #include <xdc/runtime/Log.h>
    • #include <xdc/runtime/Diags.h>

    in any file that made reference to 'Diags_USER1'

    Yep, the general rule is that if you use an identifier (API function, data type, macro, etc.) from module "Mod" then you need to #include <modulepathname/Mod.h>

    Mark Skidmore said:
    • #include <xdc/runtime/System.h>
    • #include <ti/sysbios/BIOS.h>
    • #include <xdc/cfg/global.h>

    My project does not include these files (commented out) and I still don't get my original reported error:

    I'm not sure about global.h, but that document section is talking about the mailbox example specifically.  The "general rule" I mentioned above applies here - if you use an identifier starting with "System_" then you should include its header file.

    BIOS.h is probably included by some other header file that you *are* including.  All SYS/BIOS applications need to at some point call BIOS_start(), which  is declared in BIOS.h

    Regards,

    - Rob