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.

[C66xx_0] ti.sysbios.knl.Semaphore: line 290: assertion failure: A_overflow: Count has exceeded 65535 and rolled over.

Other Parts Discussed in Thread: SYSBIOS

Hi, I am running sysBios 6.33.6.50 on C6657 on CCS5.1

I saw the following error message, but all the semaphores I explicitely define are fine. I could set break point at xdc_runtime_Error_rasieX__E, but still could not find out who causes this exception.

Is there a way for me to find out either who (which task) causes this exception or the address of the semaphore so that I can find out what happened?

thanks

Weichun

[C66xx_0] ti.sysbios.knl.Semaphore: line 290: assertion failure: A_overflow: Count has exceeded 65535 and rolled over.

xdc.runtime.Error.raise: terminating execution

  • Hi Weichun --

    Some code in your application is calling Semaphore_post() many times without any calls to Semaphore_pend().   This is causing the semaphore count to grow until it overflows.   This points to a logic problem somewhere in your app.

    The code that is catching the problem is in <bi9sinstalldir>/packages/ti/sysbios/knl/Semaphore.c:

    You can edit this code and put a b/p at near the assert() to see if you can catch it before the assert.

    Use

    "BIOS.libType = BIOS.LibType_CUSTOM"

    in your .cfg and this will rebuild BIOS with your code change.

    Void Semaphore_post(Semaphore_Object *sem)
    {
        UInt tskKey, hwiKey;
        Semaphore_PendElem *elem;
        Queue_Handle pendQ;

        /* Event_post will do a Log_write, should we do one here too? */
        Log_write2(Semaphore_LM_post, (UArg)sem, (UArg)sem->count);

        pendQ = Semaphore_Instance_State_pendQ(sem);

        hwiKey = Hwi_disable();

        if (Queue_empty(pendQ)) {
            if (((UInt)sem->mode & 0x1) != 0) {   /* if BINARY bit is set */
                sem->count = 1;
            }
            else {
                sem->count++;

                // DEBUG
               if (count == 0) {
                    asm(" nop");           // put a b/p here and look at stack backtrace and semaphore handle.
               }


                Assert_isTrue((sem->count != 0), Semaphore_A_overflow);
            }

  • This is some added information that was very helpful in implementing above.  Was used on the C6748 platform.  I found also that breakpoints would not work on the asm(" nop");, had to add some do nothing 'c' code.  Nice feature for debugging SYS/BIOS.

    http://processors.wiki.ti.com/index.php/SYS/BIOS_FAQs