I am currently using an F2807x Control Card with a dock for evaluation purposes and have been noticing some strange behavior when using compiler optimizations. Running the following code with no optimizations, the variable g_test increments as expected. However, when setting "Optimization level" to "2 Global Optimizations", the variable remains 0. My first assumption was that the optimizations were restricting debug capabilities. However, I tried replacing the code with toggling GPIO's and once again, the GPIO's toggled when optimizations were off and stopped toggling when optimizations were on. It appears that the processor never makes it to the while loop, but I can't seem to figure out why. Any pointers would be appreciated. (I am using compiler TI v6.4.3 on Code Composer Version 6.1.1.00022)
Uint32 g_test = 0;
void main(void)
{
InitSysCtrl();
while(TRUE) {
g_test++;
}
}