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.

Timer example for TMDXEVM6678 simulation crashes with CCS

Other Parts Discussed in Thread: SYSBIOS

Hello,

one problem I'm not able to solve is to run a simple timer application within the simulation. Setup is as followed:

-Using target configuration for TMDXEVM6678 with simulation

-CCS Version 5.0.3

-simple example (created a timer static or also a dynamic) or used the given examples (Stairstep or Error from SYS/BIOS)

Everytime the application is started, the CCS crashes when BIOS_start is called. Changing the code so that the timer-function is not called (e.g. like in the Error-example where the creation of the timer fails), the code is running fine. The Stairstep examples shows the same error, CCS is just exiting.

Is there a known bug or can the timer not used within the emulator (maybe due to HWI needed or something)? Thanks for every idea.


Best Regards,

Bernd Krause

  •  

     

    Hi Bernd,

    Can I ask you for a bit further information.

    1 - under Project->Properties->General->RTSC ... what do you have selected as your platform?

    2 - in your ccxml file, which simulator have you chosen?

    I have tried the stairstep example in CCS 5.1 without issue.  Could you also see if 5.1 works/behaves differently for you.

    Attached are screenshots of my working configuration.

    Best Regards,
    Lisa

     

     

     

     

  • Hello Lisa,

    first to the configuration:

    1. The selected platform is not the core, but the ti.platforms.evm6678 (but also tested with the core)

    2. The simulator is the same as yours

    I've tested it again in CCS 5.0.3 with the core as platform, but there's no change. But with CCS 5.1 you're right, the application is working very fine. So it seemes there's a bug fixed in the new CCS. So for the simulation I can work with CCS 5.1. Have you tried the example in CCS 5.0.3? Does it work?

    Thanks for your help,

    Best Regards,

    Bernd

  • Hello Lisa,

    some further issues: if I pause the stairstep example, I can see the logs and everthing is okay. If set a breakpoint, e.g. in the timerfunction, CCS is always terminating (I think if it reaches the breakpoint). After this crash, I have problems to run the program again without chrashes (but I will not focus on debugging so far, but the crashes are a little bit confusing; I'm not sure how to get the program running again without crash; except to delete the project and create it again)...

    Also I tried the Static-Example and it runs, but it seems that the finishFlag won't be set and so the program doesn't terminate. Checking the finishFlag within the expression-view, it is not touched.

    Furthermore pausing the examples or my own code, I often get errors that some files are not found, mostly Idle.c or Hwi_stack.c, see error below. What's the problem here?

    Can't find a source file at "/db/vtree/library/trees/avala/avala-p45x/src/ti/sysbios/hal/Hwi_stack.c"
    Locate the file or edit the source lookup path to include its location.

    I've tried just a very small example with a static or dynamic configured timer. In the timer-function, a variable is increased and a printf or log is made. After a few calls of the timer function, I want to exit the program. But I'm not able to get a solution where CCS is not terminating. Maybe there's a problem with the heapsize in eclipse? Can you try just to write such a simple example or just try to run my one?

    I just provide you the error log for my small example and the example itself. In the log the 'Unhandled event loop exception' is the reason for termination of CCS, but I'm not sure why.

    !ENTRY org.eclipse.ui 4 0 2011-08-30 11:59:42.111
    !MESSAGE Unhandled event loop exception
    !STACK 0
    org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
    	at org.eclipse.swt.SWT.error(SWT.java:4282)
    	at org.eclipse.swt.SWT.error(SWT.java:4197)
    	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
    	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    Caused by: java.lang.NullPointerException
    	at com.ti.dvt.rta.DataViewSessionHandler$LoggerBuffContribution.rebuildCombo(DataViewSessionHandler.java:214)
    	at com.ti.dvt.rta.DataViewSessionHandler$LoggerBuffContribution.createControl(DataViewSessionHandler.java:194)
    	at org.eclipse.jface.action.ControlContribution.fill(ControlContribution.java:97)
    	at org.eclipse.jface.action.SubContributionItem.fill(SubContributionItem.java:77)
    	at org.eclipse.jface.action.ToolBarManager.update(ToolBarManager.java:353)
    	at org.eclipse.ui.internal.ViewPane.updateActionBars(ViewPane.java:452)
    	at org.eclipse.ui.internal.ViewActionBars.updateActionBars(ViewActionBars.java:59)
    	at com.ti.dvt.ui.multipageview.MultiPageView.showPageInfo(MultiPageView.java:804)
    	at com.ti.dvt.ui.multipageview.MultiPageView.activatePageContext(MultiPageView.java:454)
    	at com.ti.dvt.rta.DataViewSessionHandler.updateView(DataViewSessionHandler.java:135)
    	at com.ti.dvt.rta.DataViewSessionHandler.access$1(DataViewSessionHandler.java:125)
    	at com.ti.dvt.rta.DataViewSessionHandler$2.run(DataViewSessionHandler.java:114)
    	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    	... 22 more
    
    !ENTRY org.eclipse.ui 4 0 2011-08-30 11:59:44.832
    !MESSAGE Unhandled event loop exception
    !STACK 0
    org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
    	at org.eclipse.swt.SWT.error(SWT.java:4282)
    	at org.eclipse.swt.SWT.error(SWT.java:4197)
    	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
    	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    Caused by: java.lang.NullPointerException
    	at com.ti.dvt.rta.DataViewSessionHandler$LoggerBuffContribution.rebuildCombo(DataViewSessionHandler.java:214)
    	at com.ti.dvt.rta.DataViewSessionHandler$LoggerBuffContribution.createControl(DataViewSessionHandler.java:194)
    	at org.eclipse.jface.action.ControlContribution.fill(ControlContribution.java:97)
    	at org.eclipse.jface.action.SubContributionItem.fill(SubContributionItem.java:77)
    	at org.eclipse.jface.action.ToolBarManager.update(ToolBarManager.java:353)
    	at org.eclipse.ui.internal.ViewPane.updateActionBars(ViewPane.java:452)
    	at org.eclipse.ui.internal.ViewActionBars.updateActionBars(ViewActionBars.java:59)
    	at com.ti.dvt.ui.multipageview.MultiPageView.showPageInfo(MultiPageView.java:804)
    	at com.ti.dvt.ui.multipageview.MultiPageView.activatePageContext(MultiPageView.java:454)
    	at com.ti.dvt.rta.DataViewSessionHandler.activateReferenceView(DataViewSessionHandler.java:88)
    	at com.ti.dvt.rta.DataViewSessionHandler.updateView(DataViewSessionHandler.java:140)
    	at com.ti.dvt.rta.DataViewSessionHandler.access$1(DataViewSessionHandler.java:125)
    	at com.ti.dvt.rta.DataViewSessionHandler$2.run(DataViewSessionHandler.java:114)
    	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    	... 22 more
    !SESSION 2011-08-30 12:00:26.779 -----------------------------------------------
    eclipse.buildId=I20110613-1736
    java.version=1.6.0_26
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
    Command-line arguments:  -os win32 -ws win32 -arch x86
    
    !ENTRY org.eclipse.core.resources 2 10035 2011-08-30 12:00:28.001
    !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
    
    !ENTRY com.ti.gde.adapter.c6flo 1 0 2011-08-30 12:00:35.797
    !MESSAGE install directory: D:\CCS5.1.0.07001\ccsv5\eclipse
    
    !ENTRY com.ti.gde.adapter.c6flo 1 0 2011-08-30 12:00:35.817
    !MESSAGE xdcToolLocation directory: D:/CCS5.1.0.07001/xdctools_3_22_02_27
    
    !ENTRY com.ti.gde.adapter.c6flo 1 0 2011-08-30 12:00:35.847
    !MESSAGE cgtDirectory directory: D:\CCS5.1.0.07001\ccsv5/tools/compiler/C6000
    
    !ENTRY com.ti.gde.adapter.c6flo 1 0 2011-08-30 12:00:35.860
    !MESSAGE blocksDirectory directory: D:\CCS5.1.0.07001\ccsv5\ccs_base\c6flo_1.0.0.201107281937\Blocks
    
    !ENTRY com.ti.gde.adapter.c6flo 1 0 2011-08-30 12:00:35.939
    !MESSAGE appWriterDirectory directory: D:\CCS5.1.0.07001\ccsv5\ccs_base\c6flo_1.0.0.201107281937\bin
    
    !ENTRY com.ti.gde.diagram 1 0 2011-08-30 12:00:36.251
    !MESSAGE GDE adapter found: com.ti.gde.adapter.c6flo.C6floAdapter   Supporting extensions: [c6flo] PluginID=com.ti.gde.adapter.c6flo
    

    #include <xdc/std.h>
    #include <xdc/runtime/System.h>
    
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/hal/Timer.h>
    #include <xdc/cfg/global.h>
    
    static int iCounter;
    
    Void timerFunc(UArg arg)
    {
    	iCounter++;
    
        if(iCounter > 5)
        {
        	BIOS_exit(0);
        }
    }
    
    // ======== main ========
    Void main()
    {
    	iCounter = 0;
    
        BIOS_start();
    
        return;
    }
    

    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');
    
    BIOS = xdc.useModule('ti.sysbios.BIOS');
    Timer = xdc.useModule('ti.sysbios.hal.Timer');
    HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    
    Program.argSize = 0x0;
    System.maxAtexitHandlers = 4;       
    BIOS.heapSize = 0x2000;
    Program.stack = 0x1000;
    SysMin.bufSize = 0x400;
    System.SupportProxy = SysMin;
    
    // Configure a Timer to interrupt every 1s
    var timerParams = new Timer.Params();
    timerParams.startMode = Timer.StartMode_AUTO;
    timerParams.period = 1000000;        /* 1000000 uSecs = 1s */
    var timer0 = Timer.create(Timer.ANY, '&timerFunc', timerParams); 
    

    Best Regards,

    Bernd

  • Hi Bernd,

    unfortunately I don't have 5.0.3 installed currently so I will have to see if I can find the time to install and try it.   To be honest it is strongly recommended to use the latest version anyhow so I am happy to see you report that 5.1 functions much better for you.   And yes, there are a couple known issues with 5.0.3.

    Regarding the new enquiry.  Which examples (unmodified of course) are giving such errors?  I know we did find a couple things with some of the C6x family examples so it is possibly a know item.

    I took a brief look at the two code snippets you sent.  One thing I noticed is that you do not seem to include the hwi and csl files.  (ie hwi.h)   Make sure to include all necessary files.

    There is some further useful information for you below and in the attached file. 

    Please keep me informed.

    Best Regards,
    Lisa


    http://processors.wiki.ti.com/index.php/TCI6616/C6670/TCI6608/C6678/TCI6618_Device_simulator_User_Guide#What_is_not_supported.3F


    If using the simulator then change the RTDX interface to Simulator by right clicking on
    Input/Output->RTDX and bringing up the properties. Change the RTDX mode to Simulator.

    6012.plugin-hwi.pdf

     

  • Hello Lisa,

    first of all thanks for your help and documents. I think there is some missunderstanding: I test everything in CCS 5.1, so you don't have to install or test something in CCS 5.0.3. Just to order all the stuff, I'll try to give you concrete questions. My final aim is to get a simple application which uses a timer/clock.

     

    1) I've testet the Static-example. Problem is, that it doesn't finish and no printf can be seen. Debugging the example, the program always runs through the Idle_loop (and therefore the method Idle_run() in the Idle.c) and the SWI and Clock never seems to be called. Every breakpoint set in this functions is never reached.

    2) To test the timer module, I've just added a simple timer to the Static-example via SYS/BIOS and change the timer0Fxn to this:

    Void timer0Fxn()
    {
        System_printf("Running timer0Fxn\n");
        finishFlag = TRUE;
    }

    The configuration source also looks okay:

    var timer0Params = new Timer.Params();
    timer0Params.instance.name = "timer0";
    timer0Params.period = 1000000;
    Program.global.timer0 = Timer.create(Timer.ANY, '&timer0Fxn', timer0Params);

    Compiling and running the example with this few changes making CCS to terminate unexpected with an java.nio.channels.ClosedByInterruptException.

    3) I've tested the Stairstep example, also after new creation of the project. Here also CCS terminates unexpected with the java.nio.channels.ClosedByInterruptException.

     

    So my aim is to run the Static / Stairstep example without crashes and maybe with modifications so that a timer can be used.

    Your advice for RTDX should not be relevant for me because this is only necessary for DSP/BIOS and not for SYS/BIOS, am I right? To this topic, I also have a question: are there any (dis-) advantages or differences to use DSP/BIOS or SYS/BIOS? I've decided to use SYS/BIOS due to more examples and more functionality, but I'm not sure what's the main difference between these two packages.

    Best Regards,

    Bernd

  • Hi Bernd,

    first of all I would like you to know that I am looking into this.   I have also found some instability in the examples that will need to be looked into.  As soon as I have some feedback to give, I certainly will do so.

    Regarding your other question - SYS/BIOS is the new version also supporting the MSP430 now actually as well.  You can find some interesting information I think will answer your question on the following pages.

    http://processors.wiki.ti.com/index.php/Differences_Between_DSP/BIOS_and_SYS/BIOS

    http://processors.wiki.ti.com/index.php/Category:SYSBIOS

    http://processors.wiki.ti.com/index.php/Category:DSPBIOS

    http://processors.wiki.ti.com/index.php/Main_Page

    Best Regards,
    Lisa

  • Hi Lisa,

    thanks for your pages, now my question is answered. Then I'll wait for your reply when you can give me more information about the examples running within CCS.

    Best Regards,

    Bernd

  • Hi Bernd,

    I wanted to update you that I filed a bug against the instability of some C6x examples.   So I hope the problems will be resolved soon.  Also note that Beta 2 (M8) was just released so I strongly recommend trying that as the product, being in beta, is constantly receieving feedback/fixes/enhancements.

    Best Regards,
    Lisa