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.

Running Timers in SYSBIOS omapl137

Other Parts Discussed in Thread: SYSBIOS

I have the rCSL timer code up and running with timer 0 and timer 1. I modified a copy of the code to timer 1 as I'm under the impression SYSBIOS uses timer 0 by default, although if it is not, I'm setting the clock module to use timer 0.

Now I'm trying to use the rCSL to control the timers but from SYSBIOS.

I have taken the following steps:

0- new project, sysbios typical

1- copy all necessary source code to the rtsc project

2- use the app.cfg to map the event id with interrupts 4-7 with 4 hwi

3- copy the core of the example into a task

4- changed while(runExample); for a sempaphore

5- added a counter on timer34 which is the one toggling the GPIO led

Commenting out #4 (using while(runExample);)

I get the following error:

ti.sysbios.gates.GateMutex: line 99: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.
xdc.runtime.Error.raise: terminating execution

I can put breakpoints on all ISR (the timer interrupts and the compare interrupts) and the code halts accordingly. 

counter on timer34 isr gets stuck at 1. which means I get into the ISR but it is only triggered once. I double checked that TCR_ENAMODE34 is set to EN_CONT.

If I implement a semaphore instead of while()

00
B16=0x0 B17=0x0
B18=0xc00170b6 B19=0xc0017a98
B20=0xc000b7fc B21=0x0
B22=0xf B23=0x0
B24=0x0 B25=0xc0015468
B26=0x0 B27=0xc0015468
B28=0xffffffff B29=0xffffffff
B30=0xfffffff7 B31=0x0
NTSR=0x1000f
ITSR=0xf
IRP=0xfffffff6
SSR=0x0
AMR=0xc0015440
RILC=0xc0000850
ILC=0xc000ad50
Exception at 0xc0017bc0
EFR=0x2 NRP=0xc0017bc0
Internal exception: IERR=0x8
Opcode exception
ti.sysbios.family.c64p.Exception: line 256: E_exceptionMax: pc = 0x00000000, sp = 0xc0015500.
xdc.runtime.Error.raise: terminating execution

counter on timer34 isr gets stuck at 1

Additional Notes:

I created a new platform that adds timer1 to the platform address since I recall having issues accessing peripherals in the past. (Just to be safe)

Any ideas or suggestion of things I can try?

  • Hi Hoffiz,

    In the below wiki, it is been explained why this error occurs. Please do check whether it helps.

    http://processors.wiki.ti.com/index.php/GateMutex_Assert

  • Thanks Shankari,

    That help to isolate the issue to System_printf.

    I followed the "Isolating offending code"

    The strange part is that I only have System_printf inside a task. None of my hwi have System_Printf.

    Commenting out all system_printf helped remove the Gate Assert but brought back the exception. I have another thread open as I think is a different issue.

    I have 4 hwi tied to timers and compare interrupts. Not sure if the context switching from task when is doing System_printf to hwi could cause this issue.

    Any thoughts?
  • Actually just realize the other thread is just for basic question, maybe related to the exception. I'm using timers and sysbios. Any suggestion of what could be causing an exception?

    This is the whole console after removing all System_printf:

    0
    B18=0x7f000000 B19=0xc3015640
    B20=0x0 B21=0xc3015640
    B22=0xffffffff B23=0xffffffff
    B24=0xfffffff7 B25=0x0
    B26=0x66666666 B27=0x30666666
    B28=0x104 B29=0x1800104
    B30=0xffffffe7 B31=0xc30172fb
    NTSR=0xc3000850
    ITSR=0xc300ae90
    IRP=0x0
    SSR=0x7
    AMR=0xc301568c
    RILC=0x0
    ILC=0xc300cc94
    Exception at 0x20
    EFR=0x2 NRP=0x20
    Internal exception: IERR=0x1
    Instruction fetch exception
    ti.sysbios.family.c64p.Exception: line 256: E_exceptionMax: pc = 0xc3017002, sp = 0xc30156d8.
    xdc.runtime.Error.raise: terminating execution
  • Hoffiz,

    Please post your query on RTOS forum related to sysbios. That is the apt forum for these type of queries