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.

Error in Interrupt function

I am using a TM4C1294XL development board and TI-RTOS tirtos_tivac_2_14_00_10 and XDC xdctools_3_31_02_38_core.  I used the TI Uart Console example and added a function and initiated it with the following.

GPIO_setCallback(Board_PP4, gpioSpeedFxn0);
GPIO_clearInt(Board_PP4);
GPIO_enableInt(Board_PP4);

I made changes to Board.h,EK_TM4C1294XL.c and EK_TM4C1294XL.h.

The interrupt works great but when I put a printf in the FXN I get the following error:

{module#37}: line 99: assertion failure: A_badContext: bad calling context. See
GateMutex API doc for details.
xdc.runtime.Error.raise: terminating execution

printf works in the console FXN.

I have read many solutions to this problem but none make much sense.

  • You cannot call printf from your Interrupt function.  This is not safe as printf may actually stop the cpu and break real-time.  By default you can only call printf from main or a Task thread because its using a GateMutex.

    What are the solutions that doesn't make sense to you?

    Judah