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.

Some problem about UIA debugging tools

Other Parts Discussed in Thread: SYSBIOS

Hi all,

I am working on developing an embeded system which processor is  6671 with SYS/BIOS. I want to use Log_pinrtX or Log_infoX to display some message in my code. However, no matter what I tried, I can not get the correct output result using Log.
Below is the code relevant to log in my project. And I am using JTAGRUNMode.

--------------------------------.cfg file---------------------------------

var System = xdc.useModule('xdc.runtime.System');
SysStd = xdc.useModule('xdc.runtime.SysStd');

System.SupportProxy = SysStd;

var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
LoggingSetup.loadLoggerSize = 1024;
LoggingSetup.sysbiosHwiLogging = true;
LoggingSetup.sysbiosSwiLogging = true;
LoggingSetup.sysbiosTaskLogging = true;

var Load = xdc.useModule('ti.sysbios.utils.Load');

Load.hwiEnabled = false;
Load.swiEnabled = false;

var Log = xdc.useModule("xdc.runtime.Log");
Load.common$.instanceSection = null;
Load.common$.diags_INFO = xdc.module("xdc.runtime.Diags").ALWAYS_ON;

LoggingSetup.mainLoggerSize = 32768;

var LoggerCircBuf = xdc.useModule('ti.uia.runtime.LoggerCircBuf');
//add by new
var loggerCircBuf0Params = new LoggerCircBuf.Params();
loggerCircBuf0Params.transferBufSize = 2048; //zitianjia
loggerCircBuf0Params.instance.name = "loggerCircBuf0";
Program.global.loggerCircBuf0 = LoggerCircBuf.create(loggerCircBuf0Params);


LoggingSetup.loadLogger = Program.global.loggerCircBuf0;
LoggingSetup.mainLogger = Program.global.loggerCircBuf0;
LoggingSetup.sysbiosLogger = Program.global.loggerCircBuf0;
LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGRUNMODE;

-------------------------------------------------------------------------------------------------------------------------

In this case, I could not use Log_infoX or Log_printX anywhere( In main function or other Task I customized ). Otherwise I can get the wrong message in console, like below:

[C66xx_0]ti.sysbios.knl.Semaphore: line 204: assertion failure: A_badContext: bad calling context. Must be called from a Task.
[C66xx_0] xdc.runtime.Error.raise: terminating execution

I need your help, and thanks in advance.

Leo

  • Hi Leo,

    That error indicates that you are calling Semaphore_pend() (or a function that calls Semaphore_pend()) from something other than a task.  For example, if you call Semaphore_pend() in main(), you will get this error.  Maybe you can post your .cfg file, in case there is something that is not configured correctly.

    Best regards,

        Janet

  • Dear Rajasekaran,

    Thanks for your prompt. I have tried to create an example of Log project. In this project, I can use Log_infoX to disply some character string successfully. Then, I ported the same code to my application project, and call Log_info0 in main function. When I open "Tools->RTOS Analyzer-> RTA(legacy)-> Printf Logs" in debug session, I found the output sessage is very strange. for example, I call Log_info("This is a test !") in mian function, I get the message in Printf Logs like below:

      

    I dont know what happend.

    How can I solve this problem?

    I just add below code to the cfg file of my project:

    -----------------------------------------------------------------------------------------------------------------------------

    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Log = xdc.useModule('xdc.runtime.Log');
    var Main = xdc.useModule('xdc.runtime.Main');
    var Text = xdc.useModule('xdc.runtime.Text');
    var Idle = xdc.useModule('ti.sysbios.knl.Idle');

    BIOS.heapSize = 0x2000;

    Program.stack = 0x1000;

    var System = xdc.useModule('xdc.runtime.System');
    SysMin = xdc.useModule('xdc.runtime.SysMin');
    SysMin.bufSize = 0x400;
    System.SupportProxy = SysMin;


    LoggerBuf.TimestampProxy = xdc.useModule('xdc.runtime.Timestamp');
    var LoggerBufParams = new LoggerBuf.Params;
    var logger0 = LoggerBuf.create(LoggerBufParams);
    Main.common$.logger = logger0;
    Task.common$.diags_USER1 = Diags.ALWAYS_ON;
    Main.common$.diags_INFO = Diags.ALWAYS_ON;

    -----------------------------------------------------------------------------------------------------------------------------

    And there is more interesting thing ,that  is when i call"  Program.sectMap[".cinit"] = "DDR3"; "  in .cfg file, I even could not use any RTOS Analyzer. After testing I found that if I want to use RTOS Analyzer,  I can only set "Program.sectMap[".cinit"] "MSMCRAM"; 

    Could you tell me what is the relationship betwen RTOS Analyzer and section map?

    By the way, my platform config is below.


    I need you help, thanks again.

    Leo


  • Dear Janet,

    Thanks for you kindly reply. I checked all of my original projec, and I did not found any illegal invoking of Semaphore_pend.

    When the error happed, I just create a simple task, and Log_info0 is invoked in this task.  The task code like below

    void tskTestFunc()

    {

        while(1)

        {

        Log_info0("This is a test!");

        Task_sleep(2000);

         }

    }

    At present, I still could not use the UIA debugging tools with JTAGRUN mode(or JTAGSTOP mode) normally. Hope sincerely that get your help. 

    Thanks again. By the way, I send the cfg file of my project. Could you check it?5556.MyPorject.cfg


    Leo

  • Hi Leo,

    Your cfg file looks like it has way more than what you need for this simple task.  Could you try removing or commenting out the portions of the .cfg file that are not needed for this task?  Then you can see if the problem goes away.

    I was able to take the Log example and put your while(1) loop in task0Fxn and get the Log_info() statements in System Analyzer.  I removed the logger0 as you had done, and added LoggingSetup, with JTAGSTOPMODE for upload, since I tested this on a simulator.  Here is what I saw in System Analyzer:

    If your basic example works, you can add things back to the configuration, piece by piece, until it fails.  This would isolate the problem.

    Best regards,

        Janet

  • Dear Janet

    Thans for your quickly reply. I know what your mean.

    Actually, my team and I are working on an embeded imaging system.  We've almost finished the low level driver. This imaging system is very complex, and we used many  modules of C6671, for example EDMA, SRIO,PCIE and so on. During the period of development, we just used the method of "System_printf" to display some necessary debugging messages.

    Now, we want to use more debugging tools to debug and evaluate our product. However, my team and I are totally confused by new debuging method you provide, like RTOS Object View(ROV), RTOS Analyzer, System Analyzer, RTA(legacy) and so on.

    I can understand that TI want to provide more and more tools to the developers, but some times developer do not need so much and complicated tools.  

    For us, we are very strong team with lots of experince to develop TI embed DSP system(like DM648, DM642, DM368 etc.). We are very familiar with CCS3.3, and we are used to using Watch window and Log_printf to debug our embeded system. But when we use CCS5.x, we feel that we are totally novices. There are huge differences between CCS3 and CCS5. To decrease the period of development, we have to avoid using new debugging tools. Do not misunderstand please,  we have already read lots of  documents of System Analyzer. But  we still could not use the new debugging tools. the situation like I mentioned before. Even I just changed one code"Program.sectMap[".cinit"] = "DDR3" " in the cfg file, and the UIA debugging tools do not work anymore. We do not know what the relationship between verious debugging tools and other module.

    I checked all cfg code of the simple example project that I created use CCS5( this example can use Log_infoX correctly), Then I port the same code which is in the cfg file of example to my own application project.  The debugging tools till do not work. I do not know what code or module or data/code section could affect UIA/RTOS debugging tools.

    Could Ti provide just one document that can tell us: the developer just need to add these code to the cfg file, then people can use Log_infoX (like Log_printf in CCS 3.3) correctly. After that you can provide advanced specifcation about how to further use it. I think that would be very helpful and ambiable for many people like us.

    No offense, for people like us, we just want to use TI DSP to design product rather than spend a lot of time to study how to use the complicated developing environment. I think that simplification of developing procedure is a good way to get more customers.

    Above is my opinion. Thanks.

    Leo

  • Hi Leo,

    Why don't you try changing the LoggingSetup.upLoadMode to UploadMode_JTAGSTOPMODE.  You can do this by commenting out the line:

    LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGRUNMODE;

    in your .cfg file.  I don't know of any problems with JTAGRUNMODE, but we should still rule that out. Then if you still get the assertion:

    [C66xx_0]ti.sysbios.knl.Semaphore: line 204: assertion failure: A_badContext: bad calling context. Must be called from a Task.
    [C66xx_0] xdc.runtime.Error.raise: terminating execution

    you can try to get the call stack in CCS to see where this is coming from.  You can add this line to your .cfg:

    BIOS.libType = BIOS.LibType_Custom;

    to get more debug information.  Then set a breakpoint at the function:

        xdc_runtime_Assert_raise__I()

    Then maybe you can see the function that called the Semaphore_pend().  As an example, I called Semaphore_pend() from a Swi function, swiLoad() to cause the exception, and here is my callstack:

    Best regards,

        Janet