Hi
BIOS 6.32.2.39
CGT 7.05
CCS 4.2.4
C6472
I added a timer to the mutex example by adding the code below. When I run it, the log prints do not match the 1000 usec period I configured the timer for.
(assuming that the log_print units are in nsec.)
I also output the freq that the timer is using and it matches the 700 MHz (i.e. divide by 6 gives 116,666,666 freq)
Time SeqID Formatted Msg Logger
-------- --------- ---------------------------------------- ------------------------------------------------
"44,918", 1,Timer freq is high 0 low 116666666,xdc.runtime.LoggerBuf.Instance#0
"51,844,940",92,Timer ISR fired, xdc.runtime.LoggerBuf.Instance#0
"52,544,946",93,Timer ISR fired, xdc.runtime.LoggerBuf.Instance#0
"53,244,934",94,Timer ISR fired, xdc.runtime.LoggerBuf.Instance#0
"53,944,938",95,Timer ISR fired, xdc.runtime.LoggerBuf.Instance#0
Note that the time between "Timer ISR fired" is not 1000 usec. Its exactly 700 usec. Maybe the timer units aren't in usec in the mutex example?
I've measured the accuracy of the log_print time by toggling LEDs based external events. Consequently, I feel its pretty reliable. I'd like to be able to rely on the timer period too as this module is easy to use.
Also note that the sequence ID in the log is not sequencial.
I stole the configuration code below from the BIOS6 Users Guide spruex3j.pdf (p7-15)
void configureTimer()
{
Types_FreqHz freq;
Error_Block eb;
Timer_Params timerParams;
Task_Handle taskHandle;
Error_init(&eb);
Timer_Params_init(&timerParams);
timerParams.period = 1000; /* 1 ms */
timerParams.periodType = Timer_PeriodType_MICROSECS;
timerHandle = Timer_create(Timer_ANY, timerIsr, &timerParams, &eb);
if (timerHandle == NULL)
{
System_abort("Timer create failed");
}
Timer_getFreq(timerHandle, &freq);
Log_print2(Diags_USER1, "Timer freq is high %d low %d", freq.hi, freq.lo);
}
Any ideas what I should check to debug the discrepancy between the timer period and the log_print time?
I've attached the .c and .cfg files7384.mutex.zip
Cheers