Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hello,
i am running TI-RTOS on an TM4C1294NCPDT. I am trying to override/hook the exception handler to print out the stacktrace/error message over uart.
My cfg file looks like this:
var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
m3Hwi.enableException = true;
m3Hwi.nvicCCR.DIV_0_TRP = 1;
m3Hwi.nvicCCR.UNALIGN_TRP = 0;
m3Hwi.resetVectorAddress = 0x4000;
m3Hwi.excHookFunc = "&foobar";
m3Hwi.excHandlerFunc = "&myExceptionHandler";
My exception handler looks like this:
void myExceptionHandler(Hwi_ExcContext *excContent)
{
GPIO_write(OUTPUT1, GPIO_CFG_OUT_HIGH);
UARTCharPut(UART0_BASE, 'x');
}
I am producing the heap exception.
void heartBeatFxn(void)
{
while (1)
{
Task_sleep(1000);
GPIO_toggle(OUTPUT2);
Memory_alloc(NULL, 2048, 0, NULL);
}
}
Console shows me this:
ti.sysbios.heaps.HeapMem: line 361: out of memory: handle=0x2003b2cc, size=2072
xdc.runtime.Error.raise: terminating execution
And i am ending in exit.c void abort(void).
The problem is myExceptionHandler or foobar never gets called. I also tried the myExceptionHandler with no parameters at all or void in it but none of it gets called.
What am i doing wrong?