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.

TMS320C28346: Sysbios GateMux failure

Part Number: TMS320C28346
Other Parts Discussed in Thread: SYSBIOS

Getting the following error:

 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

 

in our Interupt handler.

 

The program terminates with an abort();

 

  1. How can I define my own abort() handler to debug this?
  2. I have seen, that this problem also, if the semaphore_post call is executed, after an second IRQ sig is arriving and the last handler is not yet finished.

BR

Anders Lange

  • Hi Anders,

    Is it possible you are calling a gateMutex function from your interrupt (I assume it is a Hwi)?  It is not allowed to call most gateMutex functions from a Hwi or Swi context. You can see which calling contexts are allowed for which gates at the cdoc API reference (ti -> sysbios -> gates):

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/sysbios/6_73_01_01/exports/bios_6_73_01_01/docs/cdoc/index.html

    Note the above is for the latest kernel, you can choose the kernel you are using from the link below and follow the 'API Documentation' link:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/sysbios/

    If this is what is happening, you might need a gateHwi which can be called from interrupt context.

    If that's not the issue, you should be able to add the 'system' module to your cfg file. This will allow you to follow this excerpt from the SYSBIOS user's guide:

    Abort Functions

    By default, when an application aborts due to an error condition, the System module calls its standard abort function, which in turn calls the ANSI C Standard abort() function. If you would like your application to spin indefinitely, so that you can debug the application’s state, add the following statement to your configuration: System.abortFxn = System.abortSpin; Configuring this "spin" function also reduces the code size of your application. The System_abortSpin() API should not be called directly by applications. The prototype for a custom abort handler is: typedef Void (*System_AbortFxn)();

    Hope that helps,

    Sean