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.

RTOS/TDA2PXEVM: Debugging an exception

Part Number: TDA2PXEVM
Other Parts Discussed in Thread: AWR1243

Tool/software: TI-RTOS

I'm modifying Processor SDK Vision/Radar code (version 3.3.0.0) to support a custom board utilizing AR1243 chips interfaced to a TDA2PXEVM. Some of the examples assume a TDA3x, which only supports 3 UARTs. I modified BSP_AR12XX_NUM_UART_INST and added corresponding entries to bspdrv_ar12xxUartCfgPriv.c gUartModuleAddrList[] and gUartDriverNames[], which is static memory.

Now the code crashes everytime Bsp_ar12xxUartInit() runs, right when I step into the second for loop. This may be due to nearly full memory that blows up when Error_Block eb is defined on the stack. However, I tried adding the equivalent stack allocation within the first for loop to test if it would crash earlier, and it did not.

ROV Classic decodes the exception as:

The exception call stack indicates that the error occurs at line 187, not approximately 164 as seen when stepping line-by-line in the debugger.

I wondered if code optimization was causing a discrepancy about which line was being executed. The build was in debug mode, and I added the following to build_config.mk to make sure this was explicit but did not see any change:
    PROFILE_ipu1_0 = debug
    PROFILE_ipu1_1 = debug

I modified Processor_SDK_Vision_CCS/vision_sdk/links_fw/src/rtos/bios_app_common/tda2px/cfg/BIOS_common.cfg with the following lines, but did not observe any initialized values with the memory browser and was not notified of any memory problems:

Task.initStackFlag = true;

Task.checkStackFlag = true;

Hwi.initStackFlag   = true;

Hwi.checkStackFlag = true;

BIOS.heapTrackEnabled = true;

I modified the stack size in Ipu1_0.cfg from 0x4000 to 0x6000, but this had no effect.

I watched TI's tutorial Debugging Common Application Issues with TI-RTOS but was still unable to resolve these issues (training.ti.com/debugging-common-application-issues-ti-rtos).

Questions:
1. How can the debugger and exception call stack disagree about what line was executed? If it is optimization related, how can I disable that and why was debug mode insufficient?

2. What do I need to change to allocate more memory in the appropriate place? I assume it is the system stack or heap that is a problem, not task stack or heap?

Thanks!