Hi
I am executing the code below and get a NULL returned for the pointer handle.
I've checked the ROV ti.sysbios.timers.timer64.timer and it says "nulLocalTimers" = 6 and "numTimerDevices" = 24.
The ROV "Basic" tab shows only one timer instance with id 0 and intNum 14
The error block msg says "0x0081683A "E_alreadyD"" which when I look at the memory at 0x0081683A it has "E_alreadyDefined: Hwi already defined: intr# %d....."
Is there a way to pass the message in eb to some error handler for printing? I'd like to find out when intr %d is.
How can I change what HWI the timer module wants to use?
And one more question: Where do I find the enums for timers other than Timer_ANY?
The code below only runs on CORE 0.
Error_Block eb;
Timer_Params timerParams;
//Task_Handle taskHandle;
Log_print1(Diags_USER1, "Creating timer with period = %d", periodInUsec);
Log_print1(Diags_USER1, "The number of timers before create = %d", Timer_getNumTimers());
Error_init(&eb);
Timer_Params_init(&timerParams);
timerParams.period = periodInUsec; /* 2 ms */
timerParams.periodType = Timer_PeriodType_MICROSECS;
timerParams.startMode = Timer_StartMode_AUTO; // will start timer automatically
//timerParams.startMode = Timer_StartMode_USER; // needs Timer_start()
gapFillTimerHandle = Timer_create(Timer_ANY, gapFillTimerIsr, &timerParams, &eb);
//gapFillTimerHandle = Timer_create(1, gapFillTimerIsr, &timerParams, &eb);
//Timer_start(gapFillTimerHandle);
Log_print1(Diags_USER1, "The number of timers after create = %d", Timer_getNumTimers());
if (gapFillTimerHandle == NULL)
{
System_abort("Doppler timer create failed");
}
What version of SYS/BIOS are you using and on which device?
You can add "eb" into a watch window and see what it contains. You can also use the Error APIs (e.g Error_print, Error_getMsg, Error_getSite, etc.) if you prefer to get it during runtime.
Todd
D'oh! Sorry, I just looked at the title! Ignore my two questions. I'll try it out here.
I've attached a modified SYS/BIOS Task example. I've added your code snippet and confirmed the timer was created and ran properly at the configured rate. Can you create the Task example and substitute the .c and .cfg with the attached files? Does it run properly?
Looks like attaching is not working...Trying again...
2844.mutex.cfg.txt
3225.mutex.c.txt
Update
I added timerParams.intNum = 13 and the handle was no longer NULL.
Does't setting intNum to its default let the BIOS select an available interrupt to use?
Cheers
It should. What does your useModule for Timer look like in your .cfg? What does your Timer #include look like in your .c? They must be the same (e.g. either ti.sysbios.hal.Timer or ti.sysbios.timers.timer64.Timer).
Hi Todd
Darn, I hopped that was the problem. Unfortunately they are the same.
In my .c I have
#include <xdc/std.h>#include <xdc/runtime/System.h>//#include <csl_tmr.h>#include <ti/sysbios/BIOS.h>#include <xdc/runtime/Diags.h>#include <xdc/runtime/Log.h>#include <xdc/runtime/Error.h>#include <ti/sysbios/timers/timer64/Timer.h>#include <ti/sysbios/hal/Cache.h>
And in my .cfg I have
var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
Did you resolve the problem? I have similar situation happening.
Best regards,
Damian Gowor
I noticed that it is happening when I am trying to use Timer 0 or Timer 1. Even when I set SYS/BIOS Timer ID to 2 or 3 I still can't use timer 0 and 1. Is there any solution for that?
Damian,
Timer0 is local to core0...timer1 is local to core1...this is true for the first 6 timers. SYSBIOS by default uses the Lower half of each of those timers for its Clock for the core its executing on.
The upper half can still be used by the app, but must be specified in the params when creating the Timer:
ie (in cfg)..... params.half = Timer.Half_UPPER;
Setting Timer ID to 2 or 3 will give you Timer 2 or 3.
If you want to use a timer that is shared by several cores, use one of the shared timers (id 7-12).
Judah
If my reply answers your question please mark the thread as answered
I forgot to mention that I am using OMAP-L138. How are Timer assigned in it?
Um...yes, i thought you were on the same device as the original poster of this thread.
On OMAP-L138 you have Timers 0-3 for DSP but you have to be weary of what timers the ARM is using so that you don't collide.
There are no hard assignments. You should be able to grab any of those timers. Timers 2,3 cannot be run as 2 -32bit timers while 0,1 can be run as 2 32-bit timers.
As before, this can be specified via the "half" parameter...either Half_LOWER or Half_UPPER.
I am trying to understand what is all about in the TM64P_OUT and TM64P_IN GPIO mode. I have read the spruh77a datasheet and the library documentation from following website:
ti.sysbios.timers.timer64.timer
http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_33_04_39/exports/bios_6_33_04_39/docs/cdoc/index.html
I am still confused how it works. Is there any other more detailed specification of this functions? How it relates to the fact that in OMAP-L138 TM64P_OUT and TM64P_IN are on the same pin? What are doing exacly GPINT__ENO, GPINT__ENI, GPDATO__, GPDATI__ bits? What is TIMER mode in GPIO mode?
I will appreciate if somebody will explain this peripheral more clearly.
One more thing. Why no matter what timer I choose as a SYS/BIOS clock I can't 'Timer_create' on this with ID 0 ?
I have double checked and it seems like I can't create a timer with ID 0 and use lower half. It is possible to create it when using upper half. But I need to generate clock on PIN TM64P0_OUT12.
Error_block says "E _ n o t A v a i l a b l e".
Is this problem is related with SYS/BIOS configuration ?