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.

SYSBIOS - UIA linker error

Other Parts Discussed in Thread: SYSBIOS

I want to use use the debugging functions of SYSBIOS, especially the execution graph but it did not work until now

Under Available Products I configured:

ti.uia.services.Rta

SYS/BIOS-Realtime Analysis-Load

tool versions see pic:

the linker errors are the same with UIA version 1.4.0.06

  • Hi Andreas,
    Could you please post your configuration file (.cfg)?
    Thanks,
    Janet
  • var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Error = xdc.useModule('xdc.runtime.Error');
    var Log = xdc.useModule('xdc.runtime.Log');
    var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
    var Main = xdc.useModule('xdc.runtime.Main');
    var Memory = xdc.useModule('xdc.runtime.Memory')
    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');
     
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Swi = xdc.useModule('ti.sysbios.knl.Swi');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    //var Agent = xdc.useModule('ti.sysbios.rta.Agent');
    var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    //var Timestamp = xdc.useModule('xdc.runtime.Timestamp');  //Enable if Timestamp_get32 is used in application
    var GateAll = xdc.useModule('ti.sysbios.gates.GateAll');
    var Load = xdc.useModule('ti.sysbios.utils.Load');
    var Hwi = xdc.useModule('ti.sysbios.family.arm.a8.intcps.Hwi');
    var TimestampProvider = xdc.useModule('ti.sysbios.family.arm.a8.TimestampProvider');
    var Rta = xdc.useModule('ti.uia.services.Rta');

    /*
     * Program.argSize sets the size of the .args section.
     * The examples don't use command line args so argSize is set to 0.
     */
    Program.argSize = 0x0;


    /* Plug in app specific error hook */
     Error.raiseHook = '&errorHook';
     

    /*
     * Uncomment this line to globally disable Asserts.
     * All modules inherit the default from the 'Defaults' module.  You
     * can override these defaults on a per-module basis using Module.common$.
     * Disabling Asserts will save code space and improve runtime performance.
    Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
     */

    /*
     * Uncomment this line to keep module names from being loaded on the target.
     * The module name strings are placed in the .const section. Setting this
     * parameter to false will save space in the .const section.  Error and
     * Assert messages will contain an "unknown module" prefix instead
     * of the actual module name.
    Defaults.common$.namedModule = false;
     */

    /*
     * Minimize exit handler array in System.  The System module includes
     * an array of functions that are registered with System_atexit() to be
     * called by System_exit().
     */
    System.maxAtexitHandlers = 1;       

    /*
     * Uncomment this line to disable the Error print function.  
     * We lose error information when this is disabled since the errors are
     * not printed.  Disabling the raiseHook will save some code space if
     * your app is not using System_printf() since the Error_print() function
     * calls System_printf().
    Error.raiseHook = null;
     */

    /*
     * Uncomment this line to keep Error, Assert, and Log strings from being
     * loaded on the target.  These strings are placed in the .const section.
     * Setting this parameter to false will save space in the .const section.
     * Error, Assert and Log message will print raw ids and args instead of
     * a formatted message.
    Text.isLoaded = false;
     */

    /*
     * Uncomment this line to disable the output of characters by SysMin
     * when the program exits.  SysMin writes characters to a circular buffer.
     * This buffer can be viewed using the SysMin Output view in ROV.
    SysMin.flushAtExit = false;
     */

    /*
     * The BIOS module will create the default heap for the system.
     * Specify the size of this default heap.
     */
    BIOS.heapSize = 16000;

    /* System stack size (used by ISRs and Swis) */
    Program.stack = 0x2000;

    /* Circular buffer size for System_printf() */
    SysMin.bufSize = 0x200;

    /*
     * Create and install logger for the whole system
     */
    var loggerBufParams = new LoggerBuf.Params();
    loggerBufParams.numEntries = 16;
    var logger0 = LoggerBuf.create(loggerBufParams);
    Defaults.common$.logger = logger0;
    Main.common$.diags_INFO = Diags.ALWAYS_ON;

    System.SupportProxy = SysMin;
    //Agent.sysbiosHwiLogging = true;
    //Agent.sysbiosSwiLogging = true;
    //Agent.transport = Agent.Transport_STOP_MODE_ONLY;
    Mmu.enableMMU = false;

    //Agent.sysbiosLoggerSize = 32200;

    Swi.common$.namedInstance = true;
    BIOS.libType = BIOS.LibType_Custom;
    BIOS.customCCOpts = "--endian=little -mv7A8 --abi=eabi --neon --float_support=vfpv3 -q -ms --opt_for_speed=0  --program_level_compile -o0 -g --optimize_with_debug";
    BIOS.assertsEnabled = false;
    Program.sectionsExclude = ".*";
    Clock.tickPeriod = 1000;
    BIOS.logsEnabled = false;
    //BIOS.runtimeCreatesEnabled = false;
    BIOS.swiEnabled = true;
    Task.enableIdleTask = false;
    Task.initStackFlag = false;
    Task.checkStackFlag = false;
    BIOS.cpuFreq.lo = 600000000;
    var clock0Params = new Clock.Params();
    clock0Params.instance.name = "can_clock";
    clock0Params.startFlag = true;
    clock0Params.period = 1000;
    Program.global.can_clock = Clock.create("&can_test_main", 100, clock0Params);
    Task.defaultStackSize = 8192;
    Task.idleTaskStackSize = 8192;
    Memory.defaultHeapSize = 8192;
    var hwi0Params = new Hwi.Params();
    hwi0Params.instance.name = "can0_isr0";
    hwi0Params.priority = 127;
    Program.global.can0_isr0 = Hwi.create(52, "&DCANIsr0", hwi0Params);
    var hwi1Params = new Hwi.Params();
    hwi1Params.instance.name = "can0_parity";
    hwi1Params.priority = 127;
    Program.global.can0_parity = Hwi.create(54, "&DCANParityIsr", hwi1Params);
    Load.hwiEnabled = true;
    Load.windowInMs = 2000;

  • Hi Andreas,

    I would try removing this line from your .cfg file:

    var Rta = xdc.useModule('ti.uia.services.Rta');

    and adding this:

    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');

    Then you should at least get the Log data in stop mode.  LoggingSetup will create the loggers needed by System Analyzer to display the data.

    Here are some tutorials for System Analyzer that should also be helpful:

    http://processors.wiki.ti.com/index.php/System_Analyzer_Tutorials_%28CCSv5%29

    Best regards,

        Janet

  • Hey,
    I already removed the RTA from the project which removed the linker errors.
    But I don't see a benefit in activating the LoggingSetup!

    I need to use the Exec Graph! How can I use this feature?

    currently I get the error:
    assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.
    xdc.runtime.Error.raise: terminating execution

    But I don't know where this error comes from because there is a part of the application I don't know.
  • Hi Andreas,

    If you want to see the execution graph with System Analyzer, then you need to use UIA loggers that System Analyzer can read the data from.  The easiest way to bring these loggers into your program is to just use the ti.uia.sysbios.LoggingSetup module.  This module will create the loggers for you and set up to SYS/BIOS logging to output to these loggers.
    All you need to do is add the line xdc.useModule('ti.uia.sysbios.LoggingSetup'); to your .cfg file.

    For your assertion, can you see the call stack in CCS?  You have set the the Error.raiseHook to your app specific function 'errorHook' in your .cfg file.  Can you set a breakpoint at that function?  This type of assertion can happen if you call Gate_enter() from a non-Task context (eg, from a Swi).

    Best regards,

        Janet

    P.S.  Hi Andreas,

    I am no longer able to reply to your latest post for some reason, so I will edit this post to give you suggestions for your latest post.

    Clock functions are run in the context of a Swi, and so cannot call any blocking functions.  Your Clock function may not have explicitly called Gate_enter(), but must have called another function that calls Gate_enter() (e.g. Memory_alloc()).

    For the Execution graph not displaying any data, you might look at the UIA stairstep example's .cfg file and compare with yours.  You can try removing LoggerBuf, although I'm not sure that will fix the problem.

    Best regards,

        Janet

  • I resolved the assertion, it was a problem using a SYSBIOS Clock function. I removed the Clock function and replaced it by a task. now it works. I didn't find any Gate_enter() functions and I don't know why the Clock function generated the problem. But it's alright now!


    The execution graph still does not work.

    What works is the RTOS Object View (ROV) and the console output of debug messages by use of System_printf()

    the Logging setup is already configured to be used. But concerning the execution graph this does not help.

    Is there anything which has to be configured additionally?