Other Parts Discussed in Thread: SYSBIOS
Hello,
I am using the TM4C1294NCPDT controller with TIRTOS 2.16.0.08 in an application that requires the usage of interrupts on multiple pins. I am getting the issue that, when binding one of the pins' callback functions, the controller crashes immediately on startup. Here the debug log:
[CORTEX_M4_0] Using MAC address in flash
00000.000 ExecStart: Already Open
ti.sysbios.family.arm.m3.Hwi: line 1095: E_hardFault: FORCED
ti.sysbios.family.arm.m3.Hwi: line 1172: E_busFault: PRECISERR: Immediate Bus Fault, exact addr known, address: 85466898
Exception occurred in background thread at PC = 0x0000a3ce.
Core 0: Exception occurred in ThreadType_Task.
Task name: {unknown-instance-name}, handle: 0x200004c8.
Task stack base: 0x20000518.
Task stack size: 0x800.
R0 = 0x200119ac R8 = 0xffffffff
R1 = 0x85466880 R9 = 0x00000020
R2 = 0x00000000 R10 = 0x00000001
R3 = 0x2001c768 R11 = 0x0200a8c0
R4 = 0x000143ed R12 = 0x20011828
R5 = 0x00000001 SP(R13) = 0x20000bf0
R6 = 0x0200a8c0 LR(R14) = 0x00005a3f
R7 = 0x2001194c PC(R15) = 0x0000a3ce
PSR = 0x61000000
ICSR = 0x00423803
MMFSR = 0x00
BFSR = 0x82
UFSR = 0x0000
HFSR = 0x40000000
DFSR = 0x00000001
MMAR = 0x85466898
BFAR = 0x85466898
AFSR = 0x00000000
Terminating execution...
Here is what I am doing in the code. In main.c:
/* Bind and enable interrupt on the 5th pin */ GPIO_clearInt(SW_INT); GPIO_setCallback(SW_INT, keypadIntCallback); //GPIO_enableInt(SW_INT);
Here is what I am doing in EK_TM4C1294XL.c (these items are at the very top of the function, before the other output pins):
/* Keypad row inputs */ GPIOTiva_PJ_0 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_RISING, //KPAD_RA GPIOTiva_PJ_1 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_RISING, //KPAD_RB GPIOTiva_PP_0 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_RISING, //KPAD_RC GPIOTiva_PE_4 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_RISING, //KPAD_RD /* Switch state interrupt pin */ GPIOTiva_PK_5 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_RISING, //INT 5
I also have the pins in the correct order in EK_TM4C1294XL.h. Note that, in the main.c function, the interrupt is not even enabled. Simply calling the
GPIO_setCallback(SW_INT, keypadIntCallback);
function causes it to crash. Commenting this line out removes the issue and the controller does not crash.
Using the ROV, I see that Handle 0x200004c8 corresponds to the NS_BootTask with priority 9 which is listed as "Preempted." However, I am not sure what that means. I've read elsewhere on the forums that the crash may be happening because the NS_BootTask is being prematurely interrupted but I do not understand why this would be happening, seeing as that I am only binding the interrupt callback and not actually enabling the interrupt.
Thank you for your support,
svl123