Greetings TI Support:
I've worked on this issue on and off for a few weeks.
I tried all of the examples from the forum questions about ClockTicks and I still can not get the example running.
I need some guidance.
It “seems” like the system Clock is running; but, it is not fully linked back to my application through SYS/BIOS.
Thus, the application does not run correctly because Clock Ticks are always 0.
Configuration Details
Stellaris LM3S6965
Code Composer Version: 5.3.0.00090
SYS/BIOS 6.34.2.18
XDCTools 3.24.5.28
This is What I Have Tried:
When I run the program, I immediately go to Run->Clock->Enable.
At that point, a little Yellow Clock on the lower left hand side of my screen shows up and starts “counting” numbers as I step through the code.
This appears to work as it changes values every time I progress into the code.
I then go to the RTOS Object View Section (ROV)
To the left of that, I click on Test3.out->ViewableModules->Clock.
In the ROV BASIC tab view, I see that both of the Clocks are “created”.
They both indicate that they are “started” with the expected parameters.
This appears to be just fine.
I then move to the ROV MODULE tab view and notice that “ticks” are 0. (Not expected)
I compare this against the little Yellow Clock that started from Run->Clock->enabled and both are different.
I added some additional code to see Return Values on various functions.
They all appear to be fine.
Except… Clock_getTicks(); always returns 0.
By the way, all “added” code is denoted by /* add */
I tried this with ONLY native example code with NONE of my code, with the same results.
I added BIOS.clockEnabled = true; /* add */ at the end of my config file with the same results.
System_printf works just fine with the System_flush(); command.
I see everything on the Console just fine.
Only one line of output winds up on the Console.
Clock Ticks remain to be Zero and clk0Fxn clk1Fxn are never executed.
GEL Files..
tisim_armxx.gel
tisim_ilc.gel
seem to load just fine….
I also successfully loaded 7183.ti816x_ddr.gel from the forum with the same results. It did not help.
I really do not understand how the GEL files affect the environment. This is totally mysterious to me.
I tried to do everything that I could think of before I had to ask.
I learned a lot in the process, so this was not wasted time.
But, I am stuck…
Any help would be appreciated.
Thanks
Rick
Config File:
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 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 Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
/*
* 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;
/*
* 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 = 4;
/*
* 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 = 0x2000;
/* System stack size (used by ISRs and Swis) */
Program.stack = 0x1000;
/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x400;
/*
* Create and install logger for the whole system
*/
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.numEntries = 32;
var logger0 = LoggerBuf.create(loggerBufParams);
Defaults.common$.logger = logger0;
Main.common$.diags_INFO = Diags.ALWAYS_ON;
/*
* Configure SysMin for System_printfs because SysStd cannot be used when
* calling System_printf from Hwis and Swis
*/
System.SupportProxy = SysMin;
BIOS.clockEnabled = true; /* add */
Code:
#include<xdc/std.h>
#include<xdc/runtime/System.h>
#include<ti/sysbios/BIOS.h>
#include<ti/sysbios/knl/Clock.h>
Void clk0Fxn(UArg arg0);
Void clk1Fxn(UArg arg0);
/*
* ======== main ========
*/
Void main()
{
Clock_Handle clk1, clk2;
Clock_Params clkParams;
/* setup Clock params */
Clock_Params_init(&clkParams);
/* Create a periodic Clock Instance with period = 5 system time units */
clkParams.period = 5;
clkParams.startFlag = TRUE;
clk1 = Clock_create(clk0Fxn, 5, &clkParams, NULL); /* clk1 – add */
/* Create an one-shot Clock Instance with timeout = 11 system time units */
clkParams.period = 0;
clkParams.startFlag = FALSE;
clk2 = Clock_create(clk1Fxn, 11, &clkParams, NULL);
Clock_start(clk1);/* add */
Clock_start(clk2);
System_printf("Use Some Time...\n"); /* add */
System_flush(); /* add */
UInt32 time; /* add */
time = Clock_getTicks(); /* add */
/* time is 0 at this point… clk0Fxn and clk1Fxn are never executed */
BIOS_start();
}
/*
* ======== clk0Fxn =======
*/
Void clk0Fxn(UArg arg0)
{
UInt32 time;
time = Clock_getTicks();
System_printf("System time in clk0Fxn = %lu\n", (ULong)time);
System_flush();
}
/*
* ======== clk1Fxn =======
*/
Void clk1Fxn(UArg arg0)
{
UInt32 time;
time = Clock_getTicks();
System_printf("System time in clk1Fxn = %lu\n", (ULong)time);
System_printf("Calling BIOS_exit() from clk1Fxn\n");
System_flush();
BIOS_exit(0);
}