Hey,
I'm trying to run a timer for triggering a Hwi in order to realize some Hard Realtime applications.
My HW / SW Setup is:
- Code Composer Studio v5.4.0.00091with xdctools_3_25_00_48 and bios_6_35_01_29
- AM3359 on ICE Evalboard
Following chapter 7.3 of the BIOS User Guide Document I wrote the following code to start the timer dynamic:
-----------------------------------------------------------------------------------------------
#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include "sys_mmu.h"
#include <ti/sysbios/hal/Hwi.h>
[...]
#include <ti/sysbios/timers/dmtimer/Timer.h>
unsigned long u32CntVar;
void hwi0Func(UArg a0)
{
u32CntVar++;
}
Void main()
{
System_printf("enter main()\n");
mmuInit(applMmuEntries);
[...]
Timer_Params timerParams;
Timer_Handle myTimer;
Timer_Params_init(&timerParams);
timerParams.period = 100;
timerParams.periodType = Timer_PeriodType_MICROSECS;
timerParams.arg = 1;
timerParams.extFreq.lo = 320000000;
timerParams.extFreq.hi = 0;
myTimer = Timer_create(1, hwi0Func, &timerParams, NULL); //DMTIMER3
if (myTimer == NULL)
System_abort("Timer create failed");
BIOS_start();
}
-----------------------------------------------------------------------------------------------
The timer_create() routine alway crashes with the Exception: "ti.sysbios.family.arm.exc.Exception: line 176: E_dataAbort"
Other users in this community had similar problems. One point I read is that the timer periphery has to be clocked first. I wanted to add:
DMTimer3ModuleClkConfig();
before the timer_create() funktion but could not resolve this Routine.
What file do i have to include for this routine?
Why does the BIOS User Guide not refer to the DMTimerXModuleConfig(); function?
Do I misunderstand this issue?
Regards,
Tim
Ref.: http://e2e.ti.com/support/embedded/bios/f/355/p/270912/946530.aspx