Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
We are building an application on custom boards based on the ble5stack simple_peripheral example from the SimpleLink CC26X2 SDK version 2.30.00.34.
First, let me explain why I believe we have issues with hardware exceptions. Our application frequently seems to freeze up. Upon pausing execution, CCS says
Can't find a source file at "/db/vtree/ademars/git_trees/avala-B/src/ti/sysbios/family/arm/m3/Hwi.c"
Locate the file or edit the source lookup path to include its location.
Assuming the proper path should actually be simplelink_cc26x2_sdk_2_30_00_34\kernel\tirtos\packages\ti\sysbios\family\arm\m3\Hwi.c, we pointed CCS to that file. This causes line 877 to be highlighted, which is a comment reading " * ======== Hwi_getHookContext ========" before the function of the same name. Figuring there's some kind of optimization going on that is causing the line trace to be off, we looked at the disassembly. It still places the code in Hwi_getHookContext():
877 * ======== Hwi_getHookContext ========
1003ab7c: 4A06 ldr r2, [pc, #0x18]
1003ab7e: 6810 ldr r0, [r2]
1003ab80: 6814 ldr r4, [r2]
1003ab82: F8D00174 ldr.w r0, [r0, #0x174]
$C$L554:
1003ab86: 2800 cmp r0, #0
1003ab88: D0FD beq $C$L554
881 return (hwi->hookEnv[id]);
But, seeing the infinite loop of branching after comparison with 0, the only corresponding code structure in this file is this function here:
/*
* ======== Hwi_excHandler ========
*/
Void Hwi_excHandler(UInt *excStack, UInt lr)
{
Hwi_module->excActive[0] = TRUE;
/* spin here if no exception handler is plugged */
while (Hwi_excHandlerFunc == NULL) {
;
}
Hwi_excHandlerFunc(excStack, lr);
}
It wasn't until we had done all of this that we saw that a similar name appears in the debug panel:
Texas Instruments XDS110 USB Debug Probe/Cortex_M4_0 (Suspended)
ti_sysbios_family_arm_m3_Hwi_excHandler__l(unsigned int *, unsigned int)() at Hwi.c:877 0x1003AB88
0xFFFFFFFC (no symbols are defined)
So, I believe that our application is becoming trapped in that while loop.
Assuming all of the above is accurate, I'm wondering how we debug this, and how we "plug" an exception handler. I was able to find very little about this topic in any of the documentation. There are a few forum posts about other processors, but the process doesn't seem to be quite the same for this platform. The best thing I've found so far is the ability to change the value of m3Hwi.enableException in the ble_release.cfg file. Even with it set to true, however, the application then hangs in some Error.c file that CCS still can't find, and my best guess as to the actual path gets me nothing more than another infinite loop, namely Error_policySpin(). There are parameters that may have additional information, but I have no idea how to interpret it.
So, where do we go from here?