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.

DMTimer crashes at initialisation phase

Other Parts Discussed in Thread: SYSBIOS, AM3359

Hello,

I am running SYSBIOS 6.40.1.15 on BeagleBone (BBB) with AM3359 processor, ARM Compiler Tools 5.1.5, Blackhawk USB 560 emulator. 

When trying to create a simple periodic timer with the SYS/BIOS tool, my SW always crashes at the initialisation functions before reaching main. I have spent a couple of hours debugging the behaviour and it initially looks like the crash occurs in or around ti_sysbios_timers_dmtimer_Timer_initdevice__I function, but I have not had the time to go and verify this initial understanding.

This happens with a clean, newly created SYSBIOS ("Typical") based CCS project with no other changes on top of the example application than adding a function (timerFunction0) and mapping it to a periodic timer in the SYS/BIOS config tool. (Additionally, I have increased stack and heap sizes).

Following code is generated in app.cfg:

var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');

and

Timer.intFreq.lo = 30042; (This does not seem to and should not have any impact to an initialisation phase crash?)

Timer.checkFrequency = false;
var timer0Params = new Timer.Params();
timer0Params.instance.name = "timer0";
timer0Params.period = 10000;
Program.global.timer0 = Timer.create(-1, "&timerFunction0", timer0Params);

This is how the crash looks like:

[CortxA8] 0x6000019f R8 = 0x00000000
R1 = 0x00000000 R9 = 0x8003b238
R2 = 0x00000000 R10 = 0x8001ffa4
R3 = 0xffffffff R11 = 0x0000000d
R4 = 0x8003b670 R12 = 0x48042000
R5 = 0x6000019f SP(R13) = 0x8001ff2c
R6 = 0x00000001 LR(R14) = 0x8003a530
R7 = 0x00000000 PC(R15) = 0x80038020
PSR = 0x6000019f
DFSR = 0x00001808 IFSR = 0x00000000
DFAR = 0x48042038 IFAR = 0x00000000
ti.sysbios.family.arm.exc.Exception: line 180: E_dataAbort: pc = 0x80038020, lr = 0x8003a530.
xdc.runtime.Error.raise: terminating execution

Question: What goes wrong? What did I miss?

  • Utelia,

    not sure about your specific case but the usual reason for such exceptions is that the peripheral is not clocked and therefor ARM tries to access a register that is not there... you need to enable clocking on your peripheral very early on (either in boot loader or in some early Bios function). We really need an FAQ for this...

    regards,

  • Thanks for a very quick suggestion. I already used the TimestampProvider without needing to enable any clocks in particular, and this led me into thinking SYSBIOS would do that for me here as well. Now that you point this out, I agree that this could be a logical explanation. (I also now notice that the timestamps come from some form of program counter and not the timer peripheral).

    Can you suggest where to place the clock enable? In SYS/BIOS - System Overview, is "Startup"  and "Functions Called Before Module Initialization" early enough? (This crash occurs before I reach main.) The "Boot" is not clickable.

  • There are probably multiple places that work. As long as you do this before the timer init gets called.

    1) boot loader (outside of Sys/Bios environment)

    2) working example for me is:

            Startup.resetFxn = "&ownReset";

    My function ownReset() does low level (HW) initialisation. Obviously you can't use most of the Bios APIs here.

    regards,