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.

Run-time errors in sysBIOS project

Expert 1115 points
Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hello,

My project is audio processing using DSP/OMAPL138 som on OMAPL138 EVM, CCSV4.2.4 ,default sysBIOS, and IPC versions.

I face the following problems,

1.  Audio impulse/click sound is perceivable when the program runs but stops afterwards.

2.  I get the following run-time error . I call an isr function for audio (HWI5 mapped to sourc_61) having some printf().

--------------------------------------

init_buffers(()
Acoustic Signal Processor starts .....


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

Is it not allowed to use printf() statements from within the isr to write into console? Is there anything that I have to change/set t rectify to get continuous audio.

with regards

Prat

  • Prat,

    You are correct - you are not allowed to use printf() within an ISR. 

    BIOS registers a mutex with the runtime library to make printf() and other functions thread safe.   The mutex is implemented using a SEM semaphore.  Since it is not legal to call SEM_pend() from and ISR with a non-zero timeout, we have a run-time check to look for this. 

    You probably don't want to call printf() from an ISR in any case.  It's an expensive, non-realtime and non-deterministic function that has no business being embedded in any time critical code (which an ISR almost always is).  This is why BIOS/XDC provides a System_printf() (and LOG_printx()) function for efficient debug I/O.

    Dave

  • Dave,

    My purpose of putting printf() or System_printf() in ISR is know whether an interrupt occurs and ISR is being called. What is the better mechanism to know interrupt is occurring?

    May be that will show the reason why audio is not getting captured.

    Thank you

    Prat

  • Prat,

    What I was trying to explain is the the standard printf() call is non-realtime, but the System_printf() is optimized, so you should be able to use it.

    Dave